/* Stile generale */
:root {
    --primary-color: #e2ad24; /* giallo-arancio tema */
    --secondary-color: #2c3e50;
    --accent-color: #e74c3c;
    --light-color: #ecf0f1;
    --dark-color: #34495e;
    --success-color: #2ecc71;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --info-color: #e2ad24;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header e navigazione */
header {
    background: #eabd2e;
    background-image:
        repeating-conic-gradient(rgba(255,255,255,0.30) 0deg 15deg, rgba(255,255,255,0) 15deg 30deg),
        radial-gradient(circle at center, #eabd2e 0%, #e2ad24 60%, #d49a13 100%);
    color: #2c3e50;
    padding: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo {
    max-height: 50px;
    margin-right: 1rem;
}

.brand-info h1 {
    font-size: 1.35rem;
    margin-bottom: 0.15rem;
}

.motto { display: none; }

/* Link brand: cliccabile senza sottolineatura in tutti gli stati */
.brand-info .brand-link { display: inline-block; }
.brand-info .brand-link,
.brand-info .brand-link:visited,
.brand-info .brand-link:hover,
.brand-info .brand-link:focus,
.brand-info .brand-link:active {
    color: inherit;
    text-decoration: none;
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 1rem;
}

nav ul li a {
    color: #2c3e50;
    text-decoration: none;
    padding: 0.5rem 0.6rem;
    border-radius: 6px;
    transition: filter 0.2s, background-color 0.2s;
    font-size: 0.9rem; /* riduce dimensione carattere navbar */
}

nav ul li a:hover {
    background-color: rgba(0, 0, 0, 0.06);
}

nav ul li a i {
    margin-right: 0.5rem;
}

/* Selettore anno in navbar */
.nav-year { margin-left: 1rem; display: flex; align-items: center; }
.nav-year label { margin-right: 0.5rem; font-size: 0.9rem; color: #2c3e50; }
.year-select { padding: 0.35rem 0.5rem; border-radius: 6px; border: 1px solid rgba(0,0,0,0.2); background: #fff; color: #2c3e50; width: 180px; }
.year-select:focus { outline: none; box-shadow: 0 0 0 2px rgba(44,62,80,0.2); }

/* Main content */
main {
    flex: 1;
    padding: 0;
}

/* (rimosso) utility non più necessaria */

.content {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 240px;
    background: #ffffff;
    border-right: 1px solid rgba(0,0,0,0.1);
    padding: 0.75rem;
    overflow-y: auto;
    z-index: 1000;
}
.sidebar .menu-title { font-size: 0.95rem; font-weight: 600; color: #2c3e50; margin-bottom: 0.5rem; }
.sidebar nav ul { list-style: none; padding: 0; margin: 0; display: block; }
.sidebar nav ul li { margin: 0.25rem 0; }
.sidebar nav ul li a { display: flex; align-items: center; color: #2c3e50; text-decoration: none; padding: 0.5rem 0.6rem; border-radius: 6px; transition: background-color 0.2s; }
.sidebar nav ul li a i { margin-right: 0.5rem; }
.sidebar nav ul li a:hover, .sidebar nav ul li a.active { background-color: rgba(0,0,0,0.06); }
.sidebar .year-select { width: 100%; margin-top: 0.5rem; }

header, main, footer { margin-left: 240px; }

h2 {
    color: var(--secondary-color);
    margin-bottom: 1.2rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.4rem;
}

.toolbar-3col {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.4rem;
    margin-bottom: 1.2rem;
}

.toolbar-3col > h2 {
    border-bottom: 0;
    margin: 0;
    padding-bottom: 0;
    flex: 0 0 40%;
    max-width: 40%;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toolbar-3col .toolbar-form {
    flex: 0 0 42%;
    max-width: 42%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0;
}

.toolbar-3col .toolbar-actions {
    flex: 0 0 14%;
    max-width: 14%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

@media (max-width: 992px) {
    .toolbar-3col > h2,
    .toolbar-3col .toolbar-form,
    .toolbar-3col .toolbar-actions {
        flex: 0 0 100%;
        max-width: 100%;
        justify-content: flex-start;
    }
}

/* Dashboard widgets */
.dashboard-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.widget {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    transition: transform 0.3s, box-shadow 0.3s;
}

.widget:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.widget h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.widget h3 i {
    margin-right: 0.5rem;
}

.widget p {
    margin-bottom: 1rem;
    color: #666;
}

/* Buttons */
.btn {
    display: inline-block;
    background: #e2ad24;
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    border: 1px solid #c68d0f;
    cursor: pointer;
    transition: filter 0.2s;
}

.btn:hover { filter: brightness(1.06); }

.btn-block {
    display: block;
    width: 100%;
    text-align: center;
}

.btn-primary { background-color: #e2ad24; border: 1px solid #c68d0f; }

.btn-secondary { background-color: var(--secondary-color); border: 1px solid #1f2c39; }

.btn-success {
    background-color: var(--success-color);
}

.btn-danger {
    background-color: var(--danger-color);
}

/* Info button (azzurro) and small size */
.btn-info {
    background-color: #5bc0de;
    border: 1px solid #31b0d5;
    color: #fff;
}
.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

/* Form row layout for multiple fields on one line */
.form-row {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
}
.form-row .form-group {
    flex: 1;
    min-width: 200px;
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
}

.label-help {
    font-weight: normal;
    font-size: 0.9em;
    color: #666;
    margin-left: 0.5rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
select,
textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(226, 173, 36, 0.25);
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

th, td {
    padding: 0.4rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: var(--light-color);
    color: var(--secondary-color);
    font-weight: 600;
}

tr:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

/* --- Override per uniformare le card al layout PWA --- */
:root { --card: #fff; }
.widget {
    background: var(--card);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    padding: 12px;
    transition: filter 0.2s;
}
.widget:hover {
    filter: brightness(1.02);
    transform: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}
.card {
    background: var(--card);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    padding: 12px;
    transition: filter 0.2s;
}
.card:hover { filter: brightness(1.02); }
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}
.dashboard-widgets { gap: 12px; }

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25em 0.6em;
    font-size: 75%;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
    color: white;
}

/* Badge anno: stile uniforme per i titoli di pagina */
.badge-year {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.9rem;
    line-height: 1;
    background: var(--secondary-color);
    color: #fff;
    border: none;
    cursor: pointer;
}

.badge-success {
    background-color: var(--success-color);
}

.badge-danger {
    background-color: var(--danger-color);
}

/* Header unificato: select anno + icona + titolo */
.page-title-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.page-title-bar .year-select {
    height: 34px;
    padding: 0 10px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    background: #fff;
    color: #2c3e50;
    font-size: 0.95rem;
    width: 180px;
}
.page-title-bar .page-icon {
    font-size: 22px;
    color: #2c3e50;
}
.page-title-bar .page-title {
    font-size: 1.45rem;
    font-weight: 600;
    color: #2c3e50;
}

/* Footer */
footer {
    text-align: center;
    padding: 1rem;
    margin-top: auto;
    background: #eabd2e;
    background-image:
        repeating-conic-gradient(rgba(255,255,255,0.30) 0deg 15deg, rgba(255,255,255,0) 15deg 30deg),
        radial-gradient(circle at center, #eabd2e 0%, #e2ad24 60%, #d49a13 100%);
    color: #2c3e50;
}

/* Login page */
.login-page {
    background-color: var(--light-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 1rem;
}

.login-box {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    padding: 2rem;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    max-height: 80px;
    margin-bottom: 1rem;
}

.login-form .form-group:last-child {
    margin-bottom: 0;
}

/* Responsive design */
@media (max-width: 768px) {
    header {
        flex-direction: column;
    }
    
    nav ul {
        margin-top: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    nav ul li {
        margin: 0.5rem;
    }
    
    .dashboard-widgets {
        grid-template-columns: 1fr;
    }
    
    .content {
        padding: 1.5rem;
    }

    /* Stack form-row items on small screens */
    .form-row { gap: 0.75rem; }
    .form-row .form-group { min-width: 160px; }
}

/* Utility classes */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.ml-1 { margin-left: 0.5rem; }
.ml-2 { margin-left: 1rem; }

.mr-1 { margin-right: 0.5rem; }
.mr-2 { margin-right: 1rem; }

.flex { display: flex; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }
.flex-wrap { flex-wrap: wrap; }
/* Zebra striping per tabella settimanale prenotazioni (grigio chiaro/bianco) */
.weekly-table tbody tr:nth-child(odd) {
  background-color: #ffffff;
}
.weekly-table tbody tr:nth-child(even) {
  background-color: #f7f7f7;
}

/* Stili modali condivisi (vendite, abbonati, ecc.) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}
.modal-content {
    background-color: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    max-width: 600px;
    width: 90%;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalFadeIn 0.3s;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}
.modal-close {
    font-size: 1.5rem;
    cursor: pointer;
    color: #aaa;
    text-decoration: none;
    line-height: 1;
}
.modal-close:hover {
    color: #333;
}
@keyframes modalFadeIn {
    from {opacity: 0; transform: translateY(-20px);}
    to {opacity: 1; transform: translateY(0);}
}
