@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap');

/* ============================
   RESET
============================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Segoe UI", Arial, sans-serif;
}

body {
    background: #d5e0ea;
    color: #333;
}

/* ============================
   LOGIN
============================ */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: #e9ecef;
}

.login-box {
    background: white;
    padding: 40px;
    width: 350px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
    text-align: center;
}

.login-box h1 {
    margin-bottom: 20px;
}

.login-box input {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 6px;
    border: 1px solid #ccc;
}

.erro {
    background: #ffcccc;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
    color: #a00;
}

/* ============================
   HEADER EM 3 COLUNAS
============================ */
.top-menu {
    background: #ffffff;
    padding: 15px 30px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    width: 100%;
}

#mainMenu {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 25px;
}

.menu-center {
    display: flex;
    gap: 25px;
    align-items: center;
    justify-content: center;
}

.menu-right {
    justify-self: end;
}

.top-menu nav a,
.dropdown-toggle {
    color: #0090D4;
    text-decoration: none;
    font-weight: 500;
}

.top-menu nav a:hover,
.dropdown-toggle:hover {
    text-decoration: underline;
}

.top-menu .logo img {
    height: 28px;
    width: auto;
    object-fit: contain;
}

/* ============================
   DASHBOARD PERITAGENS
============================ */
.dashboard-peritagens {
    display:flex;
    gap:12px;
    margin:15px 0;
}

.dashboard-peritagens .card {
    flex:1;
    background:#f8fafc;
    border:1px solid #e2e8f0;
    border-radius:8px;
    padding:10px 12px;
}

.dashboard-peritagens .titulo {
    font-size:12px;
    color:#64748b;
    margin-bottom:4px;
}

.dashboard-peritagens .valor {
    font-size:20px;
    font-weight:700;
    color:#0f172a;
}

/* ============================
   DROPDOWN MENU
============================ */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    cursor: pointer;
    padding: 10px;
    font-weight: 500;
    margin-left: 20px;
}

.dropdown-menu {
    display: none;
    position: absolute;
    background: white;
    min-width: 200px;
    border-radius: 6px;
    padding: 8px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 999;
}

.dropdown-menu li {
    list-style: none;
}

.dropdown-item {
    display: block;
    padding: 10px 15px;
    color: #1f2937;
    text-decoration: none;
    font-weight: 500;
}

.dropdown-item:hover {
    background: #f3f4f6;
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
}

.action-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-bottom: 20px;
}

.filtros-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filtros-tabela {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.btn-nova-wrapper {
    margin-left: auto;
}

.btn-nova-peritagem {
    padding: 10px 14px !important;
    font-size: 14px !important;
    border-radius: 6px !important;
}

#filtroFornecedores {
    height: 38px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 15px;
    width: 250px;
}

.filtro-esq {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-limpar {
    background: #0090D4;
    color: #fff;
    border: none;
    padding: 9px 12px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: 0.25s;
}

.btn-limpar:hover {
    background: #015b85;
}
#filtroVendas {
    height: 38px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 15px;
    width: 250px;
}

.filtro-esq input[type="text"] {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    width: 220px;
    font-size: 14px;
}
/* ============================
   MAIN CONTENT
============================ */
main {
    padding: 30px;
}
.page-title {
    margin-bottom: 50px;
}

/* ============================
   FORMULÁRIOS
============================ */
.form-card {
    max-width: 900px;
    margin: 0 auto;
    background: #ffffff;
    padding: 30px 35px;
    border-radius: 14px;
    box-shadow: 0 4px 18px rgba(0,0,0,0.08);
    overflow: hidden;
}

.form-card h2 {
    margin-bottom: 25px;
    font-size: 24px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px 28px;
}

.form-grid label {
    font-weight: 600;
    display: block;
    color: #444;
}

.form-grid input,
.form-grid select,
.textarea-observacoes {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #ccc;
    margin-top: 5px;
    font-size: 15px;
    transition: 0.2s;
}

.form-grid input:focus,
.form-grid select:focus,
.textarea-observacoes:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 2px rgba(16,185,129,0.25);
}

.textarea-observacoes {
    resize: vertical;
    min-height: 90px;
}

