/**
 * Estilos del Dashboard
 */

.dashboard-container {
    display: flex;
    flex-direction: column;
    gap: 24px;

    padding:20px 30px;
}

.metric-subtitle-small{
    font-size: 10px;
    background: #eaeaea;
    padding: 3px 7px;
    border-radius: 0.5rem;
    display: inline-block;
    align-items: center;
    vertical-align: middle;
}

.metric-text-subtitle-small{
    font-size: 20px;
}
/* ========================================
   MÉTRICAS PRINCIPALES
   ======================================== */
.dashboard-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.metric-card {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 12px;
    padding: 24px;
    transition: all 0.2s ease;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.metric-header h3 {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary, #6b7280);
    margin: 0;
}

.metric-variation {
    font-size: 13px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
}

.metric-variation.positive {
    color: #10b981;
    background: #d1fae5;
}

.metric-variation.negative {
    color: #ef4444;
    background: #fee2e2;
}

.metric-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary, #111827);
    margin: 0 0 8px 0;
    line-height: 1.2;
}

.metric-value.negative-value {
    color: #ef4444;
}

.metric-value.positive-value {
    color: #10b981;
}

.metric-subtitle {
    font-size: 13px;
    color: var(--text-secondary, #6b7280);
    margin: 0;
}

/* ========================================
   GRÁFICO PRINCIPAL
   ======================================== */
.dashboard-main-chart {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 12px;
    padding: 24px;
}

.dashboard-main-chart .card-header {
    margin-bottom: 20px;
}

.dashboard-main-chart .card-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary, #111827);
    margin: 0;
}

#main-chart {
    width: 100%;
    min-height: 400px;
}

/* ========================================
   GRID DE ANÁLISIS (2 COLUMNAS)
   ======================================== */
.dashboard-analysis-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.dashboard-section-card {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 12px;
    padding: 24px;
}

.dashboard-section-card .card-header {
    margin-bottom: 20px;
}

.dashboard-section-card .card-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary, #111827);
    margin: 0;
}

/* ========================================
   STOCK CRÍTICO
   ======================================== */
