/* dashboard.css - UPDATED - Black & White Dashboard Components */

/* ===== DASHBOARD LAYOUT ===== */
.dashboard-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.dashboard-header {
    text-align: center;
    margin-bottom: var(--space-lg);
    padding: var(--space-xl);
    background: var(--bg);
    border-radius: var(--radius-lg);
    border: 2px solid var(--border);
    box-shadow: var(--shadow);
}

.dashboard-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: var(--space-sm);
}

.dashboard-subtitle {
    color: var(--text-light);
    font-size: 1.125rem;
    font-weight: 500;
}

/* ===== MAIN METRICS CARDS - BLACK & WHITE THEME ===== */
.metricas-principales {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--space-xl);
    margin-bottom: var(--space-xl);
}

.metrica-card {
    background: var(--bg);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow-md);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 120px;
}

.metrica-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary);
}

.metrica-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

/* Specific metric card styling - minimal color differentiation */
.metrica-card.ventas::before {
    background: var(--success);
}

.metrica-card.stock::before {
    background: var(--primary);
}

.metrica-card.valor::before {
    background: var(--text);
}

.metrica-card.promedio::before {
    background: var(--secondary);
}

.metrica-icon {
    font-size: 3rem;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    flex-shrink: 0;
    border: 2px solid var(--border);
    color: var(--text);
}

/* Enhanced metric info container */
.metrica-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 0;
    padding: var(--space-sm);
}

.metrica-info h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space);
    line-height: 1.3;
}

/* Enhanced amount display - FIXED */
.metrica-info .amount {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: var(--space-sm);
    line-height: 1;
    text-align: center;
    width: 100%;
    display: block;
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    letter-spacing: -0.02em;
    word-break: break-word;
    hyphens: auto;
    min-width: 0;
}

.metrica-info small {
    font-size: 0.875rem;
    color: var(--text-light);
    font-weight: 500;
    text-align: center;
    line-height: 1.4;
}

/* ===== PRODUCTION STATUS SECTION ===== */
.estado-produccion-simple {
    background: var(--bg);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow);
    border: 2px solid var(--border);
    margin-bottom: var(--space-xl);
}

.estado-produccion-simple h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding-bottom: var(--space);
    border-bottom: 2px solid var(--border-light);
}

.produccion-info {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--space-xl);
    align-items: start;
}

.produccion-actual {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    border: 2px solid var(--border-light);
}

.produccion-actual h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: var(--space);
}

.produccion-stats {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-bottom: var(--space);
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    padding: var(--space-xs) 0;
    border-bottom: 1px solid var(--border-light);
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-row span:first-child {
    color: var(--text-light);
    font-weight: 500;
}

.stat-row span:last-child {
    font-weight: 600;
    color: var(--text);
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

.estado-badge {
    display: inline-block;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 2px solid;
}

.estado-badge.activa {
    background: var(--success-light);
    color: var(--success);
    border-color: var(--success);
}

.estado-badge.cerrada {
    background: var(--bg-secondary);
    color: var(--text-muted);
    border-color: var(--border);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    overflow: hidden;
    margin-top: var(--space-sm);
    border: 1px solid var(--border);
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: var(--radius);
    transition: width 0.8s ease;
}

/* Enhanced resumen layout */
.produccion-resumen {
    display: flex;
    flex-direction: column;
    gap: var(--space);
}

.resumen-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space) var(--space-lg);
    background: var(--bg);
    border-radius: var(--radius);
    border: 2px solid var(--border-light);
    font-size: 0.875rem;
    min-height: 48px;
    transition: all 0.2s ease;
}

.resumen-item:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.resumen-item span:first-child {
    color: var(--text-light);
    font-weight: 500;
    flex: 1;
}

.resumen-item span:last-child {
    font-weight: 600;
    color: var(--text);
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    text-align: right;
    min-width: 80px;
}

.highlight {
    color: var(--primary);
    font-weight: 700;
}

/* ===== DELIVERY STATUS SECTION ===== */
.estado-entregas-simple {
    background: var(--bg);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow);
    border: 2px solid var(--border);
    margin-bottom: var(--space-xl);
}

.estado-entregas-simple h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding-bottom: var(--space);
    border-bottom: 2px solid var(--border-light);
}

.entregas-metricas-simple {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space);
}

.entrega-stat {
    display: flex;
    align-items: center;
    gap: var(--space);
    padding: var(--space-lg);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 2px solid var(--border-light);
    border-left: 4px solid var(--border);
    transition: all 0.2s ease;
    min-height: 80px;
}

.entrega-stat:hover {
    background: var(--bg);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.entrega-stat.urgent {
    border-left-color: var(--danger);
    background: var(--danger-light);
}

.entrega-stat.today {
    border-left-color: var(--warning);
    background: var(--warning-light);
}

.stat-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--bg);
    border-radius: var(--radius);
    border: 2px solid var(--border);
}

/* Enhanced stat info layout */
.stat-info {
    flex: 1;
    min-width: 0;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
    margin-bottom: var(--space-xs);
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    word-break: break-word;
    hyphens: auto;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-light);
    font-weight: 500;
    line-height: 1.3;
}

.stat-alert {
    display: block;
    font-size: 0.75rem;
    color: var(--danger);
    font-weight: 600;
    margin-top: var(--space-xs);
}

