:root {
    --tech-blue: #2c7ac9;
    --tech-green: #67b043;
    --tech-orange: #f28b26;
    --tech-red: #e74c3c;
    --tech-dark-text: #4a4a4a;
    --tech-light-text: #888888;
    --tech-sidebar-bg: #1a2a3a;
    --tech-sidebar-text: #e0e0e0;
    --tech-sidebar-active-bg: #2c7ac9;
    --tech-content-bg: #f8f9fa;
    --card-bg: #ffffff;
    --card-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}
body { font-family: 'Poppins', sans-serif; background-color: var(--tech-content-bg); color: var(--tech-dark-text); overflow-x: hidden; }
#wrapper { display: flex; transition: all 0.3s ease; }
#sidebar-wrapper { min-height: 100vh; width: 260px; background-color: var(--tech-sidebar-bg); transition: margin 0.3s ease-out; color: var(--tech-sidebar-text); box-shadow: 3px 0 10px rgba(0,0,0,0.1); }
#sidebar-wrapper .sidebar-heading { padding: 1rem 1.25rem; text-align: center; }
.sidebar-logo { max-width: 90%; height: auto; padding: 10px 0; }
#sidebar-wrapper .list-group-item { background-color: var(--tech-sidebar-bg); color: var(--tech-sidebar-text); border: none; padding: 1rem 1.5rem; font-weight: 500; border-left: 4px solid transparent; }
#sidebar-wrapper .list-group-item.active { background-color: var(--tech-sidebar-active-bg); color: #fff; font-weight: 600; border-left-color: var(--tech-green); }
#page-content-wrapper { flex: 1; min-width: 0; }
#wrapper.toggled #sidebar-wrapper { margin-left: -260px; }

#page-content-wrapper nav {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid #eee;
    padding: 0.75rem 1.5rem;
}
.page-title {
    font-weight: 600;
    font-size: 1.5rem;
    color: var(--tech-dark-text);
}
#main-content { padding: 1.5rem; }

.card { border: none; border-radius: 12px; box-shadow: var(--card-shadow); }
.card-header { background-color: var(--card-bg); border-bottom: 1px solid #f0f2f5; padding: 1.25rem; font-weight: 600; color: var(--tech-dark-text); border-top-left-radius: 12px; border-top-right-radius: 12px; }
.table { vertical-align: middle; }
.table thead th { font-weight: 600; text-transform: uppercase; font-size: 0.8rem; color: var(--tech-light-text); }
.btn { border-radius: 8px; font-weight: 500; }
.btn-primary { background-color: var(--tech-blue); border-color: var(--tech-blue); }
.btn-success { background-color: var(--tech-green); border-color: var(--tech-green); }
.kpi-card { background-color: var(--card-bg); border-radius: 12px; padding: 1.5rem; display: flex; align-items: center; }
.kpi-icon { font-size: 2rem; padding: 1rem; border-radius: 50%; margin-right: 1rem; display: flex; align-items: center; justify-content: center; color: #fff; }
.kpi-icon.icon-blue { background-color: var(--tech-blue); }
.kpi-icon.icon-orange { background-color: var(--tech-orange); }
.kpi-icon.icon-red { background-color: var(--tech-red); }
.kpi-icon.icon-green { background-color: var(--tech-green); }
.kpi-content .kpi-value { font-size: 2rem; font-weight: 700; color: var(--tech-dark-text); line-height: 1.2; }
.kpi-content .kpi-title { font-size: 0.9rem; color: var(--tech-light-text); }
.chart-container { position: relative; height: 320px; width: 100%; }
.action-list .list-group-item { display: flex; justify-content: space-between; align-items: center; border: 0; border-bottom: 1px solid #f0f2f5; padding: 1rem 0; }
.action-list .list-group-item:last-child { border-bottom: 0; }
.action-list .vehicle-info { font-weight: 500; }
.action-list .status-date { font-size: 0.85rem; color: var(--tech-light-text); }
.status-badge { font-size: 0.8rem; padding: 0.4em 0.8em; border-radius: 20px; }
.status-badge.status-ok { background-color: #eaf6e5; color: var(--tech-green); }
.status-badge.status-attention { background-color: #fff4e8; color: var(--tech-orange); }
.status-badge.status-critical { background-color: #fdedeb; color: var(--tech-red); }
/* Responsividade e melhorias UX */
@media (max-width: 767px) {
    #sidebar-wrapper {
        margin-left: -260px;
        position: fixed;
        z-index: 1000;
        height: 100vh;
    }
    #wrapper.toggled #sidebar-wrapper {
        margin-left: 0;
    }
    #page-content-wrapper {
        width: 100%;
    }
    .kpi-card {
        flex-direction: column;
        text-align: center;
    }
    .kpi-icon {
        margin-right: 0;
        margin-bottom: 1rem;
    }
    .table-responsive {
        font-size: 0.9rem;
    }
    .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
    }
}

@media (min-width: 768px) {
    #sidebar-wrapper {
        margin-left: 0;
    }
    #wrapper.toggled #sidebar-wrapper {
        margin-left: -260px;
    }
}