.stock-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stock-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: var(--bg-light, #f9fafb);
    border-radius: 8px;
    border: 1px solid var(--border-color, #e5e7eb);
    transition: all 0.2s ease;
}

.stock-item:hover {
    background: var(--bg-hover, #f3f4f6);
    border-color: var(--border-hover, #d1d5db);
}

.stock-item-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stock-item-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary, #111827);
}

.stock-item-detail {
    font-size: 12px;
    color: var(--text-secondary, #6b7280);
}

.stock-item-value {
    font-size: 15px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 6px;
}

.stock-item-value.critical {
    color: #dc2626;
    background: #fee2e2;
}

.stock-item-value.warning {
    color: #f59e0b;
    background: #fef3c7;
}

/* ========================================
   INCIDENCIAS
   ======================================== */
.incidencias-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.incidencia-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 8px;
    border-left: 3px solid transparent;
    background: var(--bg-light, #f9fafb);
    transition: all 0.2s ease;
}

.incidencia-item:hover {
    background: var(--bg-hover, #f3f4f6);
}

.incidencia-item.incidencia-alta {
    border-left-color: #ef4444;
    background: #fef2f2;
}

.incidencia-item.incidencia-media {
    border-left-color: #f59e0b;
    background: #fffbeb;
}

.incidencia-item.incidencia-baja {
    border-left-color: #10b981;
    background: #f0fdf4;
}

.incidencia-item.incidencia-crítica {
    border-left-color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.incidencia-item.incidencia-error {
    border-left-color: #dc2626;
    background: #fef2f2;
}

.incidencia-icon {
    font-size: 20px;
    line-height: 1;
}

.incidencia-mensaje {
    font-size: 14px;
    color: var(--text-primary, #111827);
    line-height: 1.5;
}

/* ========================================
   OBJETIVO MENSUAL
   ======================================== */
.dashboard-objetivo-card {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border: none;
    border-radius: 12px;
    padding: 32px;
    color: white;
}

.dashboard-objetivo-card .card-header h3 {
    color: white;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 24px 0;
}

.objetivo-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.objetivo-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.objetivo-valores {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.objetivo-actual {
    font-size: 36px;
    font-weight: 700;
    color: white;
}

.objetivo-separador {
    font-size: 28px;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.7);
}

.objetivo-meta {
    font-size: 28px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

.objetivo-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

.objetivo-progress {
    display: flex;
    align-items: center;
    gap: 16px;
}

.progress-bar {
    flex: 1;
    height: 12px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 99px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: white;
    border-radius: 99px;
    transition: width 1s ease;
}

.progress-percentage {
    font-size: 18px;
    font-weight: 700;
    color: white;
    min-width: 60px;
    text-align: right;
}

/* ========================================
   MENSAJE VACÍO
   ======================================== */
.empty-message {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary, #6b7280);
    font-size: 14px;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 1200px) {
    .dashboard-analysis-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dashboard-metrics {
        grid-template-columns: 1fr;
    }
    
    .metric-value {
        font-size: 28px;
    }
    
    .objetivo-actual {
        font-size: 28px;
    }
    
    .objetivo-meta {
        font-size: 24px;
    }
}

/* ========================================
   ANIMACIONES
   ======================================== */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dashboard-metrics > *,
.dashboard-main-chart,
.dashboard-analysis-grid > *,
.dashboard-objetivo-card {
    animation: slideIn 0.4s ease forwards;
}

.dashboard-metrics > *:nth-child(1) {
    animation-delay: 0.1s;
}

.dashboard-metrics > *:nth-child(2) {
    animation-delay: 0.2s;
}

.dashboard-metrics > *:nth-child(3) {
    animation-delay: 0.3s;
}

.dashboard-main-chart {
    animation-delay: 0.4s;
}

.dashboard-analysis-grid > *:nth-child(1) {
    animation-delay: 0.5s;
}

.dashboard-analysis-grid > *:nth-child(2) {
    animation-delay: 0.6s;
}

.dashboard-objetivo-card {
    animation-delay: 0.7s;
}

/* ========================================
   ESTADO DE TICKETS
   ======================================== */
.metric-icon {
    font-size: 18px;
    margin-left: 8px;
}

.tickets-estado-content {
    display: flex;
    gap: 24px;
    align-items: center;
}

.tickets-estado-content #tickets-estado-chart {
    flex: 1;
    min-width: 300px;
}

.tickets-estado-legend {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 200px;
}

.tickets-estado-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--card-bg, #f9fafb);
    border-radius: 8px;
    border: 1px solid var(--border-color, #e5e7eb);
}

.tickets-estado-badge {
    font-size: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    flex-shrink: 0;
}

.tickets-estado-badge.tickets-estado-cerrado {
    background: #d1fae5;
}

.tickets-estado-badge.tickets-estado-abierto {
    background: #fef3c7;
}

.tickets-estado-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.tickets-estado-info strong {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #111827);
}

.tickets-estado-info span {
    font-size: 12px;
    color: var(--text-secondary, #6b7280);
}

/* Responsive: en pantallas pequeñas, apilar verticalmente */
@media (max-width: 768px) {
    .tickets-estado-content {
        flex-direction: column;
    }
    
    .tickets-estado-legend {
        width: 100%;
    }
}

/* ========================================
   FILTRO DE CATEGORÍAS DE PRODUCTOS
   ======================================== */
.productos-categorias-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 8px;
}

.categoria-filter-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    font-weight: 500;
}

.categoria-filter-item:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.categoria-filter-item input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
    margin: 0;
}

.categoria-filter-item span {
    color: #374151;
    user-select: none;
}

/* ========================================
   MOVIMIENTOS DE CAJA (INGRESOS Y RETIROS)
   ======================================== */
.movimientos-caja-container {
    padding: 0;
}

.movimientos-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.movimiento-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
    border-left: 4px solid #e5e7eb;
    transition: all 0.2s ease;
}

.movimiento-item:hover {
    background: #f3f4f6;
    transform: translateX(2px);
}

.movimiento-item.movimiento-ingreso {
    border-left-color: #10b981;
    background: #f0fdf4;
}

.movimiento-item.movimiento-retiro {
    border-left-color: #ef4444;
    background: #fef2f2;
}

.movimiento-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.movimiento-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.movimiento-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.movimiento-tipo {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.movimiento-importe {
    font-size: 18px;
    font-weight: 700;
}

.movimiento-importe.movimiento-ingreso {
    color: #10b981;
}

.movimiento-importe.movimiento-retiro {
    color: #ef4444;
}

.movimiento-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.movimiento-descripcion {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.4;
}

.movimiento-fecha {
    font-size: 12px;
    color: #9ca3af;
}

.movimiento-usuario {
    font-size: 12px;
    color: #6b7280;
    font-style: italic;
}

.movimientos-paginacion {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
    border-top: 1px solid #e5e7eb;
    gap: 16px;
    flex-wrap: wrap;
}

.paginacion-info {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
}

.btn-pagina {
    padding: 8px 16px;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-pagina:hover:not(.disabled) {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.btn-pagina.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f9fafb;
}

/* Responsive */
@media (max-width: 768px) {
    .movimiento-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .movimientos-paginacion {
        flex-direction: column;
        text-align: center;
    }
    
    .paginacion-info {
        order: -1;
        width: 100%;
    }
}

/* ========================================
   INDICADOR DE ESTADO DE CAJA (BANNER DISCRETO)
   ======================================== */
.caja-status-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    margin-bottom: 16px;
    border-radius: 6px;
    border-left: 3px solid;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.caja-status-banner.caja-abierta {
    background: #f0fdf4;
    border-left-color: #10b981;
    color: #065f46;
}

.caja-status-banner.caja-cerrada {
    background: #fef2f2;
    border-left-color: #ef4444;
    color: #991b1b;
}

.caja-banner-icon {
    font-size: 14px;
    flex-shrink: 0;
}

.caja-banner-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