/* CHECKBOXES */
.fat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.form-card {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    max-width: 600px;
    margin-top: 20px;
}

.form-group {
    margin-bottom: 18px;
}

.label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
}

.input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 15px;
}

.botoes-form {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.btn-gravar {
    background: #16a34a;
    color: #fff;
}

.btn-cancelar {
    background: #6b7280;
    color: #fff;
}


/* ============================
   BOTÕES
============================ */
.btn {
    background: #0090D4;
    color: white;
    padding: 10px 18px;
    border-radius: 8px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    letter-spacing: 0.3px;
    transition: 0.25s;
}

.btn:hover {
    background: #007bb3;
}

.btn-submit {
    background: #007bb3;
    color: #fff;
}

.btn-submit:hover {
    background: #015e8a;
}

.btn-voltar {
    background: #6b7280;
    color: #fff;
}

.btn-voltar:hover {
    background: #4b5563;
}

.botoes-form {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 25px;
}

.botoes-form .btn,
.botoes-form .btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    height: 42px;
}

.botoes-form {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 25px;
}

.btn-voltar {
    background: #6b7280;
    color: #fff;
    padding: 10px 18px;
    border-radius: 8px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: 0.25s;
}

.btn-voltar:hover {
    background: #4b5563;
}

.btn-submit {
    background: #10b981;
    color: #fff;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 42px;
    transition: 0.25s;
}

.btn-submit:hover {
    background: #0e9f6e;
}

.botoes-form {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 25px;
}

.btn-voltar {
    background: #6b7280;
    color: #fff;
    padding: 10px 18px;
    border-radius: 8px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: 0.25s;
}

.btn-submit {
    background: #10b981;
    color: #fff;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 42px;
    transition: 0.25s;
}

.btn-novo-wrapper {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 15px;
}

/* ============================
   AÇÕES
============================ */
.acoes {
    display: flex;
    gap: 14px;
    align-items: center;
}

.acoes i {
    font-size: 18px;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: 0.2s;
}

.acoes i:hover {
    background: #e5e7eb;
}

/* ============================
   FOTOS
============================ */
.foto-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 5px;
}

.foto-row input[type="file"] {
    flex: 1;
}

.btn-camera {
    background:#0ea5e9;
    color:#fff;
    border:none;
    padding:10px 16px;
    border-radius:6px;
    font-size:15px;
    cursor:pointer;
    display:inline-flex;
    align-items:center;
    gap:8px;
    white-space: nowrap;
}

.btn-camera:hover {
    background:#0284c7;
}

.preview-thumb {
    width:120px;
    border-radius:6px;
    border:1px solid #ddd;
    cursor:pointer;
    transition:0.2s;
}

.preview-thumb:hover {
    transform:scale(1.05);
}

/* ============================
   TABELAS
============================ */
.tabela {
    width: 100%;
    border-collapse: collapse;
    margin-top: 25px;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}

.tabela thead {
    background: #1f2937;
    color: white;
}

.tabela th {
    padding: 14px;
    font-weight: 600;
    text-align: left;
    font-size: 15px;
}

.tabela td {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
}

.tabela tr:nth-child(even) {
    background: #f9fafb;
}

/* BADGES */
.badge {
    display:inline-block;
    padding:4px 10px;
    border-radius:999px;
    font-size:12px;
    font-weight:600;
    color:#fff;
}

