/* Custom CSS per app responsive */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-size: 16px;
    line-height: 1.5;
}

/* Navbar responsiva */
.navbar {
    padding: 0.5rem 1rem;
}

.navbar-brand {
    font-size: 1.2rem;
    font-weight: bold;
}

.navbar-text {
    font-size: 0.9rem;
}

/* Container */
.container {
    padding: 1rem;
}

/* Card responsiva */
.card {
    margin-bottom: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card-header {
    background-color: #f8f9fa;
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
}

.card-header h3 {
    font-size: 1.2rem;
    margin: 0;
}

.card-body {
    padding: 1rem;
}

/* Form responsiva */
.form-control, .form-select {
    min-height: 45px;
    font-size: 16px;
}

.form-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Bottoni */
.btn {
    min-height: 45px;
    font-size: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
}

.btn-sm {
    min-height: 36px;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
}

/* Tabelle responsiva */
.table-responsive {
    border-radius: 0.5rem;
    overflow-x: auto;
}

.table {
    font-size: 0.95rem;
    margin-bottom: 0;
}

.table th {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    padding: 0.75rem;
}

.table td {
    padding: 0.75rem;
    vertical-align: middle;
}

/* Badge */
.badge {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Alert */
.alert {
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    padding: 1rem;
}

/* List group */
.list-group-item {
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Link di azioni in tabella */
.table a, .list-group-item a {
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
}

/* Mobile: hide unnecessary columns */
@media (max-width: 768px) {
    .table {
        font-size: 0.85rem;
    }

    .table th, .table td {
        padding: 0.5rem 0.25rem;
    }

    .table-sm-hide {
        display: none;
    }

    .navbar-text {
        display: block;
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .btn-sm {
        width: auto;
        margin-bottom: 0.25rem;
    }

    .form-control, .form-select {
        font-size: 16px; /* Previene zoom su iOS */
    }

    .container {
        padding: 0.75rem;
    }

    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.3rem; }
    h3 { font-size: 1.1rem; }
    h4 { font-size: 1rem; }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    .table {
        font-size: 0.9rem;
    }
}

/* Desktop */
@media (min-width: 1025px) {
    .container {
        max-width: 1200px;
    }
}

/* Prevenire zoom su input su iOS */
input, select, textarea {
    font-size: 16px !important;
}

/* Upload zone */
.upload-zone {
    border: 2px dashed #007bff;
    border-radius: 0.5rem;
    padding: 2rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}

.upload-zone:hover {
    border-color: #0056b3;
    background-color: #f0f7ff;
}

.upload-zone.drag-over {
    border-color: #0056b3;
    background-color: #f0f7ff;
}

/* Azioni rapide per mobile */
.actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.actions-row .btn {
    flex: 1 1 calc(50% - 0.5rem);
    min-width: 150px;
}

@media (max-width: 576px) {
    .actions-row .btn {
        flex: 1 1 100%;
    }
}

/* Statistiche cards */
.stats-card {
    text-align: center;
    padding: 1.5rem 1rem;
    border-radius: 0.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-bottom: 1rem;
}

.stats-card h5 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.stats-card .value {
    font-size: 2rem;
    font-weight: 700;
}

/* Stato pagamento */
.payment-status {
    display: inline-block;
    padding: 0.5rem 0.75rem;
    border-radius: 0.25rem;
    font-weight: 600;
    font-size: 0.85rem;
}

.payment-status.paid {
    background-color: #d4edda;
    color: #155724;
}

.payment-status.pending {
    background-color: #fff3cd;
    color: #856404;
}
