/* styles.css - Foglio di stile principale per Gestionale */

/* Reset e base */
* {
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    margin: 20px;
    background: #f5f5f5;
    line-height: 1.6;
    color: #333;
}

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

/* Header e Navigazione */
.header {
    background: linear-gradient(135deg, #333 0%, #444 100%);
    color: white;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.header h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 300;
}

.nav {
    background: #444;
    padding: 12px;
    margin-bottom: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav a {
    color: white;
    text-decoration: none;
    margin-right: 15px;
    padding: 10px 15px;
    border-radius: 5px;
    transition: all 0.3s ease;
    display: inline-block;
    font-weight: 500;
}

.nav a:hover {
    background: #555;
    transform: translateY(-1px);
}

.nav a.active {
    background: #007cba;
    box-shadow: 0 2px 4px rgba(0,124,186,0.3);
}

/* Sezioni */
.section {
    background: white;
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.section h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    border-bottom: 3px solid #007cba;
    padding-bottom: 10px;
    font-size: 20px;
    font-weight: 600;
}

/* Form e Input */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0,124,186,0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Bottoni */
.btn {
    background: #007cba;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    margin: 3px;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 14px;
}

.btn:hover {
    background: #005a87;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,124,186,0.3);
}

.btn-success {
    background: #28a745;
}

.btn-success:hover {
    background: #1e7e34;
    box-shadow: 0 4px 8px rgba(40,167,69,0.3);
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
    box-shadow: 0 4px 8px rgba(255,193,7,0.3);
}

.btn-danger {
    background: #dc3545;
}

.btn-danger:hover {
    background: #c82333;
    box-shadow: 0 4px 8px rgba(220,53,69,0.3);
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

/* Tabelle */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

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

th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

tr:hover {
    background: #f8f9fa;
}

/* Alert */
.alert {
    padding: 15px;
    margin: 15px 0;
    border-radius: 6px;
    border-left: 4px solid;
    font-weight: 500;
}

.alert-success {
    background: #d4edda;
    border-left-color: #28a745;
    color: #155724;
}

.alert-warning {
    background: #fff3cd;
    border-left-color: #ffc107;
    color: #856404;
}

.alert-danger {
    background: #f8d7da;
    border-left-color: #dc3545;
    color: #721c24;
}

.alert-info {
    background: #cce7f0;
    border-left-color: #007cba;
    color: #0c5460;
}

/* Statistiche */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-box {
    background: white;
    padding: 20px;
    border-left: 4px solid #007cba;
    text-align: center;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.3s ease;
}

.stat-box:hover {
    transform: translateY(-2px);
}

.stat-number {
    font-size: 24px;
    font-weight: 700;
    color: #007cba;
    margin-bottom: 8px;
    display: block;
}

.stat-label {
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

/* Filtri */
.filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

/* Card */
.card {
    background: white;
    padding: 20px;
    margin-bottom: 15px;
    border-left: 4px solid #007cba;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

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

.card-title {
    margin: 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

/* Stati e Priorità */
.stato-completato { color: #28a745; font-weight: 600; }
.stato-pagato { color: #007cba; font-weight: 700; }
.stato-fatturato { color: #ffc107; font-weight: 600; }
.stato-preventivo { color: #6c757d; font-weight: 600; }
.stato-inviato { color: #007cba; font-weight: 600; }
.stato-in_attesa { color: #ffc107; font-weight: 700; }
.stato-accettato { color: #28a745; font-weight: 700; }
.stato-rifiutato { color: #dc3545; font-weight: 600; }
.stato-scaduto { color: #6c757d; font-weight: 600; }

.priorita-alta { color: #dc3545; font-weight: 700; }
.priorita-media { color: #ffc107; font-weight: 600; }
.priorita-bassa { color: #28a745; font-weight: 600; }

.metric-positive { color: #28a745; font-weight: 700; }
.metric-negative { color: #dc3545; font-weight: 700; }
.metric-warning { color: #ffc107; font-weight: 700; }
.urgente { color: #dc3545; font-weight: 700; }

/* Badge */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary { background: #007cba; color: white; }
.badge-success { background: #28a745; color: white; }
.badge-warning { background: #ffc107; color: #212529; }
.badge-danger { background: #dc3545; color: white; }
.badge-secondary { background: #6c757d; color: white; }

/* Speciali */
.quick-add {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    border: 2px dashed #007cba;
}

.quick-add h4 {
    margin: 0 0 15px 0;
    color: #007cba;
}

.prezzo-highlight {
    font-size: 20px;
    font-weight: 700;
    color: #28a745;
}

.categoria-tag {
    background: #e9ecef;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 12px;
    color: #495057;
    font-weight: 500;
}

/* Footer */
footer {
    text-align: center;
    padding: 25px;
    color: #666;
    font-size: 13px;
    margin-top: 50px;
    border-top: 2px solid #e0e0e0;
    background: white;
    border-radius: 8px;
}

footer a {
    color: #007cba;
    text-decoration: none;
    font-weight: 500;
}

footer a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        margin: 10px;
    }
    
    .stats {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 15px;
    }
    
    .form-row,
    .form-row-3 {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .nav a {
        display: block;
        margin: 5px 0;
        text-align: center;
    }
    
    .card-header {
        flex-direction: column;
        align-items: start;
        gap: 10px;
    }
    
    table {
        font-size: 12px;
    }
    
    th, td {
        padding: 8px 4px;
    }
    
    .section {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .stats {
        grid-template-columns: 1fr 1fr;
    }
    
    .filters {
        grid-template-columns: 1fr;
    }
    
    .btn {
        width: 100%;
        margin: 5px 0;
    }
}