/**
 * Estilos para Reporte de Rendimiento CANBUS
 * Asegurar que no interfieran con base.php
 */

/* Ocultar scrollbar en el body y html cuando está en reporte-rendimiento */
html:has(body.app.reporte-rendimiento-page),
html body.app.reporte-rendimiento-page {
    overflow-x: hidden !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

html:has(body.app.reporte-rendimiento-page)::-webkit-scrollbar,
html body.app.reporte-rendimiento-page::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    background: transparent !important;
}

body.app.reporte-rendimiento-page {
    overflow-x: hidden !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

body.app.reporte-rendimiento-page #mainContent .container-fluid {
    padding: 20px;
    background: transparent !important;
}

/* Ocultar scrollbars - Vista general y contenedores principales con máxima especificidad */
html body.app.reporte-rendimiento-page .page-container,
html body.app.reporte-rendimiento-page .main-content,
html body.app.reporte-rendimiento-page #mainContent,
body.app.reporte-rendimiento-page .page-container,
body.app.reporte-rendimiento-page .main-content,
body.app.reporte-rendimiento-page #mainContent {
    scrollbar-width: none !important; /* Firefox */
    -ms-overflow-style: none !important; /* IE y Edge */
    overflow-y: auto !important; /* Mantener funcionalidad */
    overflow-x: hidden !important;
}

html body.app.reporte-rendimiento-page .page-container::-webkit-scrollbar,
html body.app.reporte-rendimiento-page .main-content::-webkit-scrollbar,
html body.app.reporte-rendimiento-page #mainContent::-webkit-scrollbar,
body.app.reporte-rendimiento-page .page-container::-webkit-scrollbar,
body.app.reporte-rendimiento-page .main-content::-webkit-scrollbar,
body.app.reporte-rendimiento-page #mainContent::-webkit-scrollbar {
    display: none !important; /* Chrome, Safari, Opera */
    width: 0 !important;
    height: 0 !important;
    background: transparent !important;
}

/* Grid de estadísticas */
body.app.reporte-rendimiento-page .stats-grid,
.reporte-rendimiento-page .stats-grid,
.stats-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 16px !important;
    width: 100% !important;
}

@media (max-width: 1200px) {
    body.app.reporte-rendimiento-page .stats-grid,
    .reporte-rendimiento-page .stats-grid,
    .stats-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 992px) {
    body.app.reporte-rendimiento-page .stats-grid,
    .reporte-rendimiento-page .stats-grid,
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 576px) {
    body.app.reporte-rendimiento-page .stats-grid,
    .reporte-rendimiento-page .stats-grid,
    .stats-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Cards de estadísticas */
body.app.reporte-rendimiento-page .stats-card,
.reporte-rendimiento-page .stats-card,
.stats-card {
    border-radius: 12px !important;
    padding: 20px !important;
    background: linear-gradient(135deg, #1e1e2f 0%, #2b3a55 100%) !important;
    color: #fff !important;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.25) !important;
    min-height: 140px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    position: relative !important;
    overflow: hidden !important;
}

body.app.reporte-rendimiento-page .stats-card-content,
.reporte-rendimiento-page .stats-card-content,
.stats-card-content {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 1 !important;
}

body.app.reporte-rendimiento-page .stats-card span,
.reporte-rendimiento-page .stats-card span,
.stats-card span {
    font-size: 0.9rem !important;
    letter-spacing: 0.5px !important;
    opacity: 0.85 !important;
    display: block !important;
    margin: 0 0 10px 0 !important;
    line-height: 1.3 !important;
    flex: 0 0 auto !important;
    color: inherit !important;
}

body.app.reporte-rendimiento-page .stats-card h3,
.reporte-rendimiento-page .stats-card h3,
.stats-card h3 {
    margin: 0 !important;
    font-size: 1.8rem !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    flex: 0 0 auto !important;
    color: inherit !important;
}

body.app.reporte-rendimiento-page .stats-card small,
.reporte-rendimiento-page .stats-card small,
.stats-card small {
    display: block !important;
    opacity: 0.7 !important;
    font-size: 0.8rem !important;
    margin: 10px 0 0 0 !important;
    line-height: 1.3 !important;
    flex: 0 0 auto !important;
    color: inherit !important;
}

[data-theme="light"] body.app.reporte-rendimiento-page .stats-card,
[data-theme="light"] .reporte-rendimiento-page .stats-card,
[data-theme="light"] .stats-card {
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%) !important;
    color: #1a202c !important;
}

/* Placeholder de tabla */
body.app.reporte-rendimiento-page .table-placeholder {
    text-align: center;
    padding: 30px;
    color: #718096;
}

/* Mapa */
body.app.reporte-rendimiento-page #rendimientoMap {
    width: 100% !important;
    height: 574px !important;
    min-height: 574px !important;
    border-radius: 12px;
    border: 1px solid rgba(226, 232, 240, 0.2);
    background-color: #f0f0f0;
    position: relative;
    display: block;
    visibility: visible;
}

