.bg-gradient {
    min-height: 100vh;
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top left, #6a8cf7, #5b5fe8 30%, #7b3fe7 70%, #5f2fcf 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.bg-light {
    min-height: 100vh;
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f5f7fb;
}

.center-wrapper {
    padding: 24px;
    width: 100%;
    display: flex;
    justify-content: center;
}

.card {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border-radius: 16px;
    padding: 32px 32px 24px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.35);
}

.logo-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.logo-mark {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    border: 2px solid #111827;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
}

.title {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 4px;
}

.subtitle {
    text-align: center;
    font-size: 15px;
    font-weight: 500;
    color: #4b5563;
    margin: 0 0 4px;
}

.muted {
    text-align: center;
    font-size: 13px;
    color: #6b7280;
    margin: 0 0 24px;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

input[type="text"],
input[type="password"] {
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #4b5563;
    font-size: 14px;
    background-color: #111827;
    color: #f9fafb;
}

input[type="text"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 1px #2563eb;
}

.btn-primary {
    margin-top: 8px;
    width: 100%;
    padding: 10px 14px;
    border-radius: 6px;
    border: none;
    background-color: #1d9bf0;
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.btn-primary:hover {
    background-color: #1580cc;
}

.btn-secondary {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background-color: #ffffff;
    color: #111827;
    font-size: 14px;
    cursor: pointer;
}

.btn-secondary:hover {
    background-color: #f3f4f6;
}

.footer-text {
    margin-top: 24px;
    text-align: center;
    font-size: 12px;
    color: #9ca3af;
}

.error-message {
    font-size: 13px;
    color: #b91c1c;
    margin-top: 4px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background-color: #111827;
    color: #f9fafb;
    width: 100%;
    box-sizing: border-box;
    flex-wrap: wrap;
    gap: 12px;
    position: relative;
}

.topbar-title {
    font-size: 16px;
    font-weight: 600;
    flex-shrink: 0;
    white-space: nowrap;
    align-self: center;
}

.dashboard-main {
    padding: 24px;
}

.dashboard-card {
    max-width: 1120px;
    margin: 24px auto;
    background: #ffffff;
    border-radius: 12px;
    padding: 24px 20px;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.1);
}

.dashboard-card h1 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 20px;
    color: #111827;
}

.dashboard-card p {
    margin: 4px 0;
    font-size: 14px;
    color: #4b5563;
}

.topbar-nav {
    display: flex;
    gap: 12px;
    margin-left: 24px;
    margin-right: auto;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
    align-items: center;
}

.nav-link {
    color: #d1d5db;
    text-decoration: none;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
    display: inline-block;
}

.nav-link:hover {
    background-color: #1f2937;
}

.nav-link.active {
    background-color: #374151;
    color: #ffffff;
}

.admin-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    white-space: nowrap;
    flex-basis: 100%;
    margin-left: 0;
    padding-left: 0;
    border-left: none;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #374151;
}

.admin-menu .nav-link {
    color: #fbbf24;
    font-weight: 500;
}

.admin-menu .nav-link:hover {
    background-color: #1f2937;
    color: #fcd34d;
}

.admin-menu .nav-link.active {
    background-color: #374151;
    color: #fcd34d;
}

/* Stile per il contenitore utente/logout nel topbar */
.topbar > div:last-child {
    flex-shrink: 0;
    white-space: nowrap;
    margin-left: auto;
    align-self: center;
}

.card-subtitle {
    font-size: 13px;
    color: #6b7280;
    margin-top: 0;
}

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

.btn-small {
    width: auto;
    padding-inline: 16px;
}

.table-wrapper {
    margin-top: 8px;
    overflow-x: auto;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-top: 16px;
}

/* Stili per pagina dettaglio appartenente */
.detail-section {
    margin-bottom: 32px;
    padding: 20px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.detail-section h2 {
    margin-top: 0;
    margin-bottom: 16px;
    color: #1e293b;
    font-size: 1.25rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 8px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.detail-item {
    display: flex;
    flex-direction: column;
}

.detail-item label {
    font-weight: 600;
    color: #64748b;
    font-size: 0.875rem;
    margin-bottom: 4px;
}

.detail-item span {
    color: #1e293b;
    font-size: 1rem;
}

.info-message {
    padding: 12px 16px;
    background: #dbeafe;
    color: #1e40af;
    border-radius: 6px;
    margin-bottom: 16px;
}

.data-table tbody tr {
    cursor: pointer;
    transition: background-color 0.2s;
}

.data-table tbody tr:hover {
    background-color: #f1f5f9;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 24px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 12px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #64748b;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #1e293b;
}

.form-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
    font-size: 0.875rem;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #e2e8f0;
}

.stat-card {
    background-color: #f9fafb;
    border-radius: 10px;
    padding: 14px 12px;
    border: 1px solid #e5e7eb;
}

.stat-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7280;
    margin-bottom: 6px;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
}

.stat-sub {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 2px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th,
.data-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
}

.data-table th {
    font-weight: 600;
    background-color: #f3f4f6;
}

.data-table tr:hover {
    background-color: #f9fafb;
}

.stat-card.clickable {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card.clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.15);
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 20px;
}

.chart-container {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.chart-container h3 {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 16px;
    color: #111827;
}

.chart-container canvas {
    max-height: 300px;
}

.zoom-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 20px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: #495057;
}

.zoom-btn:hover {
    background: #007bff;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge.success {
    background: #d4edda;
    color: #155724;
}

.badge.warning {
    background: #fff3cd;
    color: #856404;
}

.badge.inactive {
    background: #e2e3e5;
    color: #383d41;
}
    color: white;
    border-color: #007bff;
    transform: scale(1.05);
}

.zoom-btn:active {
    transform: scale(0.95);
}

@media (max-width: 480px) {
    .card {
        padding: 24px 20px 20px;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
}


