﻿/* =========================================================
   DMB FinCore - VeÃ­culos
   Escopo: somente pÃ¡ginas com .vehicles-page
   ========================================================= */

.vehicles-page {
    width: 100%;
}

.vehicles-page .module-header {
    align-items: center;
}

.vehicles-page .module-header-actions {
    flex-shrink: 0;
}

.vehicles-page .vehicles-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.vehicles-page .summary-card {
    min-height: 104px;
}

.vehicles-page .summary-icon svg {
    width: 25px;
    height: 25px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.vehicles-page .summary-content {
    flex: 1;
    text-align: center;
}

.vehicles-page .summary-content strong {
    margin-top: 0.45rem;
    font-size: 1.75rem;
}

.vehicles-page .entity-icon {
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 0;
    text-align: center;
    line-height: 1;
}

.vehicles-page .vehicle-document-field {
    padding: 1rem;
    border: 1px dashed #93c5fd;
    border-radius: 14px;
    background: #f8fbff;
}

.vehicles-page .vehicle-document-field small,
.vehicles-page .vehicle-document-present {
    color: #1d4ed8;
    font-weight: 700;
}

.vehicles-page .vehicle-plate-input {
    text-transform: uppercase;
}

.vehicle-form-overlay {
    position: fixed;
    inset: 0;
    z-index: 2100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    overflow-y: auto;
    background: rgba(15, 23, 42, 0.64);
    backdrop-filter: blur(4px);
}

.vehicles-page .vehicle-form-modal {
    width: min(1180px, 96vw);
    max-height: calc(100vh - 3rem);
    margin: auto;
    padding: 1.5rem;
    overflow-y: auto;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.34);
}

.vehicles-page .vehicle-form-modal .form-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.vehicles-page .vehicle-form-modal .form-section-header h2 {
    margin: 0;
}

.vehicles-page .vehicle-form-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border: 1px solid #bfdbfe;
    border-radius: 13px;
    color: #1d4ed8;
    background: #eff6ff;
    font-size: 1.65rem;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
}

.vehicles-page .vehicle-form-close:hover {
    border-color: #1d4ed8;
    background: #dbeafe;
}

.vehicles-page .vehicle-form-feedback {
    margin: 0 0 1.25rem;
}

.vehicles-page .form-required {
    color: #dc2626;
}

.vehicles-page .vehicle-document-modal {
    width: min(1000px, 94vw);
    max-width: 1000px;
}

.vehicle-document-overlay {
    position: fixed;
    inset: 0;
    z-index: 2200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    overflow: auto;
    background: rgba(8, 27, 51, 0.72);
    backdrop-filter: blur(3px);
}

.vehicle-document-overlay .vehicle-document-modal {
    position: relative;
    width: min(1100px, 94vw);
    max-width: 1100px;
    max-height: 92vh;
    margin: auto;
    padding: 1.25rem;
    overflow: auto;
    border: 1px solid #d7e3f2;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(8, 27, 51, 0.3);
}

.vehicle-document-overlay .modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.vehicles-page .vehicle-document-preview {
    display: block;
    width: 100%;
    height: min(72vh, 760px);
    object-fit: contain;
    border: 1px solid #dbe3ef;
    border-radius: 12px;
    background: #f8fafc;
}

.vehicle-print-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    overflow: auto;
    padding: 1.5rem;
    background: rgba(15, 31, 58, 0.72);
}

.vehicle-print-sheet {
    width: min(980px, 100%);
    min-height: 1120px;
    margin: 0 auto;
    padding: 2rem;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
    color: #0b1f3a;
}

.vehicle-print-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.vehicle-print-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 3px solid #1d4ed8;
}

.vehicle-print-header .print-brand-logo {
    display: block;
    width: 210px;
    max-width: 60vw;
    height: auto;
    margin-bottom: 10px;
}

.vehicle-print-header h1 {
    margin: 0.3rem 0;
    font-size: 2rem;
}

.vehicle-print-header p,
.vehicle-print-identification small,
.vehicle-print-footer {
    color: #64748b;
}

.vehicle-print-identification {
    min-width: 180px;
    padding: 1rem;
    border-radius: 14px;
    background: #eff6ff;
    text-align: right;
}