[data-theme="dark"] body.app.reporte-rendimiento-page #rendimientoMap {
    background-color: #2d3748;
    border-color: rgba(255, 255, 255, 0.1);
}

body.app.reporte-rendimiento-page .map-info {
    margin-top: 15px;
    font-size: 0.9rem;
    color: #a0aec0;
}

[data-theme="light"] body.app.reporte-rendimiento-page .map-info {
    color: #4a5568;
}

/* Botones de acciones */
body.app.reporte-rendimiento-page .actions-group button {
    margin-right: 10px;
}

/* Tabla de historial */
body.app.reporte-rendimiento-page .history-table td,
body.app.reporte-rendimiento-page .history-table th {
    vertical-align: middle !important;
}

body.app.reporte-rendimiento-page .description-input {
    min-width: 180px;
}

/* Headers de cards */
body.app.reporte-rendimiento-page .card-header h4,
body.app.reporte-rendimiento-page .card-header h5 {
    display: flex;
    align-items: center;
    gap: 10px;
}

body.app.reporte-rendimiento-page .card-header h4 i,
body.app.reporte-rendimiento-page .card-header h5 i {
    font-size: 1.1em;
}

/* Estilos para tema oscuro - controles de formulario */
[data-theme="dark"] body.app.reporte-rendimiento-page .form-control,
[data-theme="dark"] body.app.reporte-rendimiento-page select.form-control {
    background-color: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
}

[data-theme="dark"] body.app.reporte-rendimiento-page .form-control:focus,
[data-theme="dark"] body.app.reporte-rendimiento-page select.form-control:focus {
    background-color: #2d3748;
    border-color: #4299e1;
    color: #e2e8f0;
    box-shadow: 0 0 0 0.2rem rgba(66, 153, 225, 0.25);
}

[data-theme="dark"] body.app.reporte-rendimiento-page .form-control:disabled,
[data-theme="dark"] body.app.reporte-rendimiento-page select.form-control:disabled {
    background-color: #1a202c;
    border-color: #2d3748;
    color: #718096;
    opacity: 0.6;
    cursor: not-allowed;
}

[data-theme="dark"] body.app.reporte-rendimiento-page .form-control::placeholder {
    color: #718096;
}

[data-theme="dark"] body.app.reporte-rendimiento-page .form-label {
    color: #cbd5e0;
}

[data-theme="dark"] body.app.reporte-rendimiento-page .form-label.small {
    color: #a0aec0;
}

[data-theme="dark"] body.app.reporte-rendimiento-page select.form-control option {
    background-color: #2d3748;
    color: #e2e8f0;
}

/* Ocultar scrollbars pero mantener funcionalidad */
body.app.reporte-rendimiento-page * {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE y Edge */
}