/* Melhorias de UX */
.btn:focus, .form-control:focus, .form-select:focus {
    box-shadow: 0 0 0 0.2rem rgba(44, 122, 201, 0.25);
}

.is-invalid {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.table tbody tr {
    transition: background-color 0.15s ease-in-out;
}

.modal-backdrop {
    backdrop-filter: blur(3px);
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Loading states */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Toast container improvements */
.toast {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}



/* Better form styling */
.form-control, .form-select {
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}


/* Improved button styles */


/* Better sidebar on mobile */
@media (max-width: 767px) {
    #wrapper.toggled::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }
}

/* Improved status badges */
.status-badge {
    font-weight: 500;
    letter-spacing: 0.025em;
}

/* Better chart containers */
.chart-container canvas {
    border-radius: 8px;
}

/* Mobile Bottom Navigation */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #ffffff;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0.5rem 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    height: 70px;
}

.mobile-bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--tech-light-text);
    padding: 0.5rem;
    border-radius: 8px;
    min-width: 60px;
    position: relative;
}

.mobile-bottom-nav .nav-item i {
    font-size: 1.2rem;
    margin-bottom: 0.2rem;
}

.mobile-bottom-nav .nav-item span {
    font-size: 0.7rem;
    font-weight: 500;
    text-align: center;
    line-height: 1;
}

.mobile-bottom-nav .nav-item.active {
    color: var(--tech-blue);
    background-color: rgba(44, 122, 201, 0.1);
}



/* Modern Dashboard Cards */
.dashboard-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 16px;
    padding: 16px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    min-height: 110px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* Espaçamento reduzido para cards do dashboard */
.dashboard-card-spacing {
    margin-bottom: 4px !important;
    padding-left: 2px;
    padding-right: 2px;
}

.card-background-pattern {
    position: absolute;
    top: -30px;
    right: -30px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    opacity: 0.05;
}

