/* QMS Unified Style - Sistema di Gestione Qualità Mercury Surgelati */
/* Stile globale unificato per tutte le pagine del sistema */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* SFONDO UNIFICATO - Come dashboard unificata */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #2d3748;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* CARD UNIFICATE - Chiare con bordi visibili */
.card, .header, .import-section, .stats-panel, .filters, 
.transporter-card, .supplier-card, .process-card, .dashboard-card {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.card:hover, .transporter-card:hover, .supplier-card:hover, 
.process-card:hover, .dashboard-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
}

/* HEADER UNIFICATO */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.title, .page-title {
    color: #2d3748;
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* PULSANTI UNIFICATI */
.btn {
    padding: 10px 16px;
    border: 2px solid transparent;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: white;
    color: #2d3748;
}

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

.btn-success {
    background: #48bb78;
    color: white;
    border-color: #38a169;
}

.btn-success:hover {
    background: #38a169;
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.4);
}

.btn-danger {
    background: #f56565;
    color: white;
    border-color: #e53e3e;
}

.btn-danger:hover {
    background: #e53e3e;
    box-shadow: 0 4px 12px rgba(245, 101, 101, 0.4);
}

.btn-secondary {
    background: #718096;
    color: white;
    border-color: #4a5568;
}

.btn-secondary:hover {
    background: #4a5568;
    box-shadow: 0 4px 12px rgba(113, 128, 150, 0.4);
}

.btn-primary {
    background: #4299e1;
    color: white;
    border-color: #3182ce;
}

.btn-primary:hover {
    background: #3182ce;
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.4);
}

/* STATISTICHE UNIFICATE */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.stat-card {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #cbd5e0;
}

