/* Importazione del font Poppins da Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* Nuova palette colori */
:root {
    --main-bg-color: #E5E5E5;
    --sidebar-text-color: #333333;
    --primary-color: #424A5D;
    --accent-color: #E2001A;

    /* Sovrascrittura delle variabili Bootstrap */
    --bs-primary: #424A5D;
    --bs-primary-rgb: 66, 74, 93;
    --bs-link-color: #424A5D;
    --bs-link-color-rgb: 66, 74, 93;
    --bs-link-hover-color: #363d4d;
    --bs-link-hover-color-rgb: 54, 61, 77;
    --bs-focus-ring-color: rgba(66, 74, 93, 0.25);
    --bs-danger: #E2001A;
    --bs-danger-rgb: 226, 0, 26;

    /* Sovrascrittura del font */
    --bs-font-sans-serif: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px white inset !important;
}

.form-floating > .form-control,
.form-floating > .form-select {
    padding: 0.625rem 0.75rem;
    min-height: calc(2.5rem + 2px);
    line-height: 1.25;
    height: calc(2.5rem + 2px);
    transition: all 0.2s ease-in-out;
    font-size: 0.85rem;
}

.form-floating > textarea.form-control {
    min-height: calc(6rem + 2px);
    height: auto;
}

.form-floating > label {
    padding: 0.625rem 0.75rem;
    transform-origin: 0 0;
    height: calc(2.5rem + 2px);
    color: #6c757d;
    font-size: 0.85rem;
    transition: all 0.2s ease-in-out;
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label,
.form-floating > .form-select:focus ~ label,
.form-floating > .form-select:not([value=""]):valid ~ label {
    transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
    background-color: white;
    height: auto;
    padding: 0 0.25rem;
    color: #0d6efd;
    font-weight: 500;
}

.form-floating > .form-control:not(:placeholder-shown),
.form-floating > .form-select:not([value=""]):valid {
    padding-top: 0.625rem;
    padding-bottom: 0.625rem;
}

.form-floating > .form-control:focus,
.form-floating > .form-select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.15rem rgba(13, 110, 253, 0.15);
}

.input-group .form-floating > .form-control {
    border-radius: 0 0.375rem 0.375rem 0;
}

.input-group > .btn {
    padding: 0.5rem 0.75rem;
    display: flex;
    align-items: center;
    transition: all 0.2s ease-in-out;
}

/* Stili per i filtri calendario */
.calendar-filter-group {
    background-color: #fff;
    border: 1px solid rgba(0,0,0,.125);
    border-radius: .25rem;
    padding: 1rem;
}

.calendar-filters .btn-link {
    color: #6c757d;
    font-size: 0.875rem;
}

.calendar-filters .btn-link:hover {
    color: #0d6efd;
}

.calendar-filters .btn-link i {
    transition: transform 0.2s ease-in-out;
}

.calendar-filters .filters-container {
    padding-left: 1rem;
}

.filter-section {
    margin-bottom: 1rem;
}

.filter-title {
    color: #6c757d;
}

.filter-section .form-check {
    margin-bottom: 0.25rem;
}

/* Applicazione della nuova palette colori */

/* Sfondo principale e font */
body {
    background-color: var(--main-bg-color);
    font-size: 0.9rem;
}

/* Riduzione dimensione font generale */
.app-content {
    font-size: 0.9rem;
}

/* Riduzione dimensione font per i titoli */
h1, .h1 { font-size: 1.8rem; }
h2, .h2 { font-size: 1.6rem; }
h3, .h3 { font-size: 1.4rem; }
h4, .h4 { font-size: 1.2rem; }
h5, .h5 { font-size: 1.1rem; }
h6, .h6 { font-size: 1rem; }

/* Header e logo */
.app-header__logo .logo-text {
    font-weight: 700;
    font-size: 1.7rem;
    letter-spacing: 1px;
    color: #333;
    text-transform: uppercase;
    display: flex;
    align-items: center;
}

.app-header__logo .logo-web {
    font-weight: 400;
    color: #777;
    margin-left: 2px;
    font-size: 1.7rem;
}

/* Sidebar e testi secondari */
.app-sidebar {
    background-color: var(--sidebar-text-color);
    box-shadow: none;
    border-right: 1px solid #e0e0e0;
    width: 230px;
}

.app-sidebar .app-sidebar__user-name,
.app-sidebar .app-menu__label,
.app-sidebar .treeview-menu .treeview-item,
.app-sidebar .app-menu__item {
    color: #fff;
}