.badge-pendente     { background:#838180; }
.badge-condicional  { background:#e43048; }
.badge-definitivo   { background:#0eeb0e; }
.badge-emcurso      { background:#3d72d6; color:#000; }
.badge-concluido    { background:#16a34a; }

.badge { 
    display:inline-block;
    padding:4px 10px;
    border-radius:999px;
    font-size:12px;
    font-weight:600;
    color:#fff;
}

/* ESTADOS */
.badge-em-curso                 { background:#0ea5e9; }
.badge-aguarda-autorizacao      { background:#f9ea16; }
.badge-aguarda-pecas            { background:#fa0122; }
.badge-teste-estrada-controlo-final { background:#f1034b; }
.badge-lavagem                  { background:#b303f8; }
.badge-concluido                { background:#16a34a; }
.badge-cliente-avisado          { background:#025c02; }
.badge-peritagem                { background:#000; color:#FFF; }
.badge-saiu                     { background:#524f4f; }

.badge-aguarda-autorizacao {
    background: #f97316 !important;
    color: #fff !important;
}

.avatar-gcliente {
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    box-shadow: 0 0 4px rgba(0,0,0,0.15);
}
.avatar-gcliente {
    width: 25px !important;
    height: 25px !important;
    font-size: 11px !important;
    line-height: 24px !important;
}

.tabela tbody tr {
    height: 28px !important;
}

.tabela tbody td {
    padding: 3px 6px !important;
    line-height: 1 !important;
}

/* ============================
   RESPONSIVE
============================ */
@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .tabela {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        border-radius: 8px;
    }

    .form-card {
        width: 100%;
        padding: 20px;
    }
}

/* ====== CHECKBOXES TIPOS DE FATURAÇÃO (CORRIGIDO) ====== */

.fat-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 25px;
    margin-bottom: 15px;
}

.fat-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    line-height: 1.2;
    margin: 0; /* remove margens duplicadas */
}

.fat-item input[type="checkbox"] {
    margin: 0;
    transform: translateY(0); /* remove o desalinhamento */
}

.sec-titulo {
    margin-bottom: 6px;
    font-size: 16px;
    font-weight: 600;
}

/* ====== TIPOS DE FATURAÇÃO — 2 COLUNAS ====== */

.fat-container-2col {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 2 colunas */
    gap: 10px 20px;
    margin-bottom: 15px;
}

.fat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    line-height: 1.2;
}

.fat-item input[type="checkbox"] {
    margin: 0;
    transform: translateY(0); /* alinhamento perfeito */
}

.sec-titulo {
    margin-bottom: 6px;
    font-size: 16px;
    font-weight: 600;
}

/* ============================
   SELECT2
============================ */
.filtros-tabela {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

#filtroTexto {
    height: 38px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 15px;
}

.select2-container .select2-selection--single {
    height: 38px !important;
    border-radius: 8px !important;
    border: 1px solid #ccc !important;
    display: flex !important;
    align-items: center !important;
    padding-left: 10px !important;
}

.select2-selection__rendered {
    line-height: 38px !important;
    font-size: 15px !important;
    color: #333 !important;
}

.select2-selection__arrow {
    top: 6px !important;
    right: 8px !important;
}

.select2-dropdown {
    border-radius: 8px !important;
    border: 1px solid #ccc !important;
}

.select2-results__option--highlighted {
    background: #0090D4 !important;
    color: white !important;
}

/* ============================
   Dashboard
============================ */

.page-title {
    font-size: 26px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.dash-card {
    background: white;
    padding: 18px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    transition: 0.2s;
}

.dash-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}

.dash-icon {
    background: #00A1E0;
    color: white;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.dash-info h3 {
    margin: 0;
    font-size: 22px;
    font-weight: bold;
}

.dash-info p {
    margin: 0;
    font-size: 13px;
    color: #666;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

.dash-panel {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.dash-panel h2 {
    margin-bottom: 15px;
    font-size: 18px;
    color: #444;
}

/* ============================
   Menu Links
============================ */

.top-menu nav a,
.top-menu .dropdown-toggle {
    padding: 10px 18px;
    color: #0090D4;
    font-weight: 500;
    text-decoration: none;
    align-items: center;
    gap: 25px;
}

.top-menu nav a:hover,
.top-menu .dropdown-toggle:hover {
    text-decoration: underline;
}

.menu-right a {
    padding: 10px 18px;
    color: #0090D4;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.menu-right a:hover {
    text-decoration: underline;
}

#mainMenu {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    width: 100%;
}

.menu-center {
    display: flex;
    justify-content: center;
    gap: 25px; /* controla o espaçamento entre menus */
}

.menu-right {
    justify-self: end;
}

/* ============================
   TÍTULOS DAS PÁGINAS
   ============================ */
.page-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
}

.page-title h1 {
    font-size: 1.7rem;
    font-weight: 600;
    color: #333;
}


/* ============================
   TABELAS
   ============================ */
.table-container {
    margin-top: 10px;
    background: #ffffff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table thead tr {
    background: #f5f5f5;
}

.data-table th,
.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e0e0e0;
    text-align: left;
}

.data-table tbody tr:hover {
    background: #fafafa;
}


/* ============================
   AVATARES
   ============================ */
.user-avatar-small {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
}

.user-avatar-preview {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ddd;
    margin-bottom: 10px;
}


/* ============================
   TAGS DE ESTADO E TIPO
   ============================ */
.tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.tag-admin {
    background: #ffe5e5;
    color: #c62828;
}

.tag-user {
    background: #e3f2fd;
    color: #1565c0;
}

.tag-active {
    background: #e8f5e9;
    color: #2e7d32;
}

.tag-inactive {
    background: #fff3e0;
    color: #ef6c00;
}


/* ============================
   BOTÕES
   ============================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 16px;
    border-radius: 4px;
    border: none;
    background: #1976d2;
    color: #fff;
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: none;
    gap: 6px;
    transition: background 0.2s;
}

.btn:hover {
    background: #1565c0;
}

.btn-small {
    padding: 5px 10px;
    font-size: 0.8rem;
}

/* Variações */
.btn-danger { background: #d32f2f; }
.btn-danger:hover { background: #b71c1c; }

.btn-warning { background: #f9a825; }
.btn-warning:hover { background: #f57f17; }

.btn-info { background: #0288d1; }
.btn-info:hover { background: #0277bd; }

.btn-secondary { background: #616161; }
.btn-secondary:hover { background: #424242; }

.btn-dark { background: #263238; }
.btn-dark:hover { background: #1c252b; }

.btn-primary { background: #1976d2; }


/* ============================
   FORMULÁRIOS
   ============================ */
.form-container {
    margin-top: 10px;
    max-width: 520px;
}

.form-card {
    background: #ffffff;
    border-radius: 8px;
    padding: 18px 20px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-card label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #444;
}

.form-card input[type="text"],
.form-card input[type="email"],
.form-card input[type="password"],
.form-card input[type="file"],
.form-card select {
    width: 100%;
    padding: 7px 10px;
    border-radius: 4px;
    border: 1px solid #ccc;
    font-size: 0.85rem;
}

.form-card input:focus,
.form-card select:focus {
    outline: none;
    border-color: #1976d2;
    box-shadow: 0 0 0 1px rgba(25,118,210,0.2);
}

.form-card label input[type="checkbox"] {
    margin-right: 6px;
}


/* ============================
   PERMISSÕES
   ============================ */
.perm-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 0.85rem;
}


/* ============================
   CAIXAS DE ERRO
   ============================ */
.error-box {
    background: #ffebee;
    color: #c62828;
    padding: 10px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-bottom: 10px;
}


/* ============================
   SWEETALERT2 — harmonização
   ============================ */
.swal2-popup {
    font-size: 0.9rem !important;
    border-radius: 10px !important;
}

.swal2-title {
    font-size: 1.3rem !important;
    font-weight: 600 !important;
}

.swal2-confirm,
.swal2-cancel {
    font-size: 0.85rem !important;
    padding: 8px 18px !important;
    border-radius: 6px !important;
}

.icon-delete {
    color: #e11d48; /* vermelho moderno */
}

.titulo-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.btn-right {
    margin-left: auto;
}

/* ====== CENTRAR TODAS AS COLUNAS DAS TABELAS ====== */

.tabela th,
.tabela td {
    text-align: center !important;
    vertical-align: middle !important;
}
.acoes-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px; /* espaçamento entre ícones */
}

.acoes-container i {
    font-size: 18px;
    cursor: pointer;
}

/* Espaçar linhas da tabela das entradas */
.tabela tbody tr {
    height: 100px;            /* aumenta a altura da linha */
}

.tabela td {
    padding-top: 8px;
    padding-bottom: 8px;     /* mais espaço interno */
}

.dashboard-alerts {
    margin: 20px 0;
}

.alert-box {
    background: #fff3cd;
    border-left: 5px solid #ffca2c;
    padding: 12px 15px;
    margin-bottom: 10px;
    border-radius: 6px;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-box i {
    color: #d48806;
    font-size: 18px;
}