.card-vehicles {
    border-left: 4px solid var(--tech-blue);
}
.card-vehicles .card-background-pattern {
    background: linear-gradient(45deg, var(--tech-blue), #4a90e2);
}
.card-vehicles .card-icon {
    color: var(--tech-blue);
}

.card-maintenance {
    border-left: 4px solid var(--tech-orange);
}
.card-maintenance .card-background-pattern {
    background: linear-gradient(45deg, var(--tech-orange), #ff9f43);
}
.card-maintenance .card-icon {
    color: var(--tech-orange);
}

.card-costs {
    border-left: 4px solid var(--tech-green);
}
.card-costs .card-background-pattern {
    background: linear-gradient(45deg, var(--tech-green), #2ed573);
}
.card-costs .card-icon {
    color: var(--tech-green);
}

.card-overdue {
    border-left: 4px solid var(--tech-red);
}
.card-overdue .card-background-pattern {
    background: linear-gradient(45deg, var(--tech-red), #ff6b6b);
}
.card-overdue .card-icon {
    color: var(--tech-red);
}

.dashboard-card .card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
}

.card-icon {
    font-size: 1.5rem;
    opacity: 0.8;
    flex-shrink: 0;
}


.card-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--tech-dark-text);
    line-height: 1.1;
    margin: 0;
}

.card-label {
    font-size: 0.8rem;
    color: var(--tech-light-text);
    font-weight: 500;
    margin-bottom: 4px;
    line-height: 1.2;
}

.card-trend {
    display: flex;
    align-items: center;
    font-size: 0.75rem;
    color: var(--tech-light-text);
    gap: 4px;
}

.card-trend i {
    font-size: 0.8rem;
}

.trend-success {
    color: var(--tech-green) !important;
}

.trend-warning {
    color: var(--tech-orange) !important;
}

.trend-danger {
    color: var(--tech-red) !important;
}


/* Responsive improvements for dashboard cards */
@media (max-width: 768px) {
    .dashboard-card {
        min-height: 95px;
        padding: 14px;
    }

    .dashboard-card .card-header {
        gap: 8px;
        margin-bottom: 6px;
        background: none !important;
        border: none !important;
        padding: 0 !important;
    }

    .card-value {
        font-size: 1.2rem;
    }

    .card-icon {
        font-size: 1.2rem;
    }

    .card-label {
        font-size: 0.75rem;
        margin-bottom: 2px;
    }

    .card-trend {
        font-size: 0.65rem;
    }

}

/* Add padding to main content on mobile to account for bottom nav */
@media (max-width: 767px) {
    #main-content {
        padding-bottom: 90px !important;
    }

    /* Hide desktop sidebar on mobile */
    #sidebar-wrapper {
        display: none;
    }

    /* Full width content on mobile */
    #page-content-wrapper {
        width: 100% !important;
        margin-left: 0 !important;
    }
}

/* Maintenance Report Styles */
.maintenance-report {
    padding: 30px;
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--tech-blue);
    padding-bottom: 20px;
}

.company-info {
    display: flex;
    align-items: center;
}

.report-logo {
    width: 80px;
    height: 80px;
    margin-right: 20px;
    object-fit: contain;
}

.company-details h2 {
    margin: 0;
    color: var(--tech-blue);
    font-size: 24px;
}

.company-details p {
    margin: 5px 0 0 0;
    color: var(--tech-light-text);
}

.report-title {
    text-align: right;
}

.report-title h3 {
    margin: 0;
    color: var(--tech-blue);
    font-size: 20px;
}

.report-title p {
    margin: 5px 0;
    color: var(--tech-light-text);
    font-size: 14px;
}

.report-section {
    margin-bottom: 25px;
}

.report-section h4 {
    color: var(--tech-blue);
    border-bottom: 1px solid #ddd;
    padding-bottom: 8px;
    margin-bottom: 15px;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.info-item {
    display: flex;
    margin-bottom: 10px;
}

.info-item label {
    font-weight: bold;
    min-width: 140px;
    color: var(--tech-dark-text);
}

.info-item span {
    color: var(--tech-light-text);
}

.cost-highlight {
    color: var(--tech-blue);
    font-weight: bold;
    font-size: 16px;
}

.observations {
    background: var(--tech-content-bg);
    padding: 15px;
    border-radius: 8px;
    color: var(--tech-dark-text);
    line-height: 1.6;
    border-left: 4px solid var(--tech-blue);
    white-space: pre-line;
    word-wrap: break-word;
}

.attachments-list {
    background: var(--tech-content-bg);
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid var(--tech-green);
}

.attachment-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 8px;
    background: white;
    border-radius: 5px;
    border: 1px solid #e9ecef;
}

.attachment-item:last-child {
    margin-bottom: 0;
}

.report-footer {
    margin-top: 40px;
    text-align: center;
    color: var(--tech-light-text);
    font-size: 12px;
}

.report-footer hr {
    border: 1px solid #ddd;
    margin-bottom: 15px;
}