.app-sidebar .app-menu__item.active {
    background-color: #000000;
}

.app-sidebar .app-menu__item:hover,
.app-sidebar .app-menu__item:focus {
    background-color: rgba(0, 0, 0, 0.7);
}

/* Stile per il menu Appuntamenti espanso */
.app-sidebar .treeview.is-expanded .treeview-menu {
    background-color: #1a1a1a;
    padding: 0;
}

/* Stile per i calendari nella sidebar */
.app-sidebar .treeview-menu .calendar-item {
    margin-bottom: 1px;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

.app-sidebar .treeview-menu .calendar-item:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

.app-sidebar .treeview-menu .calendar-item.active {
    border-left-color: var(--primary-color);
    background-color: #000000;
}

/* Stile per le voci secondarie attive */
.app-sidebar .treeview-menu .treeview-item.fw-bold {
    background-color: #000000;
    display: block;
    padding: 8px 15px 8px 30px;
    border-left: 3px solid var(--primary-color);
}

.app-sidebar .treeview-menu .treeview-item {
    display: block;
    padding: 8px 15px 8px 33px;
    border-left: 0 solid transparent;
}

.app-sidebar .treeview-menu .calendar-color {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.app-sidebar .treeview-menu .calendar-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
    font-size: 0.9rem;
}

/* Stile per i checkbox nella sidebar */
.app-sidebar .form-check-input {
    background-color: transparent;
    border-color: rgba(255, 255, 255, 0.5);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.app-sidebar .form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Stile per i toggle switch dei calendari */
.app-sidebar .form-switch .form-check-input {
    width: 2em;
    height: 1em;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba(255, 255, 255, 0.8)'/%3e%3c/svg%3e");
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    margin-top: 0.15em;
    position: relative;
}

.app-sidebar .form-switch .form-check-input:checked {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.app-sidebar .form-switch .form-check-input:focus {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba(255, 255, 255, 0.8)'/%3e%3c/svg%3e");
    box-shadow: 0 0 0 0.15rem rgba(255, 255, 255, 0.25);
}

/* Aggiunta di etichette ON/OFF per i toggle */
.app-sidebar .form-switch {
    position: relative;
    min-width: 2em;
}

/* Stile per i calendari disattivati */
.app-sidebar .calendar-disabled {
    opacity: 0.6;
    background-color: rgba(200, 200, 200, 0.1) !important;
    border-left-color: #888 !important;
}

/* Stile per i tipi di evento nella sidebar */
.app-sidebar .event-types-list,
.app-sidebar .service-tags-list,
.app-sidebar .event-tags-list {
    padding: 0;
    margin: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.app-sidebar .event-type-item,
.app-sidebar .service-tag-item,
.app-sidebar .event-tag-item {
    color: #fff;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    margin-bottom: 1px;
}

.app-sidebar .event-type-item:hover,
.app-sidebar .service-tag-item:hover,
.app-sidebar .event-tag-item:hover {
    filter: brightness(1.1);
}

.app-sidebar .event-type-name,
.app-sidebar .tag-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
    font-size: 0.85rem;
}

/* Stile per i checkbox nei tag */
.app-sidebar .event-type-item .form-check-input,
.app-sidebar .service-tag-item .form-check-input,
.app-sidebar .event-tag-item .form-check-input {
    width: 14px;
    height: 14px;
    margin-top: 2px;
}

/* Stile per le icone nella sidebar */
.app-sidebar .app-menu__icon {
    font-size: 1.1rem;
    width: 30px;
    text-align: center;
}

.app-sidebar .treeview-indicator {
    font-size: 0.8rem;
}

/* Modifica per rendere coerenti le frecce nella sidebar */
.app-sidebar .treeview-indicator {
    display: none;
}

.app-sidebar .treeview .app-menu__item::after {
    content: '\F282';
    font-family: bootstrap-icons !important;
    position: absolute;
    right: 15px;
    top: 12px;
    font-size: 0.8rem;
}

.app-sidebar .treeview.is-expanded .app-menu__item::after {
    content: '\F286';
}

/* Titoli e CTA */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    color: var(--primary-color);
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: #363d4d;
    border-color: #363d4d;
}

/* Colore accent */
.btn-danger {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.text-danger {
    color: var(--accent-color) !important;
}

/* Modifiche ai form e input */
.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label,
.form-floating > .form-select:focus ~ label,
.form-floating > .form-select:not([value=""]):valid ~ label {
    color: var(--primary-color);
}

.form-floating > .form-control:focus,
.form-floating > .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.15rem rgba(66, 74, 93, 0.15);
}

/* Modifiche ai link */
a {
    color: var(--primary-color);
}

a:hover {
    color: #363d4d;
}

/* Modifiche ai componenti del calendario */
.calendar-filters .btn-link:hover {
    color: var(--primary-color);
}

.fc-button-primary {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    font-family: var(--bs-font-sans-serif) !important;
    font-weight: 500 !important;
    letter-spacing: 0.01rem !important;
}

.fc-button-primary:hover {
    background-color: #363d4d !important;
    border-color: #363d4d !important;
}

.fc-event {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
    font-family: var(--bs-font-sans-serif);
    font-weight: 400;
}

.fc-day-today .fc-daygrid-day-number {
    background-color: var(--primary-color) !important;
}

.fc-col-header-cell-cushion,
.fc-daygrid-day-number,
.fc-daygrid-day-top {
    font-family: var(--bs-font-sans-serif);
}

.fc-col-header-cell-cushion {
    font-weight: 600;
    text-transform: uppercase;
}

.fc-daygrid-day-number {
    font-weight: 500;
}

.fc-event-title,
.fc-event-time {
    font-family: var(--bs-font-sans-serif);
    font-weight: 400;
    letter-spacing: 0.01rem;
}

/* Modifiche alle notifiche e badge */
.badge-primary {
    background-color: var(--primary-color);
}

.badge-danger {
    background-color: var(--accent-color);
}

/* Modifiche alle icone */
.app-sidebar .app-menu__icon {
    color: #fff;
}

/* Modifiche ai bordi e divisori */
.border-primary {
    border-color: var(--primary-color) !important;
}

.border-danger {
    border-color: var(--accent-color) !important;
}

/* Modifiche specifiche per la sezione schedule */
.schedule-container .card {
    border-color: rgba(66, 74, 93, 0.2);
    box-shadow: 0 2px 10px rgba(66, 74, 93, 0.1);
}

.schedule-container .card-header {
    background-color: rgba(66, 74, 93, 0.05);
    border-bottom-color: rgba(66, 74, 93, 0.1);
}

/* Modifiche ai pulsanti */
.btn {
    font-size: 0.85rem;
}

/* Modifiche ai pulsanti del calendario */
.btn-view.active {
    color: var(--primary-color) !important;
    background-color: rgba(66, 74, 93, 0.1) !important;
}

.btn-view::after {
    background-color: var(--primary-color) !important;
}

.btn-nav:hover {
    color: var(--primary-color) !important;
}

/* Modifiche agli eventi nel calendario */

/* Riduzione dimensione font per tabelle e card */
.table {
    font-size: 0.85rem;
    color: #333333; /* Colore più scuro per il testo nelle tabelle */
}

.card-title {
    font-size: 1.1rem;
}

.card-text, .card-body {
    font-size: 0.85rem;
}

/* Riduzione dimensione font per dropdown e menu */
.dropdown-menu {
    font-size: 0.85rem;
}

.dropdown-item {
    font-size: 0.85rem;
}

.nav-link {
    font-size: 0.85rem;
}
.fc-daygrid-event {
    border-left-color: var(--primary-color) !important;
}

.month-view-event {
    border-left-color: var(--primary-color) !important;
}

/* Modifiche ai tooltip e overlay */
.time-slot-tooltip {
    border-color: rgba(66, 74, 93, 0.2);
    box-shadow: 0 3px 8px rgba(66, 74, 93, 0.15);
}

/* Modifiche ai form degli eventi */
.event-type-container {
    border-left-color: var(--primary-color) !important;
}

.hidden-type-title {
    color: var(--primary-color) !important;
}

/* Modifiche ai colori degli slot disabilitati (mantenendo la funzionalità) */
:root {
    --slot-disabled-past: #d8d4d4;
    --slot-disabled-outside-hours: rgba(66, 74, 93, 0.1);
    --slot-disabled-exception: rgba(226, 0, 26, 0.1);
}

/* Applicazione del font Poppins */
body {
    font-family: var(--bs-font-sans-serif);
    font-weight: 400;
    letter-spacing: 0.01rem;
}

/* Layout principale */
.app-content {
    padding: 0;
    background-color: #E5E5E5;
    min-height: calc(100vh - 55px);
}

.row {
    margin-right: 0;
    margin-left: 0;
}

/* Miglioramento della leggibilità del testo nelle righe di dati */
.row.align-items-center > div,
.type-row > div,
#officineList .row > div,
#operatoriList .row > div,
#tagsList .row > div,
#typesList .row > div,
.row.fw-bold > div, /* Intestazioni delle colonne */
.tile-body .row > div, /* Tutte le celle nelle tabelle */
.app-content .form-group > label, /* Etichette dei form nella sezione admin */
.app-content .form-control-label /* Etichette dei form nella sezione admin */ {
    color: #333333; /* Colore più scuro per il testo nelle righe di dati */
    font-weight: 400; /* Peso del font per migliorare la leggibilità */
}

/* Assicuriamo che le intestazioni delle colonne siano in grassetto */
.row.fw-bold > div {
    font-weight: 700 !important;
}

.col-md-12 {
    padding: 0;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--bs-font-sans-serif);
    font-weight: 600;
    letter-spacing: -0.02rem;
}

.app-sidebar .app-menu__label {
    font-family: var(--bs-font-sans-serif);
    font-weight: 500;
}

.btn {
    font-family: var(--bs-font-sans-serif);
    font-weight: 500;
    letter-spacing: 0.02rem;
}

.form-control, .form-select {
    font-family: var(--bs-font-sans-serif);
    font-weight: 400;
}

.form-floating > label {
    font-family: var(--bs-font-sans-serif);
    font-weight: 400;
    color: #333333; /* Colore più scuro per le etichette */
}

.nav-link, .dropdown-item {
    font-family: var(--bs-font-sans-serif);
    font-weight: 500;
}

/* Miglioramenti generali UI/UX */
.app-header {
    background-color: #fff !important;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: none !important;
    height: 55px;
    display: flex;
    align-items: center;
    padding: 0;
}

/* Stile per i titoli delle sezioni */
.app-title {
    background-color: #e5e5e5;
    border-bottom: none;
    margin: 0;
    padding: 15px 30px;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: none;
}

.app-title > div {
    display: flex;
    flex-direction: column;
}

.app-title h1 {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
}

.app-title h1 i {
    margin-right: 10px;
    font-size: 1.5rem;
    color: #424A5D;
}

.app-title p {
    margin-bottom: 0;
    font-size: 1rem;
    color: #666;
    margin-top: 5px;
}

.app-breadcrumb {
    margin-bottom: 0;
    text-align: right;
    font-weight: 500;
    font-size: 0.9rem;
    text-transform: capitalize;
    padding: 0;
    background-color: transparent;
    display: flex;
    align-items: center;
}

.app-breadcrumb .breadcrumb-item {
    color: #666;
}

.app-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    content: "/";
    color: #aaa;
}

