/* ================================
   NV TECH SOLUTIONS - CSS OFICIAL
   Versão Revisada e Otimizada
================================ */

/* RESET */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* VARIÁVEIS */
:root {
    --azul-principal: #0A1F44;
    --azul-secundario: #123D7A;
    --azul-hover: #1E5EFF;
    --azul-claro: #E6F0FF;
    --branco: #FFFFFF;
    --cinza-claro: #F4F6FA;
    --cinza-texto: #555;
    --vermelho-logout: #D32F2F;
}

/* BODY */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--cinza-claro);
    color: #222;
}

/* ================================
   HEADER
================================ */

header {
    background-color: var(--azul-principal);
    padding: 15px 0;
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* LOGO */
.logo {
    margin-bottom: 10px;
}

.logo img {
    height: 60px;
    cursor: pointer;
    transition: 0.3s ease;
}

.logo img:hover {
    transform: scale(1.05);
}

/* NAVBAR */
.navbar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 25px;
}

.nav-item {
    position: relative;
}

.nav-item > a {
    text-decoration: none;
    color: var(--branco);
    font-weight: 600;
    padding: 10px 5px;
    display: inline-block;
    transition: 0.3s;
}

.nav-item > a:hover {
    color: var(--azul-hover);
}

/* DROPDOWN */
.dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--branco);
    min-width: 200px;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    padding: 8px 0;
    display: none;
    z-index: 999;
}

.nav-item:hover .dropdown {
    display: block;
}

/* Abertura por toque (celular/tablet) - nao interfere no hover do PC */
.nav-item.active .dropdown {
    display: block;
}

.dropdown a {
    display: block;
    padding: 10px 20px;
    text-decoration: none;
    color: var(--azul-principal);
    transition: 0.2s;
}

.dropdown a:hover {
    background-color: var(--azul-claro);
    color: var(--azul-secundario);
}

/* ================================
   BOTÕES
================================ */

.logout-btn {
    background-color: var(--vermelho-logout);
    padding: 8px 16px;
    border-radius: 6px;
    color: var(--branco);
    text-decoration: none;
    font-weight: 600;
    transition: 0.3s;
}

.logout-btn:hover {
    background-color: #B71C1C;
}

.btn-primary,
.btn-search,
.btn-search-inline {
    padding: 10px 18px;
    background-color: var(--azul-secundario);
    color: var(--branco);
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}

.btn-primary:hover,
.btn-search:hover,
.btn-search-inline:hover {
    background-color: var(--azul-hover);
}

.btn-secondary {
    background: #1f2a40;
    color: #fff;
    padding: 10px 18px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: 0.3s;
    display: inline-block;
}

.btn-secondary:hover {
    background: #141c2b;
}

/* ================================
   DASHBOARD
================================ */

.dashboard-container {
    text-align: center;
    margin-top: 60px;
    padding: 20px;
}

.dashboard-container h1 {
    font-size: 32px;
    color: var(--azul-principal);
    margin-bottom: 15px;
}

.dashboard-container p {
    font-size: 18px;
    color: var(--cinza-texto);
}

/* CARD PADRÃO */
.card {
    background-color: var(--branco);
    width: 100%;
    max-width: 900px;
    margin: 30px auto;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

/* ================================
   FORMULÁRIOS
================================ */

form {
    width: 70%;
    margin: 0 auto;
}

form input,
form select,
form textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 6px;
    border: 1px solid #ccc;
    transition: 0.3s;
}

form input:focus,
form select:focus,
form textarea:focus {
    border-color: var(--azul-hover);
    box-shadow: 0 0 0 2px rgba(30,94,255,0.15);
    outline: none;
}