/* Colori statistiche specifici */
.stat-card[data-filter="attivo"], .stat-card.stat-success {
    background: linear-gradient(135deg, #f0fff4 0%, #c6f6d5 100%);
    border-color: #9ae6b4;
}

.stat-card[data-filter="in-valutazione"], .stat-card.stat-warning {
    background: linear-gradient(135deg, #fffbf0 0%, #feebc8 100%);
    border-color: #f6ad55;
}

.stat-card[data-filter="in-revisione"], .stat-card.stat-info {
    background: linear-gradient(135deg, #f0f9ff 0%, #bee3f8 100%);
    border-color: #63b3ed;
}

.stat-card[data-filter="sospeso"], .stat-card.stat-danger {
    background: linear-gradient(135deg, #fff5f5 0%, #fed7d7 100%);
    border-color: #fc8181;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #2d3748;
    margin: 10px 0;
}

.stat-label {
    color: #4a5568;
    font-weight: 600;
    font-size: 0.9rem;
}

.stat-change {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 0.8rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.8);
}

/* FILTRI UNIFICATI */
.filters {
    display: flex;
    gap: 20px;
    align-items: end;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-label {
    font-weight: 600;
    color: #2d3748;
    font-size: 0.9rem;
}

.filter-select, .filter-input, .form-input, .form-select {
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    transition: all 0.3s ease;
}

.filter-select:focus, .filter-input:focus, .form-input:focus, .form-select:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

/* TABELLE UNIFICATE */
.table-container {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.table th, .table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.table th {
    background: #f7fafc;
    font-weight: 600;
    color: #2d3748;
}

.table tr:hover {
    background: #f7fafc;
}

/* MODAL UNIFICATO */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d3748;
    margin: 0;
}

.close {
    font-size: 2rem;
    font-weight: bold;
    color: #718096;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #2d3748;
}

/* FORM UNIFICATI */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #2d3748;
}

/* STATUS BADGES UNIFICATI */
.status-badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-attivo, .status-success {
    background: #c6f6d5;
    color: #22543d;
    border: 1px solid #9ae6b4;
}

.status-in-valutazione, .status-warning {
    background: #feebc8;
    color: #c05621;
    border: 1px solid #f6ad55;
}

.status-in-revisione, .status-info {
    background: #bee3f8;
    color: #2c5282;
    border: 1px solid #63b3ed;
}

.status-sospeso, .status-danger {
    background: #fed7d7;
    color: #c53030;
    border: 1px solid #fc8181;
}

/* AZIONI UNIFICATE */
.actions, .transporter-actions, .supplier-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.action-btn {
    padding: 6px 12px;
    border: 2px solid transparent;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.action-btn:hover {
    transform: translateY(-1px);
}

.action-btn-edit {
    background: #4299e1;
    color: white;
    border-color: #3182ce;
}

.action-btn-edit:hover {
    background: #3182ce;
}

.action-btn-status {
    background: #48bb78;
    color: white;
    border-color: #38a169;
}

.action-btn-status:hover {
    background: #38a169;
}

.action-btn-history {
    background: #ed8936;
    color: white;
    border-color: #dd6b20;
}

.action-btn-history:hover {
    background: #dd6b20;
}

.action-btn-delete {
    background: #f56565;
    color: white;
    border-color: #e53e3e;
}

.action-btn-delete:hover {
    background: #e53e3e;
}

/* GRIGLIA DASHBOARD UNIFICATA */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.dashboard-card {
    text-align: center;
    padding: 30px 20px;
}

.dashboard-card h3 {
    color: #2d3748;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.dashboard-card p {
    color: #4a5568;
    margin-bottom: 20px;
    line-height: 1.5;
}

.dashboard-card .btn {
    width: 100%;
    justify-content: center;
}

/* MESSAGGI DI SUCCESSO/ERRORE */
.success-message {
    background: #c6f6d5;
    color: #22543d;
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid #9ae6b4;
    margin-bottom: 20px;
    font-weight: 600;
}

.error-message {
    background: #fed7d7;
    color: #c53030;
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid #fc8181;
    margin-bottom: 20px;
    font-weight: 600;
}

.warning-message {
    background: #feebc8;
    color: #c05621;
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid #f6ad55;
    margin-bottom: 20px;
    font-weight: 600;
}

.info-message {
    background: #bee3f8;
    color: #2c5282;
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid #63b3ed;
    margin-bottom: 20px;
    font-weight: 600;
}

/* RESPONSIVE DESIGN */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .header {
        flex-direction: column;
        align-items: stretch;
    }

    .header-actions {
        justify-content: center;
    }

    .filters {
        flex-direction: column;
        align-items: stretch;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .title, .page-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .actions, .transporter-actions, .supplier-actions {
        flex-direction: column;
    }
    
    .action-btn {
        justify-content: center;
    }
}

/* ANIMAZIONI */
@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.card, .transporter-card, .supplier-card, .process-card, .dashboard-card {
    animation: fadeIn 0.5s ease-out;
}

/* UTILITÀ */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }

.d-flex { display: flex; }
.d-block { display: block; }
.d-none { display: none; }

.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }

.w-full { width: 100%; }
.h-full { height: 100%; }

/* RATING STARS */
.rating {
    color: #f6ad55;
    font-size: 1.1rem;
}

/* PROGRESS BAR */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 10px;
}

.progress-fill {
    height: 100%;
    background: #48bb78;
    transition: width 0.3s ease;
}

/* FILE INPUT STYLING */
.file-input-wrapper {
    position: relative;
    display: inline-block;
}

.file-input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-input-label {
    display: inline-block;
    padding: 10px 16px;
    background: #4299e1;
    color: white;
    border: 2px solid #3182ce;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.file-input-label:hover {
    background: #3182ce;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.4);
}

/* BREADCRUMB */
.breadcrumb {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    padding: 15px 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.breadcrumb a {
    color: #4299e1;
    text-decoration: none;
    font-weight: 600;
}

.breadcrumb a:hover {
    color: #3182ce;
    text-decoration: underline;
}

/* LOADING SPINNER */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4299e1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