.app-breadcrumb .breadcrumb-item i {
    color: #424A5D;
}

.app-header__logo {
    background-color: #fff !important;
    color: #333;
    font-family: var(--bs-font-sans-serif);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 0;
    margin-left: 5px;
    height: 55px;
}

/* Stile per il logo dell'officina */
.app-header__logo img {
    max-height: 30px;
    max-width: 180px;
    object-fit: contain;
}

.app-header__logo:focus,
.app-header__logo:hover {
    color: var(--primary-color);
}

.app-sidebar__toggle {
    color: #333 !important;
    height: 55px;
    width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    font-size: 1.5rem;
    background-color: transparent !important;
    border: none !important;
    position: relative;
    margin-left: -10px;
}

.app-sidebar__toggle:before {
    content: none !important;
}

.app-sidebar__toggle .bi-list {
    font-size: 1.5rem;
}

.app-sidebar__toggle:focus,
.app-sidebar__toggle:hover {
    color: #333 !important;
    background-color: rgba(0, 0, 0, 0.05) !important;
}

.app-nav__item {
    color: var(--primary-color);
}

.app-nav__item:hover,
.app-nav__item:focus {
    background-color: rgba(66, 74, 93, 0.05);
}

.dropdown-menu {
    border-color: rgba(66, 74, 93, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: rgba(66, 74, 93, 0.05);
    color: var(--primary-color);
}

.card {
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: none;
    background-color: #fff;
}

.bg-white {
    background-color: #fff;
    border: none;
    margin: 0;
    padding: 0;
}

.card-header {
    background-color: rgba(66, 74, 93, 0.03);
    border-bottom: 1px solid rgba(66, 74, 93, 0.1);
}

.table thead th {
    border-bottom-color: rgba(66, 74, 93, 0.1);
    color: var(--primary-color);
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.page-link {
    color: var(--primary-color);
}

.page-link:hover {
    color: #363d4d;
}

/* Stili per i modali */
.modal-header {
    border-bottom-color: rgba(66, 74, 93, 0.1);
}

.modal-title {
    font-family: var(--bs-font-sans-serif);
    font-weight: 600;
    letter-spacing: -0.01rem;
}

.modal-body {
    font-family: var(--bs-font-sans-serif);
    font-weight: 400;
}

.modal-footer {
    border-top-color: rgba(66, 74, 93, 0.1);
}

.close {
    color: var(--primary-color);
    font-family: var(--bs-font-sans-serif);
}

/* Stili per le notifiche */
.toast-header {
    background-color: rgba(66, 74, 93, 0.05);
    border-bottom-color: rgba(66, 74, 93, 0.1);
}

/* Stili per i form */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.15rem rgba(66, 74, 93, 0.15);
}

/* Miglioramento della leggibilità delle etichette dei form */
label,
.form-label {
    color: #333333; /* Colore più scuro per le etichette */
    font-weight: 500; /* Peso del font per migliorare la leggibilità */
}

.custom-control-input:checked ~ .custom-control-label::before {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Stili per i bottoni */
.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-danger {
    color: var(--accent-color);
    border-color: var(--accent-color);
}

.btn-outline-danger:hover {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

/* Miglioramenti per gli stati vuoti e i messaggi di feedback */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.empty-state-icon {
    font-size: 3rem;
    color: #adb5bd;
    margin-bottom: 1rem;
}

.empty-state-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.empty-state-text {
    font-size: 0.9rem;
    max-width: 400px;
    margin: 0 auto;
}

/* Miglioramenti per i messaggi di feedback */
.feedback-message {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 20px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 4px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    z-index: 1050;
    transform: translateY(100px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.feedback-message.show {
    transform: translateY(0);
    opacity: 1;
}

.feedback-message.success {
    background-color: #28a745;
}

.feedback-message.error {
    background-color: var(--accent-color);
}

.feedback-message.warning {
    background-color: #ffc107;
    color: #212529;
}

/* Miglioramenti per gli spazi vuoti */
.spacer-xs {
    height: 0.5rem;
}

.spacer-sm {
    height: 1rem;
}

.spacer-md {
    height: 1.5rem;
}

.spacer-lg {
    height: 2.5rem;
}

/* Miglioramenti per i caricamenti */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(66, 74, 93, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Effetto ripple per i pulsanti */
.btn, .btn-view, .btn-nav {
    position: relative;
    overflow: hidden;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    transform: scale(0);
    animation: ripple-animation 0.6s linear;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Stili specifici per le modali */
.modal {
    z-index: 1050;
}

.modal-backdrop {
    z-index: 1040;
}

.modal-dialog {
    margin: 1.75rem auto;
    max-width: 600px;
}

.modal-content {
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border: none;
}

.modal-header {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    padding: 1rem 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    padding: 1rem 1.5rem;
}

.modal-title {
    font-weight: 600;
    font-size: 1.25rem;
}

.modal .close {
    color: var(--primary-color);
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.modal .close:hover {
    opacity: 1;
}

/* Stili per i form all'interno delle modali */
.modal .form-floating {
    margin-bottom: 1.25rem;
}

.modal .form-floating > .form-control,
.modal .form-floating > .form-select {
    height: calc(3.5rem + 2px);
    padding: 1rem 0.75rem;
    font-size: 1rem;
}

.modal .form-floating > label {
    padding: 1rem 0.75rem;
    font-size: 1rem;
    height: auto; /* Permette all'etichetta di espandersi */
}

.modal .form-floating > .form-control:focus ~ label,
.modal .form-floating > .form-control:not(:placeholder-shown) ~ label,
.modal .form-floating > .form-select ~ label {
    transform: scale(.85) translateY(-1.2rem) translateX(0.15rem);
    height: auto; /* Permette all'etichetta di espandersi */
    z-index: 1; /* Assicura che l'etichetta sia sopra il campo */
    background-color: white; /* Sfondo bianco per l'etichetta */
    padding: 0 0.5rem; /* Padding orizzontale per l'etichetta */
}

/* Stili per i pulsanti all'interno delle modali */
.modal .btn {
    padding: 0.5rem 1.5rem;
    font-weight: 500;
}

/* Stile per i toggle switch nei modal */
.modal .form-switch .form-check-input {
    background-color: #fff;
    border-color: #ccc;
}

.modal .form-switch .form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Stili per i tipi di evento all'interno delle modali */
.modal .event-type-container {
    background-color: #f8f9fa;
    border-left-color: var(--primary-color);
}

.modal .hidden-type-title {
    color: var(--primary-color);
}

/* Miglioramenti responsive design */
@media (max-width: 991.98px) {
    .app-content {
        padding: 20px;
    }

    .app-title {
        flex-direction: column;
        align-items: flex-start;
        padding: 15px;
    }

    .app-title > div {
        width: 100%;
    }

    .app-title .breadcrumb {
        margin-top: 10px;
        padding-left: 0;
        justify-content: flex-start;
    }

    .card {
        margin-bottom: 20px;
    }

    /* Miglioramenti per il calendario */
    .calendar-header .d-flex {
        flex-wrap: wrap;
    }

    .date-navigation {
        order: 1;
        margin: 0 auto;
        margin-bottom: 10px;
    }

    .btn-create {
        order: 0;
        margin-bottom: 10px;
    }

    .nav-links {
        order: 2;
        width: 100%;
        justify-content: center;
    }

    /* Miglioramenti per i modali */
    .modal-dialog {
        max-width: 90%;
    }

    /* Miglioramenti per i form */
    .row .form-floating {
        margin-bottom: 15px;
    }

    /* Miglioramenti per le tabelle */
    .table-responsive {
        border: 0;
    }

    /* Miglioramenti per i breakpoint intermedi */
    .col-md-6 {
        padding-left: 10px;
        padding-right: 10px;
    }
}

@media (max-width: 767.98px) {
    .app-content {
        padding: 15px;
    }

    .app-sidebar {
        width: 230px;
        transform: translateX(-230px);
        transition: transform 0.3s ease;
        z-index: 1050;
    }

    .sidenav-toggled .app-sidebar {
        transform: translateX(0);
        box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
    }

    .app-sidebar__overlay {
        z-index: 1040;
    }

    .app-header__logo {
        width: auto;
        flex: 1;
    }

    /* Miglioramenti per il calendario */
    .calendar-header {
        flex-direction: column;
        padding: 10px;
        margin-bottom: 15px;
    }

    .calendar-header .d-flex {
        flex-direction: column;
        width: 100%;
        align-items: center;
    }

    .btn-create {
        width: 100%;
        margin-bottom: 15px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .date-navigation {
        width: 100%;
        margin: 10px 0;
        justify-content: center;
    }

    .nav-links {
        width: 100%;
        flex-wrap: wrap;
        justify-content: center;
        margin-top: 15px;
        gap: 5px;
    }

    .btn-view {
        padding: 8px 12px;
        font-size: 0.85rem;
        flex: 0 0 auto;
        margin: 0 2px;
    }

    /* Miglioramenti per il calendario FullCalendar */
    .fc .fc-toolbar {
        flex-direction: column;
        gap: 10px;
    }

    .fc .fc-toolbar-title {
        font-size: 1.2rem !important;
        margin-bottom: 10px;
    }

    .fc .fc-button-group {
        margin-bottom: 10px;
    }

    .fc-header-toolbar {
        margin-bottom: 1em !important;
    }

    .fc-daygrid-day-number {
        font-size: 0.9rem;
        padding: 2px !important;
    }

    .fc-col-header-cell-cushion {
        font-size: 0.9rem;
        padding: 6px 2px !important;
    }

    /* Miglioramenti per i modali */
    .modal-dialog {
        margin: 10px;
        max-width: calc(100% - 20px);
    }

    .modal-content {
        border-radius: 10px;
    }

    .modal-body {
        padding: 15px;
    }

    /* Miglioramenti per i form */
    .form-floating {
        margin-bottom: 15px;
    }

    .form-floating > .form-control {
        height: 48px;
    }

    .form-floating > label {
        padding-top: 0.75rem;
    }

    /* Miglioramenti per le tabelle */
    .table th, .table td {
        padding: 0.5rem;
    }
}

@media (max-width: 575.98px) {
    .app-content {
        padding: 10px;
    }

    .app-title {
        margin: -10px -10px 10px;
        padding: 12px;
    }

    .app-title h1 {
        font-size: 1.3rem;
    }

    .app-title h1 i {
        font-size: 1.2rem;
        margin-right: 8px;
    }

    .app-title p {
        font-size: 0.8rem;
    }

    .app-breadcrumb {
        font-size: 0.7rem;
    }

    /* Miglioramenti per l'header */
    .app-header {
        height: 50px;
    }

    .app-header__logo {
        font-size: 1.2rem;
        padding: 0 10px;
    }

    .app-sidebar__toggle {
        padding: 0 10px;
    }

    /* Miglioramenti per il calendario */
    .calendar-header {
        padding: 8px;
        margin-bottom: 10px;
    }

    .nav-links {
        gap: 2px;
    }

    .btn-view {
        padding: 5px 6px;
        font-size: 0.7rem;
    }

    .btn-view i {
        margin-right: 2px;
        font-size: 0.9rem;
    }

    .btn-view span {
        display: none;
    }

    .date-range {
        font-size: 0.85rem;
        padding: 0 8px;
    }

    .btn-nav {
        padding: 6px 8px;
    }

    /* Miglioramenti per il layout */
    .row {
        margin-left: -5px;
        margin-right: -5px;
    }

    .col, .col-1, .col-2, .col-3, .col-4, .col-5, .col-6,
    .col-7, .col-8, .col-9, .col-10, .col-11, .col-12,
    .col-sm, .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4,
    .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9,
    .col-sm-10, .col-sm-11, .col-sm-12 {
        padding-left: 5px;
        padding-right: 5px;
    }

    /* Miglioramenti per i form */
    .form-floating > label {
        font-size: 0.8rem;
    }

    .form-floating > .form-control {
        font-size: 0.9rem;
    }

    .form-select {
        font-size: 0.9rem;
    }

    /* Miglioramenti per i modali */
    .modal-header {
        padding: 10px 15px;
    }

    .modal-title {
        font-size: 1.1rem;
    }

    .modal-body {
        padding: 12px;
    }

    .modal-footer {
        padding: 8px 12px;
    }

    .btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.875rem;
    }

    /* Miglioramenti per il calendario FullCalendar */
    .fc .fc-toolbar-title {
        font-size: 1rem !important;
    }

    .fc-daygrid-day-number {
        font-size: 0.8rem;
        padding: 1px !important;
    }

    .fc-col-header-cell-cushion {
        font-size: 0.8rem;
        padding: 4px 1px !important;
    }

    .month-view-event {
        font-size: 0.7rem;
        padding: 0 2px;
    }

    /* Miglioramenti per la visualizzazione degli eventi */
    .fc-daygrid-event {
        margin-top: 1px;
        margin-bottom: 1px;
    }

    .fc-daygrid-day-events {
        padding-top: 0 !important;
        padding-bottom: 2px !important;
    }

    .fc-daygrid-day-frame {
        min-height: 80px !important;
    }
}

/* Breakpoint aggiuntivo per dispositivi molto piccoli */
@media (max-width: 359.98px) {
    .app-content {
        padding: 5px;
    }

    .app-title {
        margin: -5px -5px 5px;
        padding: 10px;
    }

    .app-title h1 {
        font-size: 1.3rem;
    }

    .btn-view {
        padding: 4px;
        font-size: 0.65rem;
    }

    .btn-view i {
        margin-right: 0;
    }

    .date-range {
        font-size: 0.8rem;
        padding: 0 5px;
    }

    .btn-nav {
        padding: 4px 6px;
    }

    .fc-daygrid-day-frame {
        min-height: 60px !important;
    }
}

/* Miglioramenti per l'accessibilità */
:focus {
    outline: 2px solid var(--primary-color) !important;
    outline-offset: 2px !important;
}

.btn:focus,
.form-control:focus,
.form-select:focus {
    box-shadow: 0 0 0 0.2rem rgba(66, 74, 93, 0.25) !important;
}

/* Miglioramenti per l'accessibilità da tastiera */
.btn:focus-visible,
.nav-link:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible {
    outline: 3px solid var(--primary-color) !important;
    outline-offset: 2px !important;
    position: relative;
    z-index: 5;
}

/* Miglioramenti per l'accessibilità dei link */
a:focus {
    text-decoration: underline;
}

/* Miglioramenti per l'accessibilità dei pulsanti del calendario */
.btn-view:focus-visible,
.btn-nav:focus-visible {
    outline: 3px solid var(--primary-color) !important;
    outline-offset: 2px !important;
    position: relative;
    z-index: 5;
}

/* Miglioramenti per l'accessibilità degli eventi del calendario */
.fc-event:focus-visible {
    outline: 3px solid var(--primary-color) !important;
    outline-offset: 2px !important;
    position: relative;
    z-index: 5;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Aumenta il contrasto per migliorare la leggibilità */
.text-muted {
    color: #6c757d !important;
}

.form-text {
    color: #5a6268 !important;
}

/* Miglioramenti per le animazioni e transizioni */
.btn,
.nav-link,
.form-control,
.app-sidebar__toggle,
.app-header__logo {
    transition: all 0.2s ease-in-out;
}

.modal.fade .modal-dialog {
    transition: transform 0.2s ease-out;
}

.fc-event {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fc-event:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    z-index: 5;
}

/* Feedback visivo per le interazioni utente */
.btn:active,
.nav-link:active,
.app-sidebar__toggle:active {
    transform: scale(0.97);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(66, 74, 93, 0.15);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Effetto pulsazione per elementi attivi */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(66, 74, 93, 0.4);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(66, 74, 93, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(66, 74, 93, 0);
    }
}

.btn-primary:focus,
.btn-view.active {
    animation: pulse 1.5s infinite;
}

/* Disabilita l'animazione su dispositivi mobili per migliorare le prestazioni */
@media (max-width: 767.98px) {
    .btn-primary:focus,
    .btn-view.active {
        animation: none;
    }
}

/* Supporto per la modalità scura (rispetta le preferenze del sistema) */
@media (prefers-color-scheme: dark) {
    :root {
        --main-bg-color: #1a1a1a;
        --sidebar-text-color: #2a2a2a;
        --primary-color: #5d6b85;
        --accent-color: #ff3c54;
    }

    body {
        color: #e0e0e0;
    }

    .app-header {
        background-color: #2a2a2a;
        border-bottom-color: rgba(255, 255, 255, 0.1);
    }

    .app-header__logo {
        background-color: #2a2a2a;
        color: #e0e0e0;
    }

    .app-sidebar__toggle {
        color: #e0e0e0;
    }

    .app-sidebar {
        background-color: #2a2a2a;
    }

    .card {
        background-color: #2a2a2a;
        border-color: rgba(255, 255, 255, 0.1);
    }

    /* Manteniamo lo sfondo della modale chiaro per garantire la leggibilità */
    .modal-content {
        background-color: #fff;
        border-color: rgba(0, 0, 0, 0.2);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    }

    .card-header {
        background-color: #333;
        border-color: rgba(255, 255, 255, 0.1);
    }

    /* Manteniamo l'header e il footer della modale con colori chiari */
    .modal-header {
        background-color: #f8f9fa;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        color: #333;
    }

    .modal-footer {
        background-color: #f8f9fa;
        border-top: 1px solid rgba(0, 0, 0, 0.1);
    }

    /* Manteniamo i form control nella modale con colori chiari */
    .modal .form-control,
    .modal .form-select {
        background-color: #fff;
        border-color: rgba(0, 0, 0, 0.2);
        color: #333;
    }

    /* Stile per i form control al di fuori delle modali */
    .card .form-control,
    .card .form-select,
    .app-content > .form-control,
    .app-content > .form-select {
        background-color: #333;
        border-color: rgba(255, 255, 255, 0.2);
        color: #e0e0e0;
    }

    /* Stile per le label al di fuori delle modali */
    .card .form-floating > label,
    .app-content > .form-floating > label {
        color: #aaa;
    }

    /* Manteniamo le label nelle modali con colori chiari */
    .modal .form-floating > label {
        color: #6c757d;
    }

    /* Stile per le label quando il campo è attivo o ha contenuto */
    .modal .form-floating > .form-control:focus ~ label,
    .modal .form-floating > .form-control:not(:placeholder-shown) ~ label,
    .modal .form-floating > .form-select ~ label {
        color: var(--primary-color);
    }

    /* Stile per i titoli nelle modali */
    .modal-title {
        color: var(--primary-color);
    }

    /* Stile per il testo nelle modali */
    .modal-body {
        color: #333;
    }

    .table {
        color: #e0e0e0;
    }

    .table thead th {
        border-bottom-color: rgba(255, 255, 255, 0.1);
    }

    .table td, .table th {
        border-color: rgba(255, 255, 255, 0.1);
    }

    .fc-theme-standard .fc-scrollgrid,
    .fc-theme-standard td,
    .fc-theme-standard th {
        border-color: rgba(255, 255, 255, 0.1);
    }

    .fc-day-today {
        background-color: rgba(93, 107, 133, 0.2) !important;
    }

    .fc-col-header-cell {
        background-color: #333;
    }

    .fc-col-header-cell-cushion {
        color: #e0e0e0;
    }

    .fc-daygrid-day-number {
        color: #e0e0e0;
    }

    .btn-view {
        color: #aaa;
    }

    .btn-view:hover {
        color: #e0e0e0;
        background-color: rgba(255, 255, 255, 0.1);
    }

    .btn-view.active {
        color: #5d6b85;
        background-color: rgba(93, 107, 133, 0.2);
    }
}
