/* =========================================
   CLIENT HERO
========================================= */

.client-hero {
    padding: 22px 24px;

    margin-bottom: 16px;

    background: #ffffff;

    border: 1px solid #dfe6ef;
    border-radius: 14px;
}

.client-hero-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    padding-bottom: 20px;

    border-bottom: 1px solid #edf1f7;
}

.client-identity {
    display: flex;
    align-items: center;
    gap: 14px;
}

.client-avatar {
    width: 56px;
    height: 56px;
    flex: 0 0 56px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;

    background: #e8f1ff;
    color: #2563eb;

    font-size: 20px;
    font-weight: 750;
}

.client-badges {
    display: flex;
    gap: 6px;

    margin-bottom: 5px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;

    padding: 4px 8px;

    border-radius: 999px;

    font-size: 10px;
    font-weight: 700;
}

.badge i {
    font-size: 5px;
}

.badge-active {
    background: #dcfce7;
    color: #047857;
}

.badge-inactive {
    background: #f1f5f9;
    color: #64748b;
}

.client-identity h1 {
    margin: 0;

    color: #0f172a;

    font-size: 22px;
    font-weight: 750;
}

.client-meta {
    display: flex;
    align-items: center;
    gap: 9px;

    margin-top: 5px;

    color: #64748b;

    font-size: 11px;
}

.meta-divider {
    width: 3px;
    height: 3px;

    border-radius: 50%;

    background: #cbd5e1;
}

.client-actions {
    display: flex;
    gap: 8px;
}

.btn-secondary {
    min-height: 38px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;

    padding: 0 14px;

    border: 1px solid #d7e0eb;
    border-radius: 8px;

    background: #ffffff;
    color: #334155;

    font-size: 12px;
    font-weight: 600;

    text-decoration: none;
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}



/* =========================================
   PANELS
========================================= */

.content-card {
    overflow: hidden;

    background: #ffffff;

    border: 1px solid #dfe6ef;
    border-radius: 12px;
}

.content-card-header {
    padding: 18px 20px;

    border-bottom: 1px solid #edf1f7;
}

.content-card-header h2 {
    margin: 0;

    color: #0f172a;

    font-size: 14px;
    font-weight: 700;
}

.content-card-header p {
    margin: 4px 0 0;

    color: #94a3b8;

    font-size: 11px;
}


/* =========================================
   DADOS CLIENTE
========================================= */

.client-details-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 50px;
    row-gap: 24px;

    padding: 22px 20px 26px;
}

.detail-item span {
    display: block;

    margin-bottom: 5px;

    color: #64748b;

    font-size: 11px;
    font-weight: 500;
}

.detail-item strong,
.detail-item a {
    display: block;

    color: #0f172a;

    font-size: 12px;
    font-weight: 650;

    text-decoration: none;
}

.detail-item a {
    color: #2563eb;
}

.detail-item a:hover {
    text-decoration: underline;
}

.client-observations {
    margin: 0 20px 22px;
    padding: 15px;

    border: 1px solid #e2e8f0;
    border-radius: 8px;

    background: #f8fafc;
}

.observations-title {
    display: flex;
    align-items: center;
    gap: 6px;

    margin-bottom: 6px;

    color: #64748b;

    font-size: 10px;
    font-weight: 700;

    text-transform: uppercase;
}

.client-observations p {
    margin: 0;

    color: #475569;

    font-size: 12px;
    line-height: 1.6;

    white-space: pre-line;
}


/* =========================================
   OBRAS
========================================= */

.table-responsive {
    overflow-x: auto;
}

.client-works-table {
    width: 100%;

    border-collapse: collapse;
}

.client-works-table th {
    padding: 12px 14px;

    background: #f8fafc;

    border-bottom: 1px solid #e2e8f0;

    color: #64748b;

    font-size: 10px;
    font-weight: 700;

    text-align: left;
    text-transform: uppercase;
}

.client-works-table td {
    padding: 13px 14px;

    border-bottom: 1px solid #edf1f7;

    color: #475569;

    font-size: 11px;

    vertical-align: middle;
}

.client-works-table tbody tr:last-child td {
    border-bottom: 0;
}

.client-works-table tbody tr:hover {
    background: #fafcff;
}