.vehicle-print-identification span,
.vehicle-print-data span,
.vehicle-print-observations > span,
.vehicle-print-section-title span {
    display: block;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.vehicle-print-identification strong {
    display: block;
    margin: 0.25rem 0;
    font-size: 1.6rem;
}

.vehicle-print-data {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
    margin-top: 1.25rem;
}

.vehicle-print-data > div,
.vehicle-print-observations,
.vehicle-print-attachment {
    padding: 0.9rem;
    border: 1px solid #dbe3ef;
    border-radius: 12px;
}

.vehicle-print-data strong {
    display: block;
    margin-top: 0.3rem;
}

.vehicle-print-observations,
.vehicle-print-attachment {
    margin-top: 1rem;
}

.vehicle-print-observations p {
    margin: 0.45rem 0 0;
    white-space: pre-wrap;
}

.vehicle-print-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.8rem;
}

.vehicle-print-attachment img,
.vehicle-print-attachment object {
    display: block;
    width: 100%;
    max-height: 600px;
    object-fit: contain;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.vehicle-print-attachment object {
    height: 600px;
}

.vehicle-print-no-attachment {
    padding: 2rem;
    color: #64748b;
    background: #f8fafc;
    text-align: center;
}

.vehicle-print-footer {
    margin-top: 1.25rem;
    text-align: right;
    font-size: 0.8rem;
}

.vehicles-page .feature-card,
.vehicles-page .form-section,
.vehicles-page .feature-filters,
.vehicles-page .feature-table-card {
    border-color: #dbe3ef;
}

.vehicles-page .feature-table tbody tr:hover {
    background: #f8fbff;
}

.vehicles-page .feature-status-active,
.vehicles-page .status-active {
    color: #059669;
    font-weight: 900;
}

.vehicles-page .feature-status-inactive,
.vehicles-page .status-inactive {
    color: #64748b;
    font-weight: 900;
}

.vehicles-page .feature-money-positive {
    color: #047857;
    font-weight: 900;
}

.vehicles-page .feature-money-negative {
    color: #dc2626;
    font-weight: 900;
}

/* A tabela de veículos segue o mesmo padrão aprovado em Unidades. */
.vehicles-page .table-card,
.vehicles-page .data-table {
    overflow: visible;
}

.vehicles-page .data-table td {
    vertical-align: middle;
}

.vehicles-page .data-table th:nth-child(6),
.vehicles-page .data-table td:nth-child(6) {
    width: 90px;
    min-width: 90px;
    padding-right: 1.25rem;
    padding-left: 1.25rem;
    text-align: center;
}

.vehicles-page .vehicle-type-text {
    display: inline !important;
    margin: 0 !important;
    color: var(--fincore-text) !important;
    font-size: 0.9rem !important;
    font-weight: 700;
    line-height: 1.35;
}

.vehicles-page .data-table th:nth-child(7),
.vehicles-page .data-table td:nth-child(7) {
    width: 100px;
    min-width: 100px;
    text-align: center;
}

.vehicles-page .data-table th:last-child,
.vehicles-page .data-table td:last-child {
    width: 96px;
    min-width: 96px;
    text-align: center;
}

.vehicles-page .vehicle-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 76px;
    padding: 0.38rem 0.75rem;
    border-radius: 999px;
    font-size: 0.92rem;
    font-weight: 800;
    line-height: 1;
    pointer-events: none;
    user-select: none;
}

.vehicles-page .vehicle-status-badge.active {
    color: #047857;
    background: #d1fae5;
}

.vehicles-page .vehicle-status-badge.inactive {
    color: #b91c1c;
    background: #fee2e2;
}

.vehicles-page .vehicle-plate-title {
    color: var(--fincore-navy) !important;
    font-size: 1.1rem !important;
    font-weight: 900 !important;
    line-height: 1.2;
    letter-spacing: 0.015em;
}

.vehicles-page .actions-cell {
    position: relative;
    z-index: 1;
    overflow: visible;
}

.vehicles-page .vehicle-actions-menu {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.vehicles-page .kebab-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 42px;
    border: 1px solid #bfdbfe;
    border-radius: 14px;
    background: #ffffff;
    color: #1d4ed8;
    font-size: 1.6rem;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    box-shadow: none;
}

.vehicles-page .kebab-button:hover {
    background: #eff6ff;
    border-color: #1d4ed8;
}