/* Estilos para as fotos do veículo no relatório */
.vehicle-photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.vehicle-photo-item {
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    background-color: #f9f9f9;
}

.vehicle-photo {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.vehicle-photo:hover {
    transform: scale(1.05);
}

.photo-caption {
    margin-top: 8px;
    font-size: 12px;
    color: #666;
    font-weight: 500;
}


/* Responsive adjustments for report */
@media (max-width: 768px) {
    .maintenance-report {
        padding: 20px;
    }

    .report-header {
        flex-direction: column;
        text-align: center;
    }

    .company-info {
        margin-bottom: 20px;
    }

    .report-title {
        text-align: center;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .info-item {
        flex-direction: column;
    }

    .info-item label {
        min-width: auto;
        margin-bottom: 5px;
    }

    .vehicle-photos-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .vehicle-photo {
        height: 120px;
    }
}

/* Print Styles for Vehicle Photos */
@media print {
    .vehicle-photos-grid {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 15px !important;
        margin-top: 15px !important;
        page-break-inside: avoid !important;
    }

    .vehicle-photo-item {
        text-align: center !important;
        border: 1px solid #ddd !important;
        border-radius: 8px !important;
        padding: 10px !important;
        background-color: #f9f9f9 !important;
        page-break-inside: avoid !important;
    }

    .vehicle-photo {
        width: 100% !important;
        height: 120px !important;
        object-fit: cover !important;
        border-radius: 5px !important;
    }

    .photo-caption {
        margin-top: 8px !important;
        font-size: 10px !important;
        color: #666 !important;
        font-weight: 500 !important;
    }


}

/* Vehicle Report Layout Styles */
.info-grid-vehicle, .info-grid-stats {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.info-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
}

.info-item-inline {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 150px;
    max-width: 200px;
}

.info-item-inline label {
    font-weight: bold;
    min-width: 50px;
    color: #333;
    margin-right: 8px;
    white-space: nowrap;
}

.info-item-inline span {
    color: #666;
}

/* Garantir que os 4 primeiros itens fiquem na mesma linha */
.info-grid-vehicle .info-row:first-child .info-item-inline {
    min-width: 120px;
    max-width: 180px;
    flex: 0 1 calc(25% - 15px);
}

/* Configuração específica para segunda linha (Placa e Condutor Responsável) */
.info-grid-vehicle .info-row:nth-child(2) .info-item-inline {
    min-width: 250px;
    max-width: 400px;
    flex: 1;
}

.info-grid-vehicle .info-row:nth-child(2) .info-item-inline label {
    min-width: 140px;
    white-space: nowrap;
}

.info-grid-vehicle .info-row:nth-child(2) .info-item-inline span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .info-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .info-item-inline {
        min-width: 100%;
        justify-content: space-between;
        padding: 8px 0;
        border-bottom: 1px solid #eee;
    }

    .info-item-inline:last-child {
        border-bottom: none;
    }

    /* Labels maiores funcionam melhor em mobile com layout em coluna */
    .info-grid-vehicle .info-row:nth-child(2) .info-item-inline label {
        min-width: auto;
        margin-right: 10px;
    }

    .info-grid-vehicle .info-row:nth-child(2) .info-item-inline span {
        text-overflow: clip;
        overflow: visible;
        white-space: normal;
    }
}

/* Cronograma de Manutenção */
.alert-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

.btn-group .btn.active {
    background-color: var(--tech-blue);
    border-color: var(--tech-blue);
    color: white;
}

/* Cards do cronograma */

/* Status badges específicos */
.badge.bg-danger {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Estilo da Placa Mercosul Brasileira */
.plate-mercosul {
    display: inline-block;
    background: #fff;
    border: 2px solid #000;
    border-radius: 6px;
    padding: 18px 8px 6px 8px;
    font-family: 'Arial Black', Arial, sans-serif;
    font-weight: 900;
    font-size: 16px;
    color: #000;
    text-align: center;
    min-width: 100px;
    letter-spacing: 2px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    position: relative;
    line-height: 1;
}

.plate-mercosul::before {
    content: "BRASIL";
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    background: #004080;
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    font-family: Arial, sans-serif;
    padding: 2px 0;
    text-align: center;
    border-radius: 3px 3px 0 0;
}

.plate-mercosul.small {
    font-size: 12px;
    min-width: 80px;
    padding: 14px 6px 4px 6px;
    letter-spacing: 1px;
}

.plate-mercosul.small::before {
    font-size: 8px;
    padding: 1px 0;
}

/* Placa dentro de badge - remove estilos conflitantes */
.badge.plate-mercosul {
    background: #fff !important;
    color: #000 !important;
    border: 2px solid #000 !important;
    padding: 18px 8px 6px 8px !important;
}

.badge.plate-mercosul.small {
    padding: 14px 6px 4px 6px !important;
}

/* Estilos específicos para impressão/PDF - forçar cores */
@media print {
    * {
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Forçar estilos inline para PDF */
    span[style*="background:#004080"] {
        background: #004080 !important;
        background-color: #004080 !important;
        color: #ffffff !important;
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    span[style*="background:#fff"] {
        background: #ffffff !important;
        background-color: #ffffff !important;
        border: 2px solid #000000 !important;
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Manter estilos CSS originais como fallback */
    .plate-mercosul {
        display: inline-block !important;
        background: #ffffff !important;
        border: 2px solid #000000 !important;
        border-radius: 6px !important;
        padding: 18px 8px 6px 8px !important;
        font-family: Arial, sans-serif !important;
        font-weight: 900 !important;
        font-size: 14px !important;
        color: #000000 !important;
        text-align: center !important;
        min-width: 100px !important;
        letter-spacing: 2px !important;
        box-shadow: none !important;
        position: relative !important;
        line-height: 1 !important;
        margin: 0 !important;
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .plate-mercosul::before {
        content: "BRASIL" !important;
        position: absolute !important;
        display: block !important;
        top: 2px !important;
        left: 2px !important;
        right: 2px !important;
        background: #004080 !important;
        background-color: #004080 !important;
        color: #ffffff !important;
        font-size: 9px !important;
        font-weight: bold !important;
        font-family: Arial, sans-serif !important;
        padding: 2px 0 !important;
        text-align: center !important;
        border-radius: 3px 3px 0 0 !important;
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .plate-mercosul.small {
        font-size: 11px !important;
        min-width: 80px !important;
        padding: 14px 6px 4px 6px !important;
        letter-spacing: 1px !important;
    }

    .plate-mercosul.small::before {
        font-size: 7px !important;
        padding: 1px 0 !important;
    }

    /* Forçar layout horizontal no PDF - sobrepor todas as regras responsivas */
    .info-row {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        gap: 20px !important;
        align-items: flex-start !important;
        justify-content: flex-start !important;
        width: 100% !important;
    }

    .info-item-inline {
        display: inline-flex !important;
        flex-direction: row !important;
        align-items: center !important;
        flex: 0 1 auto !important;
        min-width: 150px !important;
        max-width: none !important;
        padding: 0 !important;
        border-bottom: none !important;
        margin: 0 !important;
        justify-content: flex-start !important;
    }

    .info-item-inline label {
        font-weight: bold !important;
        min-width: 70px !important;
        color: #333 !important;
        margin-right: 5px !important;
        white-space: nowrap !important;
        display: inline !important;
    }

    .info-item-inline span {
        color: #666 !important;
        white-space: nowrap !important;
        display: inline !important;
        flex-shrink: 0 !important;
    }

    /* Anular regras responsivas específicas no PDF */
    @media print and (max-width: 768px) {
        .info-row {
            flex-direction: row !important;
            align-items: flex-start !important;
            gap: 20px !important;
        }

        .info-item-inline {
            min-width: 150px !important;
            justify-content: flex-start !important;
            padding: 0 !important;
            border-bottom: none !important;
            flex-direction: row !important;
        }
    }
}

