:root {
  --sidebar-width: 250px;
  --header-height: 60px;
}

body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial,
    sans-serif;
  background-color: #f4f7fa !important;
  color: #333;
  margin: 0;
  overflow-x: hidden;
}

.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  position: fixed;
  display: flex;
  flex-direction: column;
  top: 0;
  left: 0;
  background-color: #212529;
  color: #fff;
  transition: all 0.3s;
  z-index: 1000;
}

.sidebar-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 20px;
  background-color: #1a1e21;
  font-weight: bold;
  font-size: 1.2rem;
}

.sidebar-menu {
  padding: 20px 0;
  flex: 1 1 auto;
  overflow: auto;
}

.sidebar-link {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  border-left: 4px solid transparent;
  transition: all 0.2s;
}

.sidebar-link:hover,
.sidebar-link.active {
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-left-color: #0d6efd;
}

.sidebar-link i {
  width: 25px;
  text-align: center;
  margin-right: 10px;
}

.sidebar-link-with-children {
  margin-bottom: 4px;
}

.sidebar-link-with-children > .sidebar-link {
  font-size: 0.95rem;
  padding-right: 16px;
  background-color: transparent;
  border: 0;
}

.sidebar-link-with-children > .sidebar-link:hover {
  background-color: transparent;
}

.sidebar-link-with-children > .sidebar-link .fa-chevron-down {
  margin-left: 8px;
  font-size: 0.7rem;
  opacity: 0.7;
  transition: transform 0.2s ease;
}

.sidebar-link-with-children
  > .sidebar-link[aria-expanded="true"]
  .fa-chevron-down {
  transform: rotate(180deg);
}

.sidebar-sublink {
  display: flex;
  align-items: center;
  padding: 6px 20px 6px 44px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    padding-left 0.15s ease,
    border-color 0.15s ease;
}

.sidebar-sublink i {
  width: 18px;
  text-align: center;
  margin-right: 8px;
  font-size: 0.85rem;
}

.sidebar-sublink:hover,
.sidebar-sublink.active {
  background-color: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-left-color: #0d6efd;
  padding-left: 48px;
}

.main-wrapper {
  margin-left: var(--sidebar-width);
  transition: all 0.3s;
  background-color: transparent;
}

.top-header {
  height: var(--header-height);
  background-color: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 999;
}

.content-container {
  padding: 1.5rem 2rem;
}

@media (max-width: 768px) {
  .sidebar {
    margin-left: calc(var(--sidebar-width) * -1);
  }

  .sidebar.active {
    margin-left: 0;
  }

  .main-wrapper {
    margin-left: 0;
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
  }

  .sidebar-overlay.active {
    display: block;
  }
}

.page-header-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.card.shadow-sm {
  box-shadow:
    0 0.125rem 0.25rem rgba(0, 0, 0, 0.075),
    0 0.5rem 1rem rgba(0, 0, 0, 0.05) !important;
  border-radius: 12px;
}

.dashboard-card {
  border-radius: 1rem;
  border: 1px solid rgba(0, 0, 0, 0.05) !important;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
  background-color: #ffffff;
}

.dashboard-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1) !important;
}

.dashboard-card.card-aziende {
  border-left: 5px solid #0d6efd !important;
}

.dashboard-card.card-personale {
  border-left: 5px solid #198754 !important;
}

.dashboard-card.card-utenti {
  border-left: 5px solid #fd7e14 !important;
}

.dashboard-card.card-filiali {
  border-left: 5px solid #6c757d !important;
}

.icon-wrapper {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== Calendario promemoria (FullCalendar) ===== */

.calendar-container {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 16px 18px;
  min-height: 600px;
}

#calendar .fc-toolbar {
  margin-bottom: 1.5rem;
  gap: 0.75rem;
}

#calendar .fc-toolbar-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #0f172a;
}

#calendar .fc-button {
  border-radius: 999px;
  padding-inline: 0.9rem;
  padding-block: 0.35rem;
  font-size: 0.85rem;
  border: 1px solid #d0d7e2;
  background-color: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

#calendar .fc-button-group {
  gap: 0.35rem;
  border: 0;
}

#calendar .fc-button-group .fc-button {
  border-radius: 999px !important;
}

#calendar .fc-button.fc-button-primary {
  background: linear-gradient(135deg, #0d6efd, #4f46e5);
  border-color: transparent;
  color: #ffffff;
}

#calendar .fc-button:hover {
  filter: brightness(1.03);
}

#calendar .fc-button.fc-button-primary.fc-button-active {
  filter: brightness(0.95);
}

#calendar .fc-daygrid-day-frame,
#calendar .fc-timegrid-slot {
  transition: background-color 0.15s ease;
}

#calendar .fc-daygrid-day:hover .fc-daygrid-day-frame {
  background-color: #f8fafc;
}

#calendar .fc-daygrid-day-number {
  font-weight: 500;
  color: #475569;
}

#calendar .fc-day-today {
  background-color: rgba(13, 110, 253, 0.08) !important;
}

#calendar .fc-day-today .fc-daygrid-day-number {
  color: #0d6efd;
  font-weight: 700;
}

#calendar .fc-day-sat,
#calendar .fc-day-sun {
  background-color: #f9fafb;
}

#calendar .fc-event {
  border-radius: 999px;
  border: none;
  padding-inline: 0.45rem;
  padding-block: 0.15rem;
  font-size: 0.78rem;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.15);
}

#calendar .fc-event.fc-event-start {
  margin-left: 2px;
}

#calendar .fc-event.fc-event-end {
  margin-right: 2px;
}

#calendar .fc-timegrid-slot-label {
  color: #94a3b8;
  font-size: 0.75rem;
}

#calendar .fc-timegrid-slot {
  border-color: #e2e8f0;
}

#calendar .fc-scrollgrid {
  border-radius: 12px;
  overflow: hidden;
}

#calendar .fc-timegrid-now-indicator-line {
  border-color: #ef4444;
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.2);
}

#calendar .fc-timegrid-now-indicator-arrow {
  border-top-color: #ef4444;
}

@media (max-width: 992px) {
  .calendar-container {
    padding: 12px 12px;
    min-height: 480px;
  }

  #calendar .fc-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  #calendar .fc-toolbar-chunk {
    width: 100%;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  #calendar .fc-toolbar-title {
    font-size: 1.1rem;
  }
}

@media (max-width: 576px) {
  .calendar-container {
    padding: 10px;
  }

  #calendar .fc-button {
    font-size: 0.78rem;
    padding-inline: 0.7rem;
  }
}

.login-page {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0d6efd 0%, #6610f2 100%);
}

.login-card {
  background: white;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  width: 100%;
  max-width: 400px;
}

.login-header {
  background: #f8f9fa;
  padding: 30px 30px 20px;
  text-align: center;
  border-bottom: 1px solid #eee;
}

.login-body {
  padding: 30px;
}