/* FORM BUSCA */
.form-busca {
    width: 70%;
    margin: 0 auto 25px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.form-busca input {
    min-width: 280px;
    margin-bottom: 0;
    height: 40px;
}

.form-busca button {
    height: 40px;
}

/* ================================
   TABELAS
================================ */

.table-card {
    background: var(--branco);
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    overflow-x: auto;
    margin-top: 10px;
}

.nv-table {
    width: 100%;
    border-collapse: collapse;
}

.nv-table thead {
    background-color: var(--azul-principal);
    color: var(--branco);
}

.nv-table th,
.nv-table td {
    padding: 14px 16px;
    text-align: left;
}

/* Alinhamento correto da coluna Ações */
.nv-table th:last-child,
.nv-table td:last-child {
    text-align: center;
}

.nv-table tbody tr {
    border-bottom: 1px solid #eee;
    transition: 0.2s;
}

.nv-table tbody tr:hover {
    background-color: var(--azul-claro);
}

/* STATUS */
.status-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.status-dot.ativo { background-color: #2ecc71; }
.status-dot.suspenso { background-color: #e74c3c; }
.status-dot.desativado { background-color: #7f8c8d; }

/* ================================
   LOGIN
================================ */

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 80vh;
}

.login-box {
    background: var(--branco);
    padding: 40px;
    width: 420px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    text-align: center;
}

.login-box h2 {
    margin-bottom: 10px;
    color: var(--azul-principal);
}

.login-subtitle {
    font-size: 14px;
    color: var(--cinza-texto);
    margin-bottom: 25px;
}

/* MENSAGENS */
.error-message {
    background: #ffe5e5;
    color: #c40000;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
}

.success-message {
    background: #e6ffed;
    color: #1a7f37;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
}

/* ================================
   RESPONSIVO
================================ */

@media (max-width: 1024px) {
    .navbar {
        flex-wrap: wrap;
        gap: 15px;
    }

    form,
    .form-busca {
        width: 90%;
        flex-direction: column;
        align-items: stretch;
    }

    .card {
        width: 95%;
    }
}

/* ================================
   CONSULTA DE CLIENTE - LAYOUT PROFISSIONAL
================================ */

.cliente-container {
    width: 95%;
    max-width: 1400px;
    margin: 40px auto;
}

.cliente-card {
    background: var(--branco);
    padding: 30px 35px;
    border-radius: 14px;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.08);
    margin-bottom: 35px;
}

.cliente-card h2 {
    color: var(--azul-principal);
    margin-bottom: 25px;
    border-bottom: 2px solid var(--azul-claro);
    padding-bottom: 10px;
    font-size: 20px;
}

/* GRID DE INFORMAÇÕES */
.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px 60px;
}

.info-item {
    display: flex;
    align-items: center;
}

.info-label {
    font-weight: 600;
    color: var(--azul-principal);
    min-width: 180px;
}

.info-value {
    color: #333;
    flex: 1;
    word-break: break-word;
}

/* STATUS DO CONTRATO */
.status-ativo {
    color: #1e7e34;
    font-weight: 600;
}

.status-inativo {
    color: #c82333;
    font-weight: 600;
}

/* RESPONSIVO */
@media (max-width: 900px) {
    .info-grid {
        grid-template-columns: 1fr;
    }
}

/* =============================
   PADRÃO CONSULTAS NV TECH
============================= */

.container {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.card-consulta {
    width: 70%;
    background: #f2f2f2;
    padding: 40px;
    border-radius: 12px;
}

.titulo-consulta {
    text-align: center;
    margin-bottom: 30px;
    font-size: 28px;
    color: #0f2b52;
}

.form-consulta {
    text-align: center;
    margin-bottom: 30px;
}

.input-consulta {
    width: 60%;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
}

.botoes-consulta {
    margin-top: 15px;
}

.botoes-consulta button,
.botoes-consulta a {
    margin: 0 5px;
}

.tabela-wrapper {
    margin-top: 20px;
}

.tabela-consulta {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
}

.tabela-consulta th {
    background: #e0e0e0;
    padding: 12px;
}

.tabela-consulta td {
    padding: 12px;
    border-bottom: 1px solid #ddd;
}

/* =====================================================
   DOCUMENTO ORDEM DE SERVIÇO
===================================================== */

.documento-os {
    max-width: 794px; /* largura A4 */
    margin: 40px auto;
    padding: 40px;
    background: #ffffff;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
    border-radius: 8px;
}

.documento-header {
    text-align: center;
    margin-bottom: 30px;
}

.logo-doc {
    max-width: 220px;
}

.os-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px 40px;
    font-size: 15px;
    margin-bottom: 20px;
}

.secao-centralizada {
    text-align: center;
    margin: 30px 0;
}

.secao-centralizada h3 {
    margin-bottom: 15px;
}

.assinatura {
    margin-top: 50px;
    text-align: center;
}

.acoes-documento {
    margin-top: 30px;
    text-align: center;
}

hr {
    margin: 25px 0;
    border: none;
    border-top: 1px solid #ddd;
}

/* =====================================================
   HISTÓRICO POSICIONAMENTOS
===================================================== */

.posicionamento {
    background: #f8f9fa;
    padding: 12px 15px;
    border-left: 4px solid var(--azul-secundario);
    margin-bottom: 12px;
    border-radius: 4px;
}

.posicionamento-header {
    font-size: 13px;
    color: var(--cinza-texto);
    margin-bottom: 6px;
}

.posicionamento-body {
    font-size: 14px;
}

/* =====================================================
   LISTAGEM ALTERAR OS (PADRÃO NV TABLE)
===================================================== */

.os-container {
    width: 95%;
    max-width: 1400px;
    margin: 40px auto;
}

.os-card {
    background: var(--branco);
    padding: 30px;
    border-radius: 14px;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.08);
}

.os-card h2 {
    color: var(--azul-principal);
    margin-bottom: 20px;
    border-bottom: 2px solid var(--azul-claro);
    padding-bottom: 10px;
}

/* BADGE STATUS OS */

.badge-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
}

.badge-status.aberta {
    background: var(--azul-secundario);
}

.badge-status.fechada {
    background: #198754;
}

/* ==============================
   CORREÇÃO FORMULÁRIOS CONSULTA
============================== */

/* PADRÃO FORM CONSULTA NV */
.form-consulta-nv {
    margin-top: 20px;
    margin-bottom: 20px;
}

