/* ========================================
   CONSEGNE - GESTIONE RIDERS E DELIVERY
   ======================================== */

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

/* HEADER CONSEGNE */
.consegne-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.consegne-header h2 {
    margin: 0;
    color: #333;
    font-size: 1.8rem;
}

.consegne-stats {
    display: flex;
    gap: 20px;
}

.stat-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    text-align: center;
    min-width: 120px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.stat-box.pending {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stat-box.in-delivery {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.stat-label {
    font-size: 0.8rem;
    opacity: 0.9;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
}

/* GRIGLIA PRINCIPALE */
.consegne-grid {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 20px;
    margin-top: 20px;
}

/* LISTA ORDINI DA CONSEGNARE */
.ordini-pronti {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.ordini-pronti h3 {
    margin-top: 0;
    color: #333;
    font-size: 1.3rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ordine-card {
    background: #f8f9fa;
    border-left: 4px solid #28a745;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.ordine-card:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.ordine-card.urgente {
    border-left-color: #dc3545;
    background: #fff5f5;
}

.ordine-card.in-consegna {
    border-left-color: #007bff;
    background: #f0f7ff;
    opacity: 0.7;
}

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

.ordine-numero {
    font-weight: bold;
    font-size: 1.1rem;
    color: #333;
}

.ordine-tempo {
    background: #ffc107;
    color: #000;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: bold;
}

.ordine-tempo.urgente {
    background: #dc3545;
    color: white;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.ordine-cliente {
    color: #555;
    font-size: 0.95rem;
    margin-bottom: 8px;
}

.ordine-indirizzo {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.ordine-dettagli {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #ddd;
}

.ordine-totale {
    font-weight: bold;
    color: #28a745;
    font-size: 1.1rem;
}

.btn-assegna {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.btn-assegna:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.btn-assegna:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* PANNELLO RIDERS */
.riders-panel {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.riders-panel h3 {
    margin-top: 0;
    color: #333;
    font-size: 1.3rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.rider-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.rider-card.disponibile {
    border-color: #28a745;
}

.rider-card.occupato {
    border-color: #ffc107;
    background: #fffbf0;
}

.rider-card.offline {
    border-color: #dc3545;
    background: #fff5f5;
    opacity: 0.6;
}

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

.rider-nome {
    font-weight: bold;
    font-size: 1.1rem;
    color: #333;
}

.rider-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: bold;
}

.rider-status.disponibile {
    background: #28a745;
    color: white;
}

.rider-status.occupato {
    background: #ffc107;
    color: #000;
}

.rider-status.offline {
    background: #dc3545;
    color: white;
}

.rider-info {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.rider-consegne-attive {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #ddd;
}

.consegna-attiva {
    background: white;
    padding: 8px;
    border-radius: 6px;
    margin-bottom: 5px;
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* MODAL ASSEGNAZIONE */
.modal-assegna-rider {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
}

.modal-assegna-rider.show {
    display: flex;
}

.modal-assegna-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

.modal-assegna-header h3 {
    margin: 0;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
}

.modal-close:hover {
    color: #333;
}

.rider-seleziona-lista {
    margin: 20px 0;
}

.rider-seleziona-item {
    background: #f8f9fa;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.rider-seleziona-item:hover {
    border-color: #667eea;
    transform: scale(1.02);
}

.rider-seleziona-item.selected {
    border-color: #667eea;
    background: #f0f4ff;
}

.rider-seleziona-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.btn-conferma {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
}

.btn-conferma:hover {
    transform: scale(1.05);
}

.btn-conferma:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-annulla {
    background: #fff;
    color: #666;
    border: 2px solid #ddd;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
}

.btn-annulla:hover {
    background: #f8f9fa;
}

/* EMPTY STATES */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.empty-state-text {
    font-size: 1.1rem;
}

/* RESPONSIVE */
@media (max-width: 1024px) {
    .consegne-grid {
        grid-template-columns: 1fr;
    }

    .riders-panel {
        max-height: 400px;
    }
}

@media (max-width: 768px) {
    .consegne-stats {
        flex-direction: column;
        gap: 10px;
    }

    .stat-box {
        width: 100%;
    }
}