.work-code {
    color: #334155;

    font-family: monospace;
    font-size: 11px;
    font-weight: 650;
}

.work-info strong {
    display: block;

    color: #0f172a;

    font-size: 12px;
    font-weight: 650;
}

.work-info span {
    display: block;

    margin-top: 4px;

    color: #94a3b8;

    font-size: 10px;
}

.company-badge {
    display: inline-flex;

    padding: 4px 7px;

    border-radius: 6px;

    background: #f1f5f9;
    color: #475569;

    font-size: 9px;
    font-weight: 700;
}

.work-state {
    display: inline-flex;
    align-items: center;
    gap: 5px;

    padding: 4px 7px;

    border-radius: 999px;

    background: #f1f5f9;
    color: #64748b;

    font-size: 9px;
    font-weight: 700;
}

.work-state i {
    font-size: 5px;
}

.work-state.execution {
    background: #dcfce7;
    color: #047857;
}

.work-state.completed {
    background: #eef2f7;
    color: #475569;
}

.work-state.waiting {
    background: #eaf2ff;
    color: #2563eb;
}

.number {
    text-align: right !important;

    white-space: nowrap;
}

.work-action {
    text-align: right;

    white-space: nowrap;
}

.view-work {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    color: #2563eb;

    font-size: 10px;
    font-weight: 700;

    text-decoration: none;
}

.view-work:hover {
    text-decoration: underline;
}


/* =========================================
   PLACEHOLDERS
========================================= */

.coming-soon,
.empty-panel {
    min-height: 220px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    padding: 30px;

    text-align: center;
}

.coming-icon,
.empty-panel > i {
    width: 44px;
    height: 44px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-bottom: 12px;

    border-radius: 10px;

    background: #f1f5f9;
    color: #64748b;
}

.coming-icon.green {
    background: #ecfdf5;
    color: #059669;
}

.coming-icon.blue {
    background: #eff6ff;
    color: #2563eb;
}

.coming-icon.purple {
    background: #f5f3ff;
    color: #7c3aed;
}

.coming-soon strong,
.empty-panel strong {
    margin-bottom: 5px;

    color: #334155;

    font-size: 13px;
}

.coming-soon span,
.empty-panel span {
    color: #94a3b8;

    font-size: 11px;
}


/* =========================================
   RESPONSIVE
========================================= */

@media (max-width: 1000px) {

    .client-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}

@media (max-width: 700px) {

    .client-hero-top {
        align-items: flex-start;
        flex-direction: column;
    }

    .client-details-grid {
        grid-template-columns: 1fr;
    }

}

@media (max-width: 500px) {

    .client-kpis {
        grid-template-columns: 1fr;
    }

}

/* =========================================
   RESUMO FINANCEIRO
========================================= */

.financial-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 18px;
}


.stat-card {
    padding: 22px;
    height: 90%;
    background: #ffffff;

    border: 1px solid #e5e7eb;
    border-radius: 14px;

    box-shadow:
        0 2px 8px rgba(15, 23, 42, 0.04);
}


.stat-card-top {
    display: flex;
    align-items: center;

    gap: 12px;

    margin-bottom: 18px;
}


.stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 42px;
    height: 42px;

    border-radius: 11px;

    font-size: 17px;
}


.stat-icon.blue {
    background: #eff6ff;
    color: #2563eb;
}


.stat-icon.green {
    background: #ecfdf5;
    color: #059669;
}


.stat-icon.orange {
    background: #fff7ed;
    color: #ea580c;
}


.stat-label {
    color: #64748b;

    font-size: 13px;
    font-weight: 600;
}


.stat-value {
    color: #1e293b;

    font-size: 26px;
    font-weight: 700;

    letter-spacing: -0.02em;
}

.stat-icon.purple {

    background: #f5f3ff;

    color: #7c3aed;

}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.stat-subinfo {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px 10px;

    margin-top: 5px;

    color: #64748b;

    font-size: 11px;
    font-weight: 700;
}

.stat-subinfo span:not(:last-child)::after {
    content: "•";

    margin-left: 10px;

    color: #cbd5e1;
}

/* =========================================
   RESUMO DO CLIENTE
========================================= */

