/* Reset e stili base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #f8f9fa;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    overflow-x: hidden;
}

/* Layout principale */
.container-fluid {
    padding: 0;
}

.row {
    margin: 0;
}

/* Navbar */
.navbar {
    position: relative;
    z-index: 1030;
}

.dropdown-menu {
    z-index: 1031;
}

/* Sidebar */
.sidebar {
    min-width: 260px;
    width: 260px;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    padding: 48px 0 0;
    background-color: #f8f9fa;
    border-right: 1px solid #dee2e6;
    transition: all 0.3s ease;
}

.sidebar-sticky {
    position: relative;
    top: 0;
    height: calc(100vh - 48px);
    padding: 1rem;
    overflow-x: hidden;
    overflow-y: auto;
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: #333;
    text-decoration: none;
    border-radius: 0.25rem;
    margin-bottom: 0.25rem;
    transition: all 0.2s ease;
}

.sidebar .nav-link:hover {
    background-color: #e9ecef;
    color: #0d6efd;
}

.sidebar .nav-link.active {
    background-color: #0d6efd;
    color: white;
}

.sidebar .nav-link i {
    margin-right: 0.75rem;
    width: 1.25rem;
    text-align: center;
}

/* Contenuto principale */
.main-content {
    margin-left: 260px;
    padding: 2rem;
    min-height: 100vh;
}

/* Card e contenitori */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    margin-bottom: 1.5rem;
    background-color: #fff;
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 1rem 1.5rem;
}

.card-body {
    padding: 1.5rem;
}

/* Form elements */
.form-control {
    border-radius: 0.375rem;
    border: 1px solid #dee2e6;
    padding: 0.5rem 0.75rem;
}

.form-control:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

/* Tables */
.table {
    margin-bottom: 0;
}

.table th {
    background-color: #f8f9fa;
    font-weight: 600;
    padding: 0.75rem;
    border-bottom: 2px solid #dee2e6;
}

.table td {
    padding: 0.75rem;
    vertical-align: middle;
    border-bottom: 1px solid #dee2e6;
}

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

/* Modal */
.modal-content {
    border-radius: 0.5rem;
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.modal-header {
    border-bottom: 1px solid #dee2e6;
    padding: 1rem 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid #dee2e6;
    padding: 1rem 1.5rem;
}

/* Utilities */
.cursor-pointer {
    cursor: pointer;
}

/* Footer */
.footer {
    padding: 1rem;
    text-align: center;
    color: #6c757d;
    margin-top: 2rem;
}

/* Tema Scuro */
body.dark-mode {
    background-color: #1a1a1a;
    color: #e4e4e4;
}

.dark-mode .sidebar {
    background-color: #2d2d2d;
    border-right-color: #404040;
}

.dark-mode .nav-link {
    color: #e4e4e4;
}

.dark-mode .nav-link:hover {
    background-color: #404040;
    color: #80bdff;
}

.dark-mode .card {
    background-color: #2d2d2d;
    border-color: #404040;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.2);
}

.dark-mode .card-header {
    background-color: #363636;
    border-bottom-color: #404040;
    color: #e4e4e4;
}

.dark-mode .form-control,
.dark-mode .form-select {
    background-color: #363636;
    border-color: #404040;
    color: #e4e4e4;
}

.dark-mode .form-control:focus,
.dark-mode .form-select:focus {
    background-color: #404040;
    border-color: #0d6efd;
    color: #ffffff;
}

.dark-mode .form-control:disabled {
    background-color: #2d2d2d;
    color: #888;
}

.dark-mode .table {
    color: #e4e4e4;
}

.dark-mode .table th {
    background-color: #363636;
    border-color: #404040;
}

.dark-mode .table td {
    border-color: #404040;
}

.dark-mode .alert {
    background-color: #2d2d2d;
    border-color: #404040;
}

.dark-mode .alert-info {
    background-color: #1c4356;
    border-color: #0dcaf0;
    color: #e4e4e4;
}

.dark-mode .alert-success {
    background-color: #1c4532;
    border-color: #198754;
    color: #e4e4e4;
}

.dark-mode .alert-danger {
    background-color: #451c1c;
    border-color: #dc3545;
    color: #e4e4e4;
}

.dark-mode .modal-content {
    background-color: #2d2d2d;
    border-color: #404040;
}

.dark-mode .modal-header,
.dark-mode .modal-footer {
    border-color: #404040;
}

.dark-mode .dropdown-menu {
    background-color: #2d2d2d;
    border-color: #404040;
}

.dark-mode .dropdown-item {
    color: #e4e4e4;
}

.dark-mode .dropdown-item:hover {
    background-color: #363636;
    color: #ffffff;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: relative;
        height: auto;
        margin-bottom: 1rem;
    }

    .main-content {
        margin-left: 0;
        padding: 1rem;
    }

    .card-body {
        padding: 1rem;
    }

    .table-responsive {
        margin-bottom: 1rem;
    }
}

/* Print styles */
@media print {
    .sidebar,
    .navbar,
    .no-print {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }

    .card {
        break-inside: avoid;
        border: 1px solid #dee2e6;
    }
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 4px;
    color: white;
    font-weight: 500;
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
}

.notification.success {
    background-color: #4CAF50;
}

.notification.error {
    background-color: #f44336;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}