.form-consulta-nv input[type="text"] {
    max-width: 300px;
    display: inline-block;
}

.form-consulta-nv button {
    display: inline-block;
}


/* =====================================================
   IMPRESSÃO
===================================================== */

/* =====================================================
   IMPRESSÃO PROFISSIONAL NV TECH
===================================================== */

@media print {

    @page {
        size: A4;
        margin: 15mm;
    }

    body {
        background: white !important;
    }

    .navbar,
    header,
    footer,
    .no-print {
        display: none !important;
    }

    .os-print-container {
        margin: 0;
        padding: 0;
        max-width: 100%;
        box-shadow: none;
    }

    .dashboard-container {
        margin: 0 !important;
        padding: 0 !important;
        text-align: left !important;
    }

    .documento-proposta {
        margin: 0 !important;
        padding: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        box-shadow: none !important;
        border-radius: 0 !important;
    }

    .documento-proposta table,
    .documento-proposta .table-card,
    .documento-proposta > div:not(.rodape-proposta):not(.no-print) {
        page-break-inside: avoid;
    }

    .documento-proposta .nv-table thead,
    .documento-proposta .status-dot {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .rodape-proposta {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .documento-contrato {
        margin: 0 !important;
        padding: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        box-shadow: none !important;
        border-radius: 0 !important;
    }

    .documento-contrato table,
    .documento-contrato .table-card,
    .documento-contrato > div:not(.rodape-proposta):not(.no-print) {
        page-break-inside: avoid;
    }

    .documento-contrato .nv-table thead,
    .documento-contrato .status-dot {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .documento-financeiro {
        margin: 0 !important;
        padding: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        box-shadow: none !important;
        border-radius: 0 !important;
    }

    .documento-financeiro table,
    .documento-financeiro .table-card,
    .documento-financeiro > div:not(.no-print) {
        page-break-inside: avoid;
    }

    .documento-financeiro .nv-table thead,
    .documento-financeiro .status-dot {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* =====================================================
   BOTÕES PADRÃO GLOBAL DE TABELA - NV TECH
===================================================== */

.btn-table {
    display: inline-block;
    padding: 7px 14px;
    margin: 2px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    text-decoration: none;
    transition: 0.2s ease;
    cursor: pointer;
    white-space: nowrap;
}

/* CONSULTAR */
.btn-view {
    background-color: var(--azul-secundario);
    color: #fff;
}

.btn-view:hover {
    background-color: var(--azul-hover);
}

/* EDITAR */
.btn-edit {
    background-color: #ffc107;
    color: #000;
}

.btn-edit:hover {
    background-color: #e0a800;
}

/* EXCLUIR */
.btn-delete {
    background-color: #dc3545;
    color: #fff;
}

.btn-delete:hover {
    background-color: #b02a37;
}

/* CENTRALIZA AÇÕES */
.acoes-tabela {
    text-align: center;
}

/* BOTÃO DE AÇÃO EM FORM AVULSO (fora de tabela) — neutraliza qualquer
   regra de 'form' (inclusive a de largura em telas menores) */
.form-acao-inline {
    display: inline-block !important;
    width: auto !important;
    margin: 0 !important;
    flex-direction: initial !important;
}

/* PADRÃO FIXO BOTÕES FORM OS */

.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 35px;
    padding: 0 25px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    line-height: normal;
    box-sizing: border-box;
}

/* =========================================
   WRAPPER OS (PADRÃO NV)
========================================= */
.os-container {
    width: 95%;
    max-width: 1400px;
    margin: 40px auto;
}

.topo-os {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topo-centro {
    text-align: center;
    flex: 1;
}

.topo-esquerda {
    width: 200px;
}

.topo-direita {
    width: 200px;
    text-align: right;
}

.logo-os {
    width: 140px;
}

.empresa-info {
    margin-top: 10px;
}

.linha {
    border: none;
    border-top: 1px solid #000;
    margin: 15px 0;
}

.linha-dupla {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.linha-dupla div {
    width: 48%;
}

.campo-texto {
    min-height: 80px;
    margin-top: 5px;
}

@media print {

    @page {
        size: A4;
        margin: 15mm;
    }

    body {
        background: white;
    }

    .navbar,
    header,
    footer {
        display: none !important;
    }

    .os-container {
        margin: 0;
        padding: 0;
        width: 100%;
    }
}

/* DOCUMENTO OS - SOMENTE CONSULTA */

.os-documento {
    width: 794px;
    margin: 40px auto;
    padding: 50px 60px;
    background: #ffffff;
    font-family: Arial, sans-serif;
    font-size: 14px;
    box-shadow: 0 0 25px rgba(0,0,0,0.15);
    border-radius: 6px;
}

@media print {

    .navbar,
    header,
    footer,
    .no-print {
        display: none !important;
    }

    .os-documento {
        margin: 0;
        padding: 0;
        box-shadow: none;
        border-radius: 0;
        width: 100%;
    }
}