/* css/produccion-simple.css - Clean Production Management Styling */

/* ===== PRODUCTION SECTION LAYOUT ===== */
.producciones-lista {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.producciones-lista 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);
}

/* ===== PRODUCTION GRID ===== */
.producciones-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--space-lg);
}

/* ===== PRODUCTION CARDS ===== */
.produccion-card {
    background: var(--bg);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.produccion-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--success), #059669);
}

.produccion-card.cerrada::before {
    background: linear-gradient(90deg, var(--gray-400), var(--gray-500));
}

.produccion-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.produccion-card.cerrada {
    opacity: 0.8;
    border-color: var(--gray-300);
}

.produccion-card.cerrada:hover {
    opacity: 1;
}

/* ===== CARD HEADER ===== */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-lg);
    gap: var(--space);
}

.card-header h4 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    line-height: 1.3;
    flex: 1;
}

.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;
    white-space: nowrap;
    flex-shrink: 0;
}

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

.estado-badge.cerrada {
    background: var(--gray-200);
    color: var(--gray-600);
    border: 1px solid var(--gray-400);
}

/* ===== CARD BODY ===== */
.card-body {
    margin-bottom: var(--space-lg);
}

.card-body p {
    margin-bottom: var(--space-sm);
    font-size: 0.875rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-body p strong {
    color: var(--text-light);
    font-weight: 500;
}

.card-body p span {
    color: var(--text);
    font-weight: 600;
}

.card-body p:last-child {
    margin-bottom: 0;
}

/* ===== FINANCIAL INFO ===== */
.card-body p:has(span[class*="S/"]) span,
.produccion-financiero .amount {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-weight: 700;
    color: var(--primary);
}

/* ===== CARD ACTIONS ===== */
.card-actions {
    display: flex;
    gap: var(--space-sm);
    justify-content: flex-end;
    align-items: center;
    padding-top: var(--space);
    border-top: 1px solid var(--border-light);
}

.btn-small {
    padding: var(--space-sm) var(--space);
    font-size: 0.75rem;
    margin: 0;
    border-radius: var(--radius-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.2s ease;
}

.btn-warning.btn-small {
    background: linear-gradient(135deg, var(--warning), #d97706);
    color: white;
    border: none;
}

.btn-warning.btn-small:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    transform: translateY(-1px);
}

.estado-cerrado {
    color: var(--gray-500);
    font-size: 0.875rem;
    font-weight: 500;
    font-style: italic;
}

/* ===== PRODUCTION MODAL SPECIFIC STYLING ===== */
.modal-produccion {
    max-width: 1000px;
}

.modal-produccion .modal-header {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
}

.modal-produccion .seccion-produccion {
    border-left-color: #6366f1;
    background: linear-gradient(135deg, #f0f0ff 0%, #e6e6ff 100%);
}

/* ===== PRODUCTION FORM STYLING ===== */
.productos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space);
    margin-top: var(--space);
}

.producto-item {
    background: white;
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    border: 2px solid var(--border-light);
    transition: all 0.2s ease;
    position: relative;
}

.producto-item:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
}

.producto-item label {
    display: flex;
    align-items: center;
    margin-bottom: var(--space);
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    gap: var(--space-sm);
}

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

.producto-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space);
    font-size: 0.875rem;
    color: var(--text-light);
}