.cliente-resumo-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
    gap: 20px;
    align-items: start;
}

.cliente-dados-card,
.cliente-contactos-card {
    min-width: 0;
}


/* =========================================
   CONTACTOS
========================================= */

.contactos-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.btn-adicionar-contacto {
    display: inline-flex;
    align-items: center;
    gap: 7px;

    border: 0;
    background: transparent;

    color: #2563eb;

    font-size: 13px;
    font-weight: 600;

    cursor: pointer;
}

.btn-adicionar-contacto:hover {
    text-decoration: underline;
}


/* LISTA */

.contactos-lista {
    background-color: #FFFFFF;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}




/* CABEÇALHO CONTACTO */


.contacto-principal {
    display: inline-flex;
    align-items: center;

    padding: 2px 7px;

    border-radius: 999px;

    background: #ecfdf5;
    color: #047857;

    font-size: 9px;
    font-weight: 700;

    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* =========================================
   SEM CONTACTOS
========================================= */

.contactos-empty {
    min-height: 210px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    padding: 25px;

    text-align: center;
}

.contactos-empty-icon {
    width: 42px;
    height: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-bottom: 12px;

    border-radius: 50%;

    background: #f8fafc;
    color: #94a3b8;

    font-size: 17px;
}

.contactos-empty strong {
    color: #334155;

    font-size: 13px;
}

.contactos-empty > span {
    max-width: 240px;

    margin-top: 5px;

    color: #94a3b8;

    font-size: 11px;
    line-height: 1.5;
}

.btn-adicionar-contacto-empty {
    display: inline-flex;
    align-items: center;
    gap: 7px;

    margin-top: 15px;
    padding: 8px 12px;

    border: 1px solid #e2e8f0;
    border-radius: 7px;

    background: #ffffff;
    color: #334155;

    font-size: 11px;
    font-weight: 600;

    cursor: pointer;
}

.btn-adicionar-contacto-empty:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}


/* =========================================
   RESPONSIVE
========================================= */

@media (max-width: 1000px) {

    .cliente-resumo-grid {
        grid-template-columns: 1fr;
    }

}

@media (max-width: 600px) {

    .contactos-header {
        align-items: flex-start;
    }

}

/* =========================================
   CHECKBOX PADRÃO DOS MODAIS
========================================= */

.modal-editar-obra .modal-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 12px;

    width: 100%;
    padding: 14px 16px;

    box-sizing: border-box;

    border: 1px solid #d1d5db;
    border-radius: 10px;

    background: #ffffff;

    cursor: pointer;

    transition:
        border-color 0.2s ease,
        background 0.2s ease;
}

.modal-editar-obra .modal-checkbox:hover {
    border-color: #9ca3af;
    background: #f9fafb;
}

.modal-editar-obra .modal-checkbox input {
    width: 16px;
    height: 16px;

    flex: 0 0 16px;

    margin: 2px 0 0;
    padding: 0;

    accent-color: #2563eb;

    cursor: pointer;
}

.modal-editar-obra .modal-checkbox-content {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.modal-editar-obra .modal-checkbox-content strong {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.modal-editar-obra .modal-checkbox-content small {
    font-size: 11px;
    font-weight: 400;
    color: #6b7280;
}

/* =========================================
   MODAL CONTACTO
   USA O LAYOUT PADRÃO DO EDITAR OBRA
========================================= */

#contactoModal .modal-body {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

#contactoModal .modal-body > .form-group {
    width: auto;
    max-width: none;
    min-width: 0;
    grid-column: auto;
}

#contactoModal .modal-body > .form-group-full {
    grid-column: 1 / -1;
}

#contactoModal .form-group input,
#contactoModal .form-group select,
#contactoModal .form-group textarea {
    width: 100%;
    max-width: none;
}

/* =========================================
   MODAIS CONTACTO - GRID PADRÃO
========================================= */

#contactoModal .modal-body,
#editarContactoModal .modal-body {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

#contactoModal .modal-body > .form-group,
#editarContactoModal .modal-body > .form-group {
    width: auto;
    max-width: none;
    min-width: 0;
    grid-column: auto;
}

#contactoModal .modal-body > .form-group-full,
#editarContactoModal .modal-body > .form-group-full {
    grid-column: 1 / -1;
}

