/* style.css - Artègo Management System */

:root {
    --primary-color: #1e40af; /* Professional Blue (Tailwind blue-800) */
    --primary-hover: #1e3a8a; /* Darker Blue */
    --accent-blue: #3b82f6;
    --bg-main: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #334155;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
}

body {
    background-color: var(--bg-main);
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    margin: 0;
}

/* Navbar */
.navbar-custom {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 10px 15px;
}
@media (min-width: 768px) {
    .navbar-custom { padding: 10px 30px; }
}
.navbar-custom h4, .navbar-custom h5 {
    margin: 0;
    font-weight: 700;
    color: var(--primary-color);
}
.navbar-brand-sub {
    font-weight: 300;
    color: var(--text-muted);
}

/* Cards & Layout */
.main-container, .container-fluid, .container {
    padding-top: 20px;
    padding-bottom: 20px;
}
.custom-card {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    overflow: hidden;
}

/* Tables */
.table thead {
    background-color: var(--bg-main);
    border-bottom: 2px solid var(--border-color);
}
.table th {
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 1px;
    padding: 12px;
}
.table td {
    vertical-align: middle;
}

/* Badges & Tags */
.badge-colore { background: #fee2e2; color: #991b1b; padding: 4px 10px; border-radius: 20px; font-size: 0.65rem; font-weight: 700; text-transform: uppercase; }
.badge-piega { background: #fef3c7; color: #92400e; padding: 4px 10px; border-radius: 20px; font-size: 0.65rem; font-weight: 700; text-transform: uppercase; }
.prod-tag { display: inline-block; background: #f1f5f9; color: var(--text-muted); padding: 2px 8px; border-radius: 4px; font-size: 0.65rem; margin-right: 4px; border: 1px solid var(--border-color); margin-bottom: 2px; }

/* Pagination */
.pagination {
    margin-bottom: 0;
}
.pagination .page-link {
    color: var(--primary-color);
    border: none;
    margin: 0 2px;
    border-radius: 6px !important;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.pagination .active .page-link {
    background-color: var(--primary-color) !important;
    color: white !important;
}

/* Buttons */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}
.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}

/* Forms */
.form-label {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.form-control, .form-select {
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    padding: 10px 15px;
}
.form-control:focus, .form-select:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

/* Specific elements */
.nuance-desc {
    font-size: 0.65rem;
    color: var(--text-muted);
    display: block;
    margin-top: 2px;
    text-transform: capitalize;
}
.section-title {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.section-title::after {
    content: "";
    height: 1px;
    background: var(--border-color);
    flex-grow: 1;
}

/* Status Badges */
.st-badge { padding: 4px 10px; border-radius: 20px; font-size: 0.65rem; font-weight: 700; text-transform: uppercase; display: inline-block; }
.st-naturale { background: #dcfce7; color: #166534; }
.st-colorata { background: #e0f2fe; color: #075985; }
.st-decolorata { background: #fef3c7; color: #92400e; }
.st-mista { background: #f5f3ff; color: #5b21b6; border: 1px solid #ddd6fe; }

/* Login Page specific */
.login-card { 
    background: white; 
    border-radius: 20px; 
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3); 
    width: 100%;
    max-width: 400px;
    padding: 40px;
}
.login-wrapper {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* PWA & Mobile Optimizations */
@media (max-width: 767px) {
    /* Touch targets più grandi sui cellulari ma senza rompere il calendario */
    .btn-sm, .badge {
        padding: 6px 10px;
    }
    .form-control, .form-select {
        font-size: 16px; /* Previene lo zoom automatico su iOS */
    }
    .table th, .table td {
        font-size: 0.85rem;
        padding: 10px 8px;
    }
    /* Safe Area per i Notch e le barre di scorrimento di iOS */
    .navbar-custom {
        padding-top: max(15px, env(safe-area-inset-top));
    }
    body {
        padding-bottom: max(20px, env(safe-area-inset-bottom));
        -webkit-tap-highlight-color: transparent;
    }
    /* Layout a due righe per la toolbar del calendario su mobile */
    .fc .fc-header-toolbar {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }
    .fc .fc-toolbar-chunk:nth-child(2) {
        width: 100%;
        order: -1; /* Sposta il titolo in alto */
        text-align: center;
        margin-bottom: 5px;
    }
    .fc .fc-toolbar-title {
        font-size: 1.3rem !important;
    }
    /* Rimpicciolisce i bottoni per farli entrare nella stessa riga */
    .fc .fc-button {
        font-size: 0.85rem !important;
        padding: 5px 8px !important;
    }
    /* Rimpicciolisce il testo dei giorni (es. lun 22/06) nella vista settimanale */
    .fc .fc-col-header-cell-cushion {
        font-size: 0.75rem !important;
        padding: 4px !important;
    }
}

/* Fix per i testi degli eventi nella vista settimanale/giornaliera (appuntamenti affiancati) */
.fc-timegrid-event {
    min-height: 42px !important; /* Forza un'altezza minima per farci stare due righe */
}
.fc-timegrid-event .fc-event-main-frame {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1px;
    padding: 2px !important;
    overflow: visible !important;
}
.fc-timegrid-event .fc-event-time {
    font-size: 0.7rem !important; /* Più piccolo per recuperare spazio */
    font-weight: bold;
    margin-bottom: 0 !important;
    white-space: nowrap !important;
    line-height: 1 !important;
}
.fc-timegrid-event .fc-event-title-container {
    flex-grow: 1;
    overflow: visible !important;
}
.fc-timegrid-event .fc-event-title {
    white-space: normal !important; /* Torna ad andare a capo */
    font-size: 0.75rem !important; /* Font proporzionato */
    line-height: 1.1 !important;
    overflow: visible !important;
}
