/* =====================================================
   ATLAS - STILI MODULO MEZZI
   Gestione completa parco mezzi ODV
   ===================================================== */

/* Vista Cards Grid */
.mezzi-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

/* Card Mezzo */
.mezzo-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.mezzo-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.mezzo-card.fermo,
.mezzo-card.dismesso {
    opacity: 0.7;
}

.mezzo-card-header {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    position: relative;
}

.mezzo-categoria {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
}

.mezzo-categoria i {
    font-size: 18px;
}

.mezzo-stato {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

.mezzo-alert-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 24px;
    height: 24px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    border: 2px solid white;
}

.mezzo-card-body {
    padding: 20px;
}

.mezzo-targa {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.mezzo-nome {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 15px;
}

.mezzo-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.mezzo-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #4b5563;
}

.mezzo-info-item i {
    color: #9ca3af;
    width: 16px;
    text-align: center;
}

.mezzo-info-item.text-muted {
    color: #d1d5db;
}

/* Scadenze nel card */
.mezzo-scadenze {
    display: flex;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid #f3f4f6;
}

.scadenza-item {
    flex: 1;
    text-align: center;
    padding: 8px;
    border-radius: 8px;
    background: #f9fafb;
}

.scadenza-item.scad-ok {
    background: #dcfce7;
}

.scadenza-item.scad-prossima {
    background: #dbeafe;
}

.scadenza-item.scad-imminente {
    background: #fef3c7;
}

.scadenza-item.scad-scaduta {
    background: #fee2e2;
}

.scadenza-label {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    color: #6b7280;
    margin-bottom: 2px;
}

.scadenza-value {
    font-size: 12px;
    font-weight: 600;
    color: #374151;
}

.scad-scaduta .scadenza-value {
    color: #dc2626;
}

.scad-imminente .scadenza-value {
    color: #d97706;
}

/* Footer card con azioni */
.mezzo-card-footer {
    display: flex;
    border-top: 1px solid #f3f4f6;
    background: #fafafa;
}

.btn-mezzo-action {
    flex: 1;
    padding: 12px;
    border: none;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 16px;
}

.btn-mezzo-action:hover {
    background: #f3f4f6;
    color: #3b82f6;
}

.btn-mezzo-action.edit:hover {
    color: #8b5cf6;
}

/* Toggle vista */
.btn-vista-group {
    display: flex;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.btn-vista-mezzi {
    padding: 8px 12px;
    border: none;
    background: white;
    color: #6b7280;
    cursor: pointer;
}

.btn-vista-mezzi.active {
    background: #3b82f6;
    color: white;
}

/* =====================================================
   DETTAGLIO MEZZO
   ===================================================== */

.dettaglio-mezzo {
    max-width: 100%;
}

.dettaglio-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px;
    border-radius: 12px;
    color: white;
    margin-bottom: 20px;
}

.dettaglio-header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.dettaglio-header-left h2 {
    margin: 0;
    font-size: 28px;
    letter-spacing: 2px;
}

.dettaglio-header-left p {
    margin: 5px 0 0;
    opacity: 0.9;
}

.stato-badge {
    padding: 8px 16px;
    border-radius: 25px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Azioni rapide */
.dettaglio-azioni {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

/* Grid info */
.dettaglio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.dettaglio-card {
    background: #f9fafb;
    border-radius: 12px;
    padding: 20px;
}

.dettaglio-card h4 {
    margin: 0 0 15px;
    color: #374151;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.info-row span:first-child {
    color: #6b7280;
}

/* Scadenze dettaglio */
.scadenze-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.scadenza-row {
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: 8px;
    background: white;
}

.scadenza-row .scadenza-label {
    flex: 1;
    font-weight: 500;
    color: #374151;
    font-size: 13px;
    text-transform: none;
}

.scadenza-row .scadenza-data {
    font-weight: 600;
    margin-right: 10px;
}

.scadenza-row .scadenza-extra {
    font-size: 11px;
    color: #9ca3af;
    margin-right: 10px;
}

.scadenza-row.scad-scaduta {
    background: #fee2e2;
}

.scadenza-row.scad-imminente {
    background: #fef3c7;
}

.scadenza-row.scad-ok {
    background: #dcfce7;
}

/* Stats mini */
.stats-mini-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.stat-mini {
    text-align: center;
    padding: 15px;
    background: white;
    border-radius: 8px;
}

.stat-mini-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
}

.stat-mini-label {
    font-size: 11px;
    color: #6b7280;
}

/* Tabs dettaglio */
.dettaglio-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 10px;
}

.dettaglio-tabs .tab-btn {
    padding: 10px 20px;
    border: none;
    background: #f3f4f6;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.dettaglio-tabs .tab-btn:hover {
    background: #e5e7eb;
}

.dettaglio-tabs .tab-btn.active {
    background: #3b82f6;
    color: white;
}

/* Tabella mini */
.table-mini {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.table-mini th {
    background: #f3f4f6;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: #6b7280;
}

.table-mini td {
    padding: 10px 12px;
    border-bottom: 1px solid #f3f4f6;
}

.table-mini tr:hover td {
    background: #f9fafb;
}

/* Note */
.dettaglio-note {
    background: #fffbeb;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.dettaglio-note h4 {
    margin: 0 0 10px;
    color: #92400e;
}

.dettaglio-note p {
    margin: 0;
    color: #78350f;
}

/* Modal azioni */
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

/* =====================================================
   MODAL MEZZO
   ===================================================== */

.modal-content.modal-xl {
    max-width: 900px;
}

/* Form mezzo */
#mezzoForm .form-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

#mezzoForm .form-group {
    flex: 1;
    min-width: 200px;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 768px) {
    .mezzi-cards-grid {
        grid-template-columns: 1fr;
    }
    
    .dettaglio-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .dettaglio-header-left {
        flex-direction: column;
    }
    
    .dettaglio-azioni {
        justify-content: center;
    }
    
    .dettaglio-tabs {
        flex-wrap: wrap;
    }
    
    .stats-mini-grid {
        grid-template-columns: 1fr;
    }
}