body.app.reporte-rendimiento-page *::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* Estilos para cards */
body.app.reporte-rendimiento-page .card {
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

body.app.reporte-rendimiento-page .card-header {
    background: white;
    color: #333;
    border: 1px solid #000;
    border-bottom: 2px solid #000;
    border-radius: 8px 8px 0 0;
    padding: 15px 20px;
}

[data-theme="dark"] body.app.reporte-rendimiento-page .card-header {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    border-bottom-color: #4a5568;
    color: #e2e8f0;
    border: 1px solid #4a5568 !important;
    border-bottom: 2px solid #4a5568 !important;
}

body.app.reporte-rendimiento-page .card-body {
    padding: 20px;
}

[data-theme="dark"] body.app.reporte-rendimiento-page .card {
    background-color: #20232a !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] body.app.reporte-rendimiento-page .card-body {
    background-color: #20232a !important;
    color: #e2e8f0 !important;
}

/* Estilos para tablas */
body.app.reporte-rendimiento-page .table {
    width: 100%;
    margin-bottom: 0;
}

body.app.reporte-rendimiento-page .table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #495057;
    padding: 12px;
    vertical-align: middle;
}

[data-theme="dark"] body.app.reporte-rendimiento-page .table thead th {
    background-color: #2d3748;
    border-bottom-color: #4a5568;
    color: #e2e8f0;
}

body.app.reporte-rendimiento-page .table tbody td {
    padding: 12px;
    vertical-align: middle;
    border-bottom: 1px solid #dee2e6;
}

[data-theme="dark"] body.app.reporte-rendimiento-page .table tbody td {
    border-bottom-color: #4a5568;
    color: #e2e8f0;
}

body.app.reporte-rendimiento-page .table tbody tr:hover {
    background-color: #f8f9fa;
}

[data-theme="dark"] body.app.reporte-rendimiento-page .table tbody tr:hover {
    background-color: #2d3748;
}

body.app.reporte-rendimiento-page .table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] body.app.reporte-rendimiento-page .table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Botones */
body.app.reporte-rendimiento-page .btn {
    border-radius: 6px;
    padding: 8px 16px;
    font-weight: 500;
    transition: all 0.3s ease;
}

body.app.reporte-rendimiento-page .btn-primary {
    background: linear-gradient(135deg, #4299e1 0%, #2b6cb0 100%);
    border: none;
    color: white;
}

body.app.reporte-rendimiento-page .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(66, 153, 225, 0.3);
}

[data-theme="dark"] body.app.reporte-rendimiento-page .btn-primary {
    background-color: #4299e1;
    border-color: #4299e1;
}

[data-theme="dark"] body.app.reporte-rendimiento-page .btn-primary:hover {
    background-color: #3182ce;
    border-color: #3182ce;
}

body.app.reporte-rendimiento-page .btn-success {
    background-color: #48bb78;
    border-color: #48bb78;
    color: white;
}

body.app.reporte-rendimiento-page .btn-success:hover {
    background-color: #38a169;
    border-color: #38a169;
}

body.app.reporte-rendimiento-page .btn-danger {
    background-color: #f56565;
    border-color: #f56565;
    color: white;
}

body.app.reporte-rendimiento-page .btn-danger:hover {
    background-color: #e53e3e;
    border-color: #e53e3e;
}

/* Inputs y controles */
body.app.reporte-rendimiento-page .form-control {
    border-radius: 6px;
    border: 1px solid #ddd;
    padding: 8px 12px;
    transition: all 0.3s ease;
}

body.app.reporte-rendimiento-page .form-control:focus {
    border-color: #4299e1;
    box-shadow: 0 0 0 0.2rem rgba(66, 153, 225, 0.25);
}

body.app.reporte-rendimiento-page .form-control-sm {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
}

body.app.reporte-rendimiento-page .form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #495057;
}

body.app.reporte-rendimiento-page .form-label.small {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

/* Texto y colores */
body.app.reporte-rendimiento-page .text-muted {
    color: #6c757d !important;
}

[data-theme="dark"] body.app.reporte-rendimiento-page .text-muted {
    color: #a0aec0 !important;
}