.producto-info span {
    padding: var(--space-xs) var(--space-sm);
    background: var(--gray-100);
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.producto-item input[type="number"] {
    width: 100%;
    padding: var(--space-sm) var(--space);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.producto-item input[type="number"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.producto-item input[type="number"]:disabled {
    background: var(--gray-100);
    border-color: var(--border-light);
    color: var(--text-muted);
    cursor: not-allowed;
}

/* ===== CALCULATION RESULTS ===== */
.resultados-calculo {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin-top: var(--space-lg);
    border: 2px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.resultados-calculo h4 {
    color: var(--text);
    margin-bottom: var(--space-lg);
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.resultados-calculo h4::before {
    content: '📊';
    font-size: 1.5rem;
}

/* ===== INVENTORY ALERTS ===== */
.alerta-inventario {
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
    border-left: 4px solid;
}

.alerta-inventario.success {
    background: var(--success-light);
    border-left-color: var(--success);
    color: var(--success);
}

.alerta-inventario.error {
    background: var(--danger-light);
    border-left-color: var(--danger);
    color: var(--danger);
}

.alerta-inventario h5 {
    margin-bottom: var(--space);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.alerta-inventario.success h5::before {
    content: '✅';
}

.alerta-inventario.error h5::before {
    content: '⚠️';
}

.alerta-inventario ul {
    margin: 0;
    padding-left: var(--space-lg);
}

.alerta-inventario li {
    margin-bottom: var(--space-xs);
    font-weight: 500;
}

/* ===== FINANCIAL SUMMARY ===== */
.resumen-financiero {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space);
    margin-top: var(--space-lg);
}

.stat-card {
    background: var(--gray-50);
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    text-align: center;
    border: 1px solid var(--border-light);
    transition: all 0.2s ease;
}

.stat-card:hover {
    background: white;
    box-shadow: var(--shadow-sm);
}

.stat-card h5 {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: var(--space-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.stat-card .amount {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text);
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    margin-bottom: var(--space-xs);
    line-height: 1;
    text-align: center;
    width: 100%;
    display: block;
    letter-spacing: -0.02em;
    word-break: break-word;
    hyphens: auto;
    white-space: normal;
    overflow: visible;
}

.stat-card .amount.positive {
    color: var(--success);
}

.stat-card .amount.negative {
    color: var(--danger);
}

.stat-card small {
    color: var(--text-light);
    font-size: 0.75rem;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: var(--space-2xl);
    background: var(--bg-light);
    border-radius: var(--radius-lg);
    border: 2px dashed var(--border);
    margin: var(--space-lg) 0;
}

.empty-state::before {
    content: '🏭';
    display: block;
    font-size: 4rem;
    margin-bottom: var(--space);
    opacity: 0.5;
}

.empty-state h3 {
    margin-bottom: var(--space-sm);
    color: var(--text-light);
    font-weight: 600;
}

.empty-state p {
    margin-bottom: var(--space-lg);
    color: var(--text-muted);
}

/* ===== PRODUCTION LIST HEADER ===== */
.producciones-lista .header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
    padding: var(--space-lg);
    background: var(--bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.header-actions h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.header-actions .summary-stats {
    display: flex;
    gap: var(--space-lg);
    align-items: center;
}

.summary-stats .stat {
    text-align: center;
}

.summary-stats .stat-number {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    display: block;
}

.summary-stats .stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .producciones-grid {
        grid-template-columns: 1fr;
    }
    
    .produccion-card {
        padding: var(--space-lg);
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-sm);
    }
    
    .card-header h4 {
        font-size: 1.125rem;
    }
    
    .card-actions {
        justify-content: center;
    }
    
    .productos-grid {
        grid-template-columns: 1fr;
    }
    
    .resumen-financiero {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .header-actions {
        flex-direction: column;
        gap: var(--space);
        text-align: center;
    }
    
    .summary-stats {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .produccion-card {
        padding: var(--space);
    }
    
    .card-body p {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-xs);
    }
    
    .resumen-financiero {
        grid-template-columns: 1fr;
    }
    
    .summary-stats {
        flex-direction: column;
        gap: var(--space);
    }
    
    .modal-produccion {
        max-width: 100%;
        margin: var(--space-sm);
    }
    
    .productos-grid {
        gap: var(--space-sm);
    }
    
    .producto-item {
        padding: var(--space);
    }
}

/* ===== LOADING STATES ===== */
.producciones-lista.loading {
    opacity: 0.6;
    pointer-events: none;
}

.producciones-lista.loading::after {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid var(--border);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ===== SUCCESS MESSAGES ===== */
.mensaje-exito {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--success);
    color: white;
    padding: var(--space) var(--space-lg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    font-weight: 600;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===== FORM VALIDATION STATES ===== */
.producto-item.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}

.producto-item.selected label {
    color: var(--primary);
}

.form-group.error input,
.form-group.error select,
.form-group.error textarea {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px var(--danger-light);
}

.form-group.error label {
    color: var(--danger);
}

.error-message {
    color: var(--danger);
    font-size: 0.875rem;
    margin-top: var(--space-xs);
    font-weight: 500;
}

.error-message::before {
    content: '⚠️ ';
}
/* ===== PRODUCTION SECTION IMPROVEMENTS - Add to produccion-simple.css ===== */

/* Enhanced Production Header */
.producciones-lista h3 {
    background: var(--bg);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    margin-bottom: var(--space-lg);
}

/* Professional Stats Display */
.producciones-lista .header-actions {
    background: linear-gradient(135deg, var(--primary-light), var(--bg));
    border: 2px solid var(--primary);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin-bottom: var(--space-xl);
    box-shadow: var(--shadow-md);
}

.header-actions h3 {
    font-size: 1.5rem;
    color: var(--primary);
    margin: 0 0 var(--space-lg) 0;
    padding: 0;
    background: none;
    box-shadow: none;
    border: none;
}

.summary-stats {
    display: flex;
    gap: var(--space-xl);
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.summary-stats .stat {
    background: white;
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    text-align: center;
    min-width: 120px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: all 0.2s ease;
}

.summary-stats .stat:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.summary-stats .stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    display: block;
    line-height: 1;
    margin-bottom: var(--space-xs);
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
}

.summary-stats .stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

/* Enhanced Production Cards Layout */
.producciones-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: var(--space-xl);
}

/* Professional Production Cards */
.produccion-card {
    background: var(--bg);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow-md);
    border: 2px solid var(--border-light);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.produccion-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--success), #059669);
}

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

/* Professional Card Content */
.card-body p {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) var(--space);
    margin-bottom: var(--space-sm);
    background: var(--gray-50);
    border-radius: var(--radius);
    border-left: 3px solid var(--primary);
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.card-body p:hover {
    background: var(--primary-light);
    transform: translateX(2px);
}

.card-body p strong {
    color: var(--text);
    font-weight: 600;
    min-width: 140px;
}

/* Enhanced Amount Display */
.card-body p span {
    color: var(--text);
    font-weight: 700;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    background: white;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

/* Special styling for cost amounts */
.card-body p:has(strong:contains("Costo")) span {
    color: var(--danger);
    background: var(--danger-light);
    border-color: var(--danger);
    font-weight: 800;
}

/* Special styling for total boxes */
.card-body p:has(strong:contains("Cajas")) span {
    color: var(--success);
    background: var(--success-light);
    border-color: var(--success);
    font-weight: 800;
}

/* Professional Products List */
.productos-detalle-section {
    margin-top: var(--space-lg);
    padding: var(--space-lg);
    background: var(--gray-50);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

.productos-detalle-section h5 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: var(--space);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--border-light);
}

.productos-detalle-grid {
    display: grid;
    gap: var(--space-sm);
}

.producto-detalle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space) var(--space-lg);
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    font-size: 0.9rem;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.producto-detalle:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow);
    border-color: var(--primary);
}

.producto-nombre {
    font-weight: 600;
    color: var(--text);
    flex: 1;
}

.producto-cantidad {
    font-weight: 800;
    color: var(--primary);
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    background: var(--primary-light);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    border: 1px solid var(--primary);
    font-size: 0.875rem;
}

/* Enhanced Card Actions */
.card-actions {
    display: flex;
    gap: var(--space);
    justify-content: flex-end;
    align-items: center;
    padding-top: var(--space-lg);
    margin-top: var(--space-lg);
    border-top: 2px solid var(--border-light);
}

.btn-warning.btn-small {
    background: linear-gradient(135deg, var(--warning), #d97706);
    color: white;
    border: none;
    padding: var(--space) var(--space-lg);
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.btn-warning.btn-small:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* Enhanced Status Badge */
.estado-badge {
    display: inline-block;
    padding: var(--space-sm) var(--space);
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.estado-badge.activa {
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
    border: 2px solid var(--success);
}

.estado-badge.cerrada {
    background: linear-gradient(135deg, var(--gray-400), var(--gray-500));
    color: white;
    border: 2px solid var(--gray-400);
}

/* Professional Card Header */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space);
    border-bottom: 2px solid var(--border-light);
    gap: var(--space);
}

.card-header h4 {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    line-height: 1.2;
    flex: 1;
}

/* Responsive Improvements */
@media (max-width: 768px) {
    .producciones-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
    
    .summary-stats {
        flex-direction: column;
        gap: var(--space);
    }
    
    .summary-stats .stat {
        width: 100%;
        max-width: 300px;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space);
        text-align: left;
    }
    
    .card-body p {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-xs);
        text-align: left;
    }
    
    .card-body p span {
        align-self: flex-end;
    }
}