/* ===== INVENTORY STATUS SECTION ===== */
.estado-inventario-simple {
    background: var(--bg);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow);
    border: 2px solid var(--border);
    margin-bottom: var(--space-xl);
}

.estado-inventario-simple h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding-bottom: var(--space);
    border-bottom: 2px solid var(--border-light);
}

.inventario-stats-simple {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space);
    margin-bottom: var(--space-lg);
}

.inventario-stat {
    text-align: center;
    padding: var(--space-lg);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 2px solid var(--border-light);
    transition: all 0.2s ease;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.inventario-stat:hover {
    background: var(--bg);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
    border-color: var(--primary);
}

.inventario-stat.critical {
    border-color: var(--danger);
    background: var(--danger-light);
}

.inventario-stat.warning {
    border-color: var(--warning);
    background: var(--warning-light);
}

/* Enhanced inventory stat numbers */
.inventario-stat .stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
    margin-bottom: var(--space-xs);
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    text-align: center;
    word-break: break-word;
    hyphens: auto;
}

.inventario-stat .stat-label {
    font-size: 0.875rem;
    color: var(--text-light);
    font-weight: 500;
    text-align: center;
    line-height: 1.3;
}

.inventario-alert {
    background: var(--warning-light);
    border: 2px solid var(--warning);
    border-radius: var(--radius);
    padding: var(--space);
    color: var(--warning);
    font-weight: 500;
    text-align: center;
}

.inventario-ok {
    background: var(--success-light);
    border: 2px solid var(--success);
    border-radius: var(--radius);
    padding: var(--space);
    color: var(--success);
    font-weight: 500;
    text-align: center;
}

/* ===== QUICK ACTIONS SECTION ===== */
.acciones-rapidas {
    background: var(--bg);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow);
    border: 2px solid var(--border);
    margin-bottom: var(--space-xl);
}

.acciones-rapidas h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding-bottom: var(--space);
    border-bottom: 2px solid var(--border-light);
}

.acciones-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space);
}

.accion-btn {
    display: flex;
    align-items: center;
    gap: var(--space);
    padding: var(--space-lg);
    background: var(--bg-secondary);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
    min-height: 60px;
}

.accion-btn:hover {
    background: var(--bg);
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
    color: var(--primary);
}

.accion-btn.has-pending {
    border-color: var(--warning);
    background: var(--warning-light);
}

.accion-btn.needs-attention {
    border-color: var(--danger);
    background: var(--danger-light);
}

.accion-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    border-radius: var(--radius);
    border: 2px solid var(--border);
}

.accion-text {
    flex: 1;
    font-weight: 600;
    min-width: 0;
}

.badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--danger);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius);
    min-width: 20px;
    text-align: center;
    border: 2px solid var(--bg);
}

.badge.warning {
    background: var(--warning);
    color: var(--text);
}

/* ===== DASHBOARD FOOTER ===== */
.dashboard-footer {
    text-align: center;
    padding: var(--space-xl) 0;
    border-top: 2px solid var(--border-light);
    margin-top: var(--space-xl);
}

.app-footer {
    margin-top: var(--space-xl);
    padding: var(--space-lg);
    background: var(--bg);
    border-radius: var(--radius-lg);
    border: 2px solid var(--border);
    box-shadow: var(--shadow);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space);
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.footer-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.footer-text {
    font-weight: 500;
    color: var(--text-light);
}

.footer-info {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.ultima-actualizacion {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: var(--space);
}

/* ===== SECTION HEADERS ===== */
.section-header {
    text-align: center;
    margin-bottom: var(--space-xl);
    padding: var(--space-lg);
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 2px solid var(--border-light);
}

.section-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: var(--space-sm);
}

.section-header p {
    color: var(--text-light);
    font-size: 1rem;
    font-weight: 500;
}

/* ===== ERROR STATES ===== */
.dashboard-error {
    text-align: center;
    padding: var(--space-2xl);
}

.dashboard-error .error-state {
    background: var(--danger-light);
    border: 2px solid var(--danger);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    color: var(--danger);
}

.dashboard-error h2 {
    font-size: 1.5rem;
    margin-bottom: var(--space);
}

.dashboard-error p {
    margin-bottom: var(--space-lg);
    color: var(--text-light);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .metricas-principales {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
    
    .metrica-card {
        padding: var(--space-lg);
        min-height: 100px;
    }
    
    .metrica-icon {
        font-size: 2.5rem;
        width: 60px;
        height: 60px;
    }
    
    .metrica-info .amount {
        font-size: 2rem;
    }
    
    .produccion-info {
        grid-template-columns: 1fr;
        gap: var(--space);
    }
    
    .entregas-metricas-simple {
        grid-template-columns: 1fr;
    }
    
    .inventario-stats-simple {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .acciones-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .dashboard-content {
        gap: var(--space-lg);
    }
    
    .estado-produccion-simple,
    .estado-entregas-simple,
    .estado-inventario-simple,
    .acciones-rapidas {
        padding: var(--space-lg);
    }
    
    .inventario-stats-simple {
        grid-template-columns: 1fr;
    }
    
    .metrica-info .amount {
        font-size: 1.75rem;
    }
    
    .stat-number {
        font-size: 1.25rem;
    }
    
    .inventario-stat .stat-number {
        font-size: 1.5rem;
    }
    
    .dashboard-header {
        padding: var(--space-lg);
    }
    
    .section-header {
        padding: var(--space);
    }
}