.vehicles-page .kebab-menu {
    position: absolute;
    top: calc(100% + 0.45rem);
    right: 0;
    z-index: 130;
    min-width: 168px;
    padding: 0.45rem;
    border: 1px solid #dbeafe;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.18);
}

.vehicles-page .kebab-menu button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #0b1f3a;
    padding: 0.75rem 0.9rem;
    text-align: center;
    font-size: 0.96rem;
    font-weight: 800;
    cursor: pointer;
}

.vehicles-page .kebab-menu button:hover {
    background: #eff6ff;
    color: #1d4ed8;
}

.vehicles-page .kebab-menu button.status-action {
    margin-top: 0.35rem;
}

.vehicles-page .kebab-menu button.danger {
    color: #dc2626;
}

.vehicles-page .kebab-menu button.danger:hover {
    color: #b91c1c;
    background: #fef2f2;
}

.vehicles-page .kebab-menu button.success {
    color: #059669;
}

.vehicles-page .kebab-menu button.success:hover {
    color: #047857;
    background: #ecfdf5;
}

.vehicles-page .actions-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    border: 0;
    background: transparent;
    cursor: default;
}

.vehicles-page .data-table tbody tr {
    position: relative;
    z-index: 0;
}

.vehicles-page .data-table tbody tr.actions-row-open {
    z-index: 110;
}

.vehicles-page .actions-cell.is-open,
.vehicles-page .actions-cell.is-open .vehicle-actions-menu {
    z-index: 120;
}

.vehicles-page .vehicle-pagination {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.vehicles-page .vehicle-pagination strong {
    color: var(--fincore-navy);
    font-size: 0.86rem;
}

.vehicles-page .vehicle-pagination button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    color: #1d4ed8;
    background: #ffffff;
    font-size: 1.25rem;
    font-weight: 800;
    cursor: pointer;
}

.vehicles-page .vehicle-pagination button:hover:not(:disabled) {
    border-color: #1d4ed8;
    background: #eff6ff;
}

.vehicles-page .vehicle-pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

@media (max-width: 1050px) {
    .vehicles-page .vehicles-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .vehicles-page .vehicles-summary-grid {
        grid-template-columns: 1fr;
    }

    .vehicle-form-overlay {
        align-items: flex-start;
        padding: 0.5rem;
    }

    .vehicles-page .vehicle-form-modal {
        max-height: calc(100vh - 1rem);
        padding: 1rem;
    }

    .vehicle-document-overlay {
        align-items: stretch;
        padding: 0;
    }

    .vehicle-document-overlay .vehicle-document-modal {
        width: 100%;
        max-width: none;
        max-height: 100vh;
        border-radius: 0;
    }

    .vehicle-print-overlay {
        padding: 0;
    }

    .vehicle-print-sheet {
        min-height: 100vh;
        padding: 1rem;
        border-radius: 0;
    }

    .vehicle-print-header,
    .vehicle-print-section-title {
        align-items: stretch;
        flex-direction: column;
    }

    .vehicle-print-identification {
        text-align: left;
    }

    .vehicle-print-data {
        grid-template-columns: 1fr;
    }

    .vehicles-page .feature-title {
        font-size: 2.25rem;
    }

    .vehicles-page .module-header-actions,
    .vehicles-page .module-header-actions .btn {
        width: 100%;
    }

    .vehicles-page .actions-cell {
        width: 72px;
        min-width: 72px;
    }

    .vehicles-page .kebab-menu {
        right: auto;
        left: 50%;
        transform: translateX(-50%);
    }
}

@media print {
    @page {
        size: A4 portrait;
        margin: 8mm;
    }

    .vehicle-print-overlay,
    .vehicle-print-overlay *,
    .vehicle-print-sheet,
    .vehicle-print-sheet * {
        visibility: visible !important;
    }

    .vehicle-print-overlay {
        position: absolute !important;
        inset: 0 auto auto 0 !important;
        display: block !important;
        width: 100% !important;
        height: auto !important;
        padding: 0 !important;
        overflow: visible !important;
        background: #ffffff !important;
    }

    .vehicle-print-sheet {
        width: 100% !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    .vehicle-print-header,
    .vehicle-print-data,
    .vehicle-print-observations,
    .vehicle-print-attachment {
        break-inside: avoid;
    }

    .no-print {
        display: none !important;
    }
}