#contactoModal .form-group input,
#contactoModal .form-group textarea,
#editarContactoModal .form-group input,
#editarContactoModal .form-group textarea {
    width: 100%;
    max-width: none;
}

/* =========================================
   LISTA DE CONTACTOS
========================================= */

.contactos-lista {
    display: flex;
    flex-direction: column;
    gap: 12px;
}


/* =========================================
   CARD CONTACTO
========================================= */

.contacto-card {
    padding: 14px 16px;

    border: 1px solid #dbe3ee;
    border-radius: 9px;

    background: #f8fafc;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}


.contacto-card:hover {
    border-color: #cbd5e1;

    box-shadow:
        0 2px 8px rgba(15, 23, 42, 0.04);
}


/* =========================================
   HEADER DO CONTACTO
========================================= */

.contacto-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}


.contacto-info {
    min-width: 0;

    display: flex;
    flex-direction: column;
}


.contacto-nome-linha {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}


.contacto-nome {
    color: #0f172a;

    font-size: 13px;
    font-weight: 700;

    line-height: 1.3;
}


/* =========================================
   PRINCIPAL
========================================= */

.contacto-principal {
    display: inline-flex;
    align-items: center;

    padding: 3px 7px;

    border-radius: 5px;

    background: #dcfce7;
    color: #059669;

    font-size: 9px;
    font-weight: 700;

    line-height: 1;

    text-transform: uppercase;
    letter-spacing: 0.03em;
}


/* =========================================
   CARGO / DEPARTAMENTO
========================================= */

.contacto-cargo {
    margin-top: 4px;

    color: #475569;

    font-size: 12px;
    font-weight: 500;
}


.contacto-departamento {
    margin-top: 2px;

    color: #94a3b8;

    font-size: 11px;
}


/* =========================================
   AÇÕES
========================================= */

.contacto-acoes {
    display: flex;
    align-items: center;
    gap: 6px;

    flex-shrink: 0;
}


.contacto-acao {
    width: 30px;
    height: 30px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: 1px solid #dbe3ee;
    border-radius: 7px;

    background: #ffffff;
    color: #64748b;

    font-size: 11px;

    cursor: pointer;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease;
}


/* EDITAR */

.contacto-editar-btn:hover {
    border-color: #bfdbfe;

    background: #eff6ff;
    color: #2563eb;
}


/* ELIMINAR */

.contacto-eliminar-btn {
    color: #94a3b8;
}


.contacto-eliminar-btn:hover {
    border-color: #fecaca;

    background: #fef2f2;
    color: #dc2626;
}


/* =========================================
   TELEFONE / EMAIL
========================================= */

.contacto-dados {
    display: flex;
    flex-direction: column;
    gap: 6px;

    margin-top: 11px;
    padding-top: 10px;

    border-top: 1px solid #e8edf3;
}


.contacto-dados a {
    min-width: 0;

    display: flex;
    align-items: center;
    gap: 8px;

    color: #475569;

    font-size: 11px;
    font-weight: 400;

    text-decoration: none;
}


.contacto-dados a:hover {
    color: #2563eb;
}


.contacto-dados i {
    width: 13px;

    color: #94a3b8;

    font-size: 10px;

    text-align: center;
}


.contacto-dados span {
    overflow: hidden;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.modal-confirmacao {
    max-width: 560px;
}


.remover-contacto-texto {
    margin: 0;

    color: #374151;

    font-size: 14px;
    line-height: 1.6;
}


.remover-contacto-aviso {
    display: flex;
    align-items: flex-start;
    gap: 10px;

    margin-top: 18px;
    padding: 13px 14px;

    border: 1px solid #fde68a;
    border-radius: 10px;

    background: #fffbeb;
    color: #92400e;

    font-size: 12px;
    line-height: 1.5;
}


.remover-contacto-aviso i {
    margin-top: 2px;
}


.modal-editar-obra .btn-danger {
    padding: 11px 20px;

    border: none;
    border-radius: 10px;

    background: #dc2626;
    color: #ffffff;

    font-weight: 600;

    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}


.modal-editar-obra .btn-danger:hover {
    background: #b91c1c;

    transform: translateY(-1px);
}