:root {
    --bg-color: #f4f6f9;
    --sidebar-width: 250px;
    --primary-color: #2c3e50;
    --accent-color: #3498db;
}

body { font-family: 'Inter', sans-serif; background-color: var(--bg-color); color: #333; overflow-x: hidden; }

#loginOverlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255,255,255,0.98); z-index: 1050; display: flex; align-items: center; justify-content: center; }
.login-card { width: 100%; max-width: 400px; padding: 2.5rem; border-radius: 8px; box-shadow: 0 15px 35px rgba(0,0,0,0.05); background: white; text-align: center; }

.sidebar { width: var(--sidebar-width); background: white; height: 100vh; position: fixed; top: 0; left: 0; border-right: 1px solid #e9ecef; padding-top: 25px; z-index: 1000; }
.sidebar-header { padding: 0 25px 25px; border-bottom: 1px solid #f8f9fa; margin-bottom: 15px; }
.brand { font-weight: 600; font-size: 1.25rem; color: var(--primary-color); text-decoration: none; display: block; margin-bottom: 20px; }
.user-info { padding: 0 25px 15px; font-size: 0.85rem; color: #888; background: #fdfdfd; margin: 0 15px 20px; border-radius: 6px; }
.nav-link { color: #6c757d; padding: 12px 25px; font-weight: 500; transition: all 0.2s; cursor: pointer; display: flex; align-items: center; }
.nav-link:hover { color: var(--primary-color); background-color: #f8f9fa; }
.nav-link.active { color: var(--accent-color); background-color: #f8f9fa; border-right: 3px solid var(--accent-color); }
.nav-link i { width: 28px; font-size: 1rem; }

.main-content { margin-left: var(--sidebar-width); padding: 40px; }
.card { border: none; box-shadow: 0 2px 8px rgba(0,0,0,0.02); border-radius: 8px; background: white; margin-bottom: 25px; }
.card-header { background: white; border-bottom: 1px solid #f1f3f5; padding: 20px 25px; font-weight: 600; font-size: 1.1rem; color: var(--primary-color); display: flex; justify-content: space-between; align-items: center; }

.table thead th { border-top: none; border-bottom: 2px solid #f1f3f5; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: #adb5bd; font-weight: 600; padding: 15px 20px; }
.table td { vertical-align: middle; font-size: 0.95rem; color: #495057; padding: 15px 20px; border-bottom: 1px solid #f8f9fa; }
.table-hover tbody tr:hover { background-color: #f8f9fa; cursor: pointer; }
.avatar-circle { width: 36px; height: 36px; background-color: #e9ecef; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: 600; color: var(--primary-color); margin-right: 12px; }

.hidden { display: none !important; }
.fade-in { animation: fadeIn 0.3s ease-in-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.form-label { font-size: 0.8rem; font-weight: 600; color: #666; }
input:disabled, textarea:disabled, select:disabled { background-color: #fafafa; color: #999; cursor: default; }

.nav-tabs .nav-link { border: none; color: #666; font-size: 0.9rem; padding: 10px 20px; }
.nav-tabs .nav-link.active { background: #fff; border-bottom: 2px solid var(--accent-color); color: var(--accent-color); font-weight: 600; }
.nav-tabs { border-bottom: 1px solid #f0f0f0; }
.fixed-anagrafica { background-color: #fcfcfc; padding: 20px; border-radius: 6px; margin-bottom: 20px; border: 1px solid #f1f1f1; }
.fixed-anagrafica h6 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.5px; color: #999; margin-bottom: 15px; }

#hoverCard { position: fixed; display: none; z-index: 9999; width: 280px; padding: 15px; background: white; border-radius: 8px; box-shadow: 0 8px 25px rgba(0,0,0,0.15); border: 1px solid #eee; pointer-events: none; opacity: 0; transition: opacity 0.1s ease-out; }
#hoverCard.visible { opacity: 1; }
.hover-item { font-size: 0.85rem; margin-bottom: 6px; color: #555; display: flex; align-items: flex-start; }
.hover-item i { width: 20px; margin-top: 3px; color: #aaa; }
.hover-title { font-size: 0.95rem; font-weight: 600; color: #333; margin-bottom: 8px; border-bottom: 1px solid #f0f0f0; padding-bottom: 5px; }

.dashboard-search-box { background: #fff; padding: 30px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.02); }
.dash-card { border: 1px solid #f1f3f5 !important; transition: all 0.2s; }
.dash-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.dash-item { display: flex; align-items: center; padding: 10px 0; border-bottom: 1px solid #f8f9fa; cursor: pointer; }
.dash-item:last-child { border-bottom: none; }
.dash-item:hover { background-color: #fcfcfc; }
.dash-item .avatar-circle { width: 32px; height: 32px; font-size: 0.7rem; }
.dash-item-info { margin-left: 12px; flex-grow: 1; }
.dash-item-name { font-weight: 600; font-size: 0.9rem; color: #333; }
.dash-item-sub { font-size: 0.8rem; color: #888; }

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); transition: transform 0.3s; }
    .main-content { margin-left: 0; padding: 20px; }
}