/* === VARIABILI === */
:root {
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 60px;
    --sidebar-bg: #1e293b;
    --sidebar-text: #94a3b8;
    --sidebar-active: #ffffff;
    --sidebar-hover-bg: #334155;
}

/* === LAYOUT === */
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: #f1f5f9;
    min-height: 100vh;
}

/* === SIDEBAR === */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar-header {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
}

.sidebar .nav-link {
    color: var(--sidebar-text);
    padding: 0.7rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s ease;
    border-radius: 0;
    font-size: 0.9rem;
}

.sidebar .nav-link:hover {
    background: var(--sidebar-hover-bg);
    color: var(--sidebar-active);
}

.sidebar .nav-link.active {
    background: rgba(59, 130, 246, 0.2);
    color: var(--sidebar-active);
    border-left: 3px solid #3b82f6;
}

.sidebar .nav-link i {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    margin-top: auto;
    padding: 0.75rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-footer .nav-link {
    color: var(--sidebar-text);
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.sidebar-footer .dropdown-toggle::after {
    margin-left: auto;
}

/* === MAIN CONTENT === */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

/* === STAT CARDS === */
.stat-card .card-body {
    padding: 1.25rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

/* === TABLES === */
.table th {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
    border-bottom-width: 2px;
}

.table td {
    vertical-align: middle;
    font-size: 0.9rem;
}

/* === CARDS === */
.card {
    border-radius: 12px;
    border: none;
}

.card-header {
    border-radius: 12px 12px 0 0 !important;
    font-weight: 600;
}

/* === LOGIN PAGE === */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1rem;
}

.login-card {
    background: white;
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.login-icon {
    font-size: 3rem;
    color: #667eea;
}

/* === NAVBAR MOBILE === */
.navbar-mobile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    background: white;
    border-bottom: 1px solid #e2e8f0;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1030;
}

/* === BADGES === */
.badge {
    font-weight: 500;
    font-size: 0.75rem;
}

/* === BUTTONS === */
.btn-primary {
    background: #3b82f6;
    border-color: #3b82f6;
}

.btn-primary:hover {
    background: #2563eb;
    border-color: #2563eb;
}

/* === ALERT === */
.alert {
    border-radius: 10px;
    border: none;
}

/* === RESPONSIVE === */
@media (max-width: 767.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .sidebar-overlay.show {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }
}

@media (min-width: 768px) {
    .navbar-mobile {
        display: none !important;
    }
}

/* === SCROLLBAR === */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

/* === FULLCALENDAR overrides === */
.fc .fc-button-primary {
    background-color: #3b82f6;
    border-color: #3b82f6;
}

.fc .fc-button-primary:hover {
    background-color: #2563eb;
    border-color: #2563eb;
}

.fc .fc-button-primary:not(:disabled).fc-button-active {
    background-color: #1d4ed8;
    border-color: #1d4ed8;
}

.fc .fc-daygrid-event {
    border-radius: 6px;
    padding: 2px 6px;
    font-size: 0.8rem;
}

/* === FORM improvements === */
.form-control:focus, .form-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.15);
}

.form-label {
    font-weight: 500;
    font-size: 0.875rem;
    color: #475569;
}

/* === ANIMATION === */
.card {
    transition: box-shadow 0.2s ease;
}

.stat-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

/* === NOTIFICHE === */
.top-navbar-desktop {
    position: fixed;
    top: 0;
    right: 0;
    padding: 1rem;
    z-index: 1030;
}

.notification-bell {
    position: relative;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.notification-bell:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    font-size: 0.7rem;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-popup {
    position: fixed;
    top: 80px;
    right: 20px;
    min-width: 350px;
    max-width: 400px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1050;
    animation: slideInRight 0.3s ease-out;
    border-left: 4px solid #2c6e49;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification-popup-header {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f9fafb;
    border-radius: 8px 8px 0 0;
}

.notification-popup-body {
    padding: 1rem;
}

.notification-popup-title {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.notification-popup-message {
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.notification-popup-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.notification-popup-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-popup-close:hover {
    color: #1f2937;
}

.notification-dropdown {
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
