/* =========================================================
   SBMS LAYOUT THEME
   Variabili base del layout applicativo
========================================================= */

:root {
  --layout-sidebar-width: 310px;
  --layout-sidebar-collapsed-width: 86px;
  --layout-sidebar-toggle-size: 38px;
  --layout-sidebar-transition: 0.24s ease;
  --layout-header-height: 86px;
  --layout-gap: 0;
  --layout-shell-padding: 0;
  --layout-main-padding: 24px;
  --layout-panel-radius: 0;
}

/* =========================================================
   STRUTTURA MASTER LAYOUT
========================================================= */

html,
body {
  height: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  overflow-x: hidden;
  transition:
    background 0.28s ease,
    color 0.28s ease;
}

#page-wrapper.layout-shell {
  min-height: 100vh;
  box-sizing: border-box;
  padding: var(--layout-shell-padding);
  display: grid;
  grid-template-columns: var(--layout-sidebar-width) minmax(0, 1fr);
  grid-template-rows: var(--layout-header-height) minmax(0, 1fr);
  grid-template-areas:
    "header header"
    "sidebar main";
  gap: var(--layout-gap);
  transition:
    grid-template-columns var(--layout-sidebar-transition),
    background 0.28s ease;
}

/* =========================================================
   AREE PRINCIPALI
========================================================= */

.layout-sidebar,
.layout-header,
.layout-main {
  min-width: 0;
  min-height: 0;
  width: 100%;
}

.layout-sidebar {
  grid-area: sidebar;
  overflow: hidden;
  display: flex;
}

.layout-header {
  grid-area: header;
  overflow: visible;
  display: flex;
  position: relative;
  z-index: 100;
}

.layout-main {
  grid-area: main;
  padding: var(--layout-main-padding);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition:
    background 0.28s ease,
    color 0.28s ease;
}

/* =========================================================
   RESET TEMPLATE LIGHT BLUE
   Normalizza sidebar, navbar e content del template legacy
========================================================= */

.layout-sidebar #sidebar {
  position: relative !important;
  inset: auto !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  margin: 0 !important;
  display: flex;
  flex-direction: column;
  transition:
    background 0.28s ease,
    color 0.28s ease,
    box-shadow 0.28s ease;
}

.layout-header .layout-navbar,
.layout-header .page-controls.navbar.navbar-dashboard.layout-navbar {
  position: relative !important;
  inset: auto !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  margin: 0 !important;
  border-radius: var(--layout-panel-radius);
  display: flex;
  align-items: center;
  overflow: visible !important;
  z-index: 150;
  transition:
    background 0.28s ease,
    color 0.28s ease,
    box-shadow 0.28s ease;
}

.layout-header .layout-navbar > .container-fluid,
.layout-header .page-controls .container-fluid {
  width: 100%;
  height: 100%;
  padding: 0 32px 0 0 !important;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  overflow: visible;
}

/* -------------------------
   Continuità sfondo layout
   Header e sidebar restano trasparenti sullo sfondo del tema:
   evita bande o rettangoli staccati da main, dark, light e mobile.
------------------------- */

.layout-header .page-controls.navbar.navbar-dashboard.layout-navbar,
.layout-sidebar #sidebar {
  background: transparent !important;
  color: inherit;
}

.layout-main .content-wrap,
.layout-main .content {
  position: static !important;
  inset: auto !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box;
  background: transparent !important;
  transition:
    background 0.28s ease,
    color 0.28s ease;
}

.layout-main .content {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  overflow: visible;
}

/* =========================================================
   SIDEBAR
   Menu laterale principale e sottomenu
========================================================= */

.layout-sidebar #sidebar .js-sidebar-content {
  height: 100%;
  box-sizing: border-box;
  padding: 28px 18px 18px;
  display: flex;
  flex-direction: column;
}

.layout-sidebar #sidebar .sidebar-nav-title {
  display: none;
}

/* -------------------------
   Menu principale
------------------------- */

.layout-menu {
  list-style: none;
  margin: 0;
  padding: 12px 0 0;
  flex: 1 1 auto;
}

.layout-menu-item {
  margin-bottom: 10px;
}

.layout-menu-link {
  min-height: 56px;
  padding: 0 18px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  color: inherit;
  text-decoration: none;
  transition:
    background 0.28s ease,
    color 0.28s ease,
    box-shadow 0.28s ease,
    transform 0.2s ease-in-out;
}

.layout-menu-link:hover,
.layout-menu-link:focus {
  text-decoration: none;
  background: rgba(255, 255, 255, 0.05);
  color: #60a5fa;
  transform: translateX(2px);
}

.layout-menu-item.active > .layout-menu-link {
  background: rgba(255, 255, 255, 0.07);
  color: #60a5fa;
}

.layout-menu-item.has-submenu > .layout-menu-link {
  justify-content: flex-start;
}

/* -------------------------
   Icone / testo / freccia
------------------------- */

.layout-menu-icon {
  width: 28px;
  min-width: 28px;
  margin-right: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.layout-menu-icon i {
  font-size: 24px;
}

.layout-menu-text {
  flex: 1 1 auto;
  line-height: 1.2;
}

.layout-menu-arrow {
  margin-left: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: rotate(-90deg);
  transform-origin: center;
  transition:
    transform 0.2s ease-in-out,
    color 0.28s ease;
}

.layout-menu-item.open > .layout-menu-link .layout-menu-arrow {
  transform: rotate(0deg);
}

/* -------------------------
   Sottomenu
------------------------- */

.layout-submenu {
  list-style: none;
  margin: 6px 0 10px;
  padding: 8px 0 0 36px;
  display: none;
}

.layout-menu-item.open > .layout-submenu {
  display: block;
}

.layout-submenu-item {
  margin-bottom: 6px;
}

.layout-submenu-link {
  padding: 9px 14px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  opacity: 0.92;
  text-decoration: none;
  transition:
    background 0.28s ease,
    color 0.28s ease,
    box-shadow 0.28s ease,
    opacity 0.2s ease-in-out;
}

.layout-submenu-link:hover,
.layout-submenu-link:focus {
  text-decoration: none;
  background: rgba(255, 255, 255, 0.05);
  color: #60a5fa;
  opacity: 1;
}

.layout-submenu-item.active > .layout-submenu-link {
  background: rgba(255, 255, 255, 0.08);
  color: #60a5fa;
  opacity: 1;
  font-weight: 600;
}

.layout-submenu-icon {
  width: 20px;
  min-width: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.layout-submenu-icon i {
  font-size: 18px;
}

.layout-submenu-text {
  line-height: 1.2;
}

/* -------------------------
   Normalizzazione icone legacy
------------------------- */

.layout-menu-link .mdi,
.layout-menu-link .ti,
.layout-menu-link .fa,
.layout-submenu-link .mdi,
.layout-submenu-link .ti,
.layout-submenu-link .fa {
  display: inline-block;
  line-height: 1;
  vertical-align: middle;
}

/* =========================================================
   SIDEBAR COLLASSABILE
   Riduzione desktop a icone e normalizzazione sottomenu
========================================================= */

#page-wrapper.layout-shell,
.layout-navbar .layout-navbar-inner,
.layout-navbar-left,
.layout-sidebar #sidebar,
.layout-sidebar #sidebar .js-sidebar-content,
.layout-menu-link,
.layout-submenu-link,
.layout-navbar-brand,
.layout-navbar-brand-logo {
  transition:
    grid-template-columns var(--layout-sidebar-transition),
    width var(--layout-sidebar-transition),
    min-width var(--layout-sidebar-transition),
    max-width var(--layout-sidebar-transition),
    flex-basis var(--layout-sidebar-transition),
    padding var(--layout-sidebar-transition),
    opacity var(--layout-sidebar-transition),
    background var(--layout-sidebar-transition),
    color var(--layout-sidebar-transition),
    transform var(--layout-sidebar-transition);
}

#sidebar .tm-sidebar-main-toggle {
  display: none !important;
}

@media (min-width: 992px) {
  body.sidebar-collapsed #page-wrapper.layout-shell {
    grid-template-columns: var(--layout-sidebar-collapsed-width) minmax(0, 1fr) !important;
  }

  body.sidebar-collapsed .layout-navbar .layout-navbar-inner {
    grid-template-columns: var(--layout-sidebar-collapsed-width) minmax(0, 1fr) !important;
  }

  body.sidebar-collapsed .layout-navbar-left {
    flex: 0 0 var(--layout-sidebar-collapsed-width) !important;
    max-width: var(--layout-sidebar-collapsed-width) !important;
    min-width: var(--layout-sidebar-collapsed-width) !important;
    padding: 0 10px !important;
    justify-content: center;
  }

  body.sidebar-collapsed .layout-navbar-brand {
    display: none !important;
  }

  body.sidebar-collapsed .layout-sidebar #sidebar .js-sidebar-content {
    padding: 20px 12px 18px !important;
  }

  body.sidebar-collapsed #sidebar .layout-submenu,
  body.sidebar-collapsed #sidebar .layout-menu-arrow,
  body.sidebar-collapsed #sidebar .layout-menu-text,
  body.sidebar-collapsed #sidebar .layout-submenu-text,
  body.sidebar-collapsed #sidebar .layout-submenu-icon,
  body.sidebar-collapsed #sidebar .menu-text,
  body.sidebar-collapsed #sidebar .menu-label,
  body.sidebar-collapsed #sidebar .nav-text,
  body.sidebar-collapsed #sidebar .nav-label {
    display: none !important;
  }

  body.sidebar-collapsed #sidebar .layout-menu {
    padding-top: 0 !important;
  }

  body.sidebar-collapsed #sidebar .layout-menu-item {
    margin-bottom: 12px !important;
  }

  body.sidebar-collapsed #sidebar .layout-menu-link {
    min-height: 54px !important;
    width: 54px !important;
    padding: 0 !important;
    margin: 0 auto !important;
    border-radius: 18px !important;
    justify-content: center !important;
    text-align: center !important;
  }

  body.sidebar-collapsed #sidebar .layout-menu-icon {
    width: auto !important;
    min-width: 0 !important;
    margin: 0 !important;
  }

  body.sidebar-collapsed #sidebar .layout-menu-icon i {
    font-size: 24px !important;
  }
}

/* =========================================================
   HEADER / NAVBAR
   Struttura interna navbar, brand, azioni utente
========================================================= */

.layout-navbar .layout-navbar-inner {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: var(--layout-sidebar-width) minmax(0, 1fr);
  align-items: center;
}

/* -------------------------
   Colonne navbar
------------------------- */

.layout-navbar-left {
  flex: 0 0 var(--layout-sidebar-width);
  max-width: var(--layout-sidebar-width);
  min-width: var(--layout-sidebar-width);
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.layout-navbar-center {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.layout-navbar-right {
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* -------------------------
   Brand / logo
------------------------- */

.layout-navbar-brand {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-decoration: none !important;
}

.layout-navbar-brand:hover,
.layout-navbar-brand:focus {
  text-decoration: none;
}

.layout-navbar-brand-logo {
  width: auto;
  max-width: 260px;
  height: 58px;
  display: block;
  object-fit: contain;
}

.layout-navbar-title {
  font-weight: 700;
  letter-spacing: 0.04em;
}

.layout-navbar-toggle {
  margin-right: 14px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 26px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* -------------------------
   Hamburger sidebar in navbar
------------------------- */

.layout-navbar-sidebar-toggle {
  flex: 0 0 var(--layout-sidebar-toggle-size);
  width: var(--layout-sidebar-toggle-size);
  height: var(--layout-sidebar-toggle-size);
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 250;
  outline: none !important;
}

.layout-navbar-sidebar-toggle:hover,
.layout-navbar-sidebar-toggle:focus {
  background: rgba(255, 255, 255, 0.12);
}

.layout-navbar-sidebar-toggle span {
  position: absolute;
  width: 22px;
  height: 2.5px;
  border-radius: 999px;
  background: #b8c4e6;
  transition:
    transform var(--layout-sidebar-transition),
    opacity var(--layout-sidebar-transition),
    width var(--layout-sidebar-transition),
    background var(--layout-sidebar-transition);
}

/* Stato aperto = X */
.layout-navbar-sidebar-toggle span:nth-child(1) {
  transform: rotate(45deg);
}

.layout-navbar-sidebar-toggle span:nth-child(2) {
  opacity: 0;
}

.layout-navbar-sidebar-toggle span:nth-child(3) {
  transform: rotate(-45deg);
}

/* Stato chiuso = hamburger */
body.sidebar-collapsed .layout-navbar-sidebar-toggle span:nth-child(1),
body:not(.sidebar-mobile-open) .layout-navbar-sidebar-toggle.is-mobile-closed span:nth-child(1) {
  transform: translateY(-7px);
}

body.sidebar-collapsed .layout-navbar-sidebar-toggle span:nth-child(2),
body:not(.sidebar-mobile-open) .layout-navbar-sidebar-toggle.is-mobile-closed span:nth-child(2) {
  opacity: 1;
  transform: translateY(0);
}

body.sidebar-collapsed .layout-navbar-sidebar-toggle span:nth-child(3),
body:not(.sidebar-mobile-open) .layout-navbar-sidebar-toggle.is-mobile-closed span:nth-child(3) {
  transform: translateY(7px);
}


/* -------------------------
   Reset navbar Bootstrap legacy
------------------------- */

.layout-header .navbar-brand {
  margin-right: 0 !important;
}

.layout-header .nav.navbar-nav {
  margin-bottom: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
}

.layout-header .nav-link {
  padding-top: 0;
  padding-bottom: 0;
}

.layout-header .dropdown-menu {
  z-index: 2000;
}

/* -------------------------
   Utente navbar
------------------------- */

.layout-navbar-user {
  min-height: 64px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 0;
  border: 0 !important;
  outline: none !important;
  background: transparent !important;
  box-shadow: none !important;
  text-decoration: none !important;
  transition: color 0.28s ease;
}

.layout-navbar-user:hover,
.layout-navbar-user:focus,
.layout-navbar-user:active {
  border: 0 !important;
  outline: none !important;
  background: transparent !important;
  box-shadow: none !important;
  text-decoration: none !important;
}

.layout-navbar-user *,
.layout-navbar-user:hover *,
.layout-navbar-user:focus *,
.layout-navbar-user:active * {
  text-decoration: none !important;
}

.layout-navbar-user.dropdown-toggle::after {
  display: none !important;
}

.layout-navbar-account {
  min-width: 0;
  height: 100%;
  display: inline-flex;
  align-items: center;
}

.layout-navbar-user-avatar-wrap {
  width: 42px;
  height: 42px;
  min-width: 42px;
  flex: 0 0 42px;
  margin-right: 10px;
  border-radius: 50%;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-bottom: 0 !important;
  box-shadow: none !important;
  text-decoration: none !important;
}

.layout-navbar-user-avatar {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border-bottom: 0 !important;
  box-shadow: none !important;
  text-decoration: none !important;
  transition:
    opacity 0.28s ease,
    filter 0.28s ease,
    transform 0.28s ease;
}

.layout-navbar-user-avatar-generated {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #7c5cff 0%, #4f7cff 100%);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border-bottom: 0 !important;
  box-shadow: 0 6px 16px rgba(79, 124, 255, 0.22);
  text-decoration: none !important;
}

.layout-navbar-user-avatar-generated:hover {
  border-bottom: 0 !important;
  box-shadow: 0 6px 16px rgba(79, 124, 255, 0.22);
  text-decoration: none !important;
}

.layout-navbar-user-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
  border-radius: 50%;
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.18),
    0 4px 10px rgba(0, 0, 0, 0.16);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

.layout-navbar-user-name {
  max-width: 220px;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  color: #ffffff !important;
  line-height: 1;
  white-space: nowrap;
  text-overflow: ellipsis;
  border-bottom: 0 !important;
  box-shadow: none !important;
  text-decoration: none !important;
  transition: color 0.28s ease;
}

.layout-navbar-user-name:hover {
  border-bottom: 0 !important;
  box-shadow: none !important;
  text-decoration: none !important;
}

/* =========================================================
   MAIN CONTENT
   Regole base area contenuto
========================================================= */

.layout-main > .breadcrumb:first-child,
.layout-main .content > .breadcrumb:first-child {
  margin-top: 0;
}

.layout-main .page-title {
  margin-top: 0;
  transition: color 0.28s ease;
}

.widget {
  transition:
    background 0.28s ease,
    color 0.28s ease,
    box-shadow 0.28s ease,
    border-color 0.28s ease;
}

/* =========================================================
   FOOTER
   Footer interno al main layout
========================================================= */

footer.content-footer.app-footer,
footer.content-footer.layout-footer,
.layout-main footer.content-footer {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  margin-top: auto !important;
  padding: 18px 0 0 !important;
  box-sizing: border-box;
  position: static !important;
  inset: auto !important;
  flex: 0 0 auto;
  background: transparent !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  transition:
    border-color 0.28s ease,
    background 0.28s ease,
    color 0.28s ease;
}

.layout-footer-inner {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  box-sizing: border-box;
}

.layout-footer-main {
  min-width: 0;
  transition: color 0.28s ease;
}

.layout-footer-version {
  padding-right: 8px;
  text-align: right;
  white-space: nowrap;
  transition: color 0.28s ease;
}

.layout-footer-powered {
  margin-top: 4px;
  display: inline-block;
  font-size: 10px;
}

.layout-main footer.content-footer a {
  text-decoration: none;
}

.layout-main footer.content-footer a:hover {
  text-decoration: underline;
}

/* =========================================================
   NAVBAR ACTIONS / SETTINGS
   Icone azione, separatore e pannello cambio tema
========================================================= */

.layout-navbar-actions {
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
}

.layout-navbar-divider {
  width: 1px;
  height: 28px;
  display: inline-block;
  background: rgba(255, 255, 255, 0.25);
  transition: background 0.28s ease;
}

.layout-navbar-icon-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.layout-navbar-icon-button {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  transition:
    transform 0.18s ease,
    opacity 0.22s ease;
}

.layout-navbar-icon-button:hover {
  transform: translateY(-1px);
  opacity: 0.88;
}

.layout-navbar-icon-image {
  width: 24px;
  height: 24px;
  display: block;
  object-fit: contain;
}

.layout-navbar-notifications {
  position: relative;
}

.layout-navbar-notifications-badge {
  position: absolute;
  top: -8px;
  right: -10px;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e53935;
  border: 2px solid rgba(25, 31, 57, 0.96);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.2px;
  box-shadow: 0 6px 14px rgba(229, 57, 53, 0.28);
  pointer-events: none;
  transition:
    background 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    color 0.22s ease;
}

.layout-navbar-notifications-badge.is-hidden {
  display: none;
}


/* -------------------------
   Dropdown notifiche navbar
------------------------- */

.layout-navbar-notifications-menu {
  position: relative;
}

.layout-navbar-notifications-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: -8px;
  width: min(340px, calc(100vw - 20px));
  padding: 0;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(25, 31, 57, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 18px 42px rgba(7, 12, 24, 0.3);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  color: #ffffff;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(10px) scale(0.97);
  transform-origin: top right;
  transition:
    opacity 0.22s ease,
    visibility 0.22s ease,
    transform 0.22s ease,
    background 0.28s ease,
    border-color 0.28s ease,
    box-shadow 0.28s ease;
  z-index: 2200;
}

.layout-navbar-notifications-menu.is-open .layout-navbar-notifications-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.layout-navbar-notifications-panel::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 18px;
  width: 12px;
  height: 12px;
  background: inherit;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  transform: rotate(45deg);
}

.layout-navbar-notifications-header {
  position: relative;
  z-index: 1;
  padding: 14px 16px 13px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.layout-navbar-notifications-title-wrap {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.layout-navbar-notifications-title-icon {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(79, 124, 255, 0.2), rgba(124, 58, 237, 0.14));
  color: #9bb8ff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.layout-navbar-notifications-title-icon i {
  font-size: 19px;
  line-height: 1;
}

.layout-navbar-notifications-title {
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.layout-navbar-notifications-subtitle {
  margin-top: 3px;
  color: rgba(224, 231, 255, 0.66);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
}

.layout-navbar-notifications-count {
  flex: 0 0 auto;
  margin-top: 2px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(79, 124, 255, 0.18);
  color: #bcd0ff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  border: 1px solid rgba(79, 124, 255, 0.24);
}

.layout-navbar-notifications-count.is-hidden {
  display: none;
}

.layout-navbar-notifications-body {
  position: relative;
  z-index: 1;
  max-height: 285px;
  overflow-y: auto;
  overflow-x: hidden;
}

.layout-navbar-notifications-body::-webkit-scrollbar {
  width: 6px;
}

.layout-navbar-notifications-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
}

.layout-navbar-notifications-list {
  padding: 6px;
}

.layout-navbar-notification-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 14px;
  text-decoration: none !important;
  color: inherit;
  transition:
    background 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.layout-navbar-notification-item:hover,
.layout-navbar-notification-item:focus {
  background: rgba(255, 255, 255, 0.07);
  transform: translateY(-1px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  text-decoration: none !important;
  color: inherit;
}

.layout-navbar-notification-icon {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(79, 124, 255, 0.16);
  color: #9bb8ff;
  box-shadow: inset 0 0 0 1px rgba(79, 124, 255, 0.18);
}

.layout-navbar-notification-icon i {
  font-size: 16px;
  line-height: 1;
}

.layout-navbar-notification-copy {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.layout-navbar-notification-title {
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.layout-navbar-notification-text {
  color: rgba(224, 231, 255, 0.72);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.layout-navbar-notification-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: rgba(224, 231, 255, 0.54);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.3;
}

.layout-navbar-notification-meta span:first-child,
.layout-navbar-notification-meta span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layout-navbar-notifications-empty {
  padding: 20px 22px 22px;
  text-align: center;
  color: #9bb8ff;
}

.layout-navbar-notifications-empty-svg {
  width: 112px;
  max-width: 72%;
  height: auto;
  margin: 0 auto 10px;
  display: block;
  color: #8fb0ff;
  animation: layoutNavbarNotificationFloat 5.5s ease-in-out infinite;
}

.layout-navbar-notifications-empty-title {
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
}

.layout-navbar-notifications-empty-text {
  max-width: 220px;
  margin: 6px auto 0;
  color: rgba(224, 231, 255, 0.66);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.45;
}

.layout-navbar-notifications-footer {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 16, 30, 0.18);
}

.layout-navbar-notifications-footer-btn {
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(224, 231, 255, 0.78) !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none !important;
  cursor: pointer;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    opacity 0.18s ease;
}

.layout-navbar-notifications-footer-btn + .layout-navbar-notifications-footer-btn {
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.layout-navbar-notifications-footer-btn i {
  font-size: 16px;
  line-height: 1;
}

.layout-navbar-notifications-footer-btn:hover,
.layout-navbar-notifications-footer-btn:focus {
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff !important;
  text-decoration: none !important;
}

.layout-navbar-notifications-footer-btn-read {
  color: #c5b7ff !important;
}

.layout-navbar-notifications-footer-btn-read.is-disabled,
.layout-navbar-notifications-footer-btn-read:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.layout-navbar-notifications-footer-btn-read.is-disabled:hover,
.layout-navbar-notifications-footer-btn-read:disabled:hover {
  background: transparent;
  color: #c5b7ff !important;
}

@keyframes layoutNavbarNotificationFloat {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-7px);
  }
}

/* -------------------------
   Pannello impostazioni tema
------------------------- */

.layout-navbar-settings-panel {
  position: absolute;
  top: calc(100% + 16px);
  left: 50%;
  min-width: 176px;
  padding: 14px 14px 12px;
  border-radius: 14px;
  background: rgba(25, 31, 57, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 38px rgba(10, 16, 30, 0.22);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-50%) translateY(6px);
  transition:
    opacity 0.22s ease,
    transform 0.22s ease,
    background 0.28s ease,
    border-color 0.28s ease,
    box-shadow 0.28s ease;
  z-index: 2100;
}

.layout-navbar-settings.is-open .layout-navbar-settings-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.layout-navbar-settings-title {
  margin: 0 0 12px;
  color: #ffffff;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: color 0.28s ease;
}

/* -------------------------
   Switch dark / light navbar
------------------------- */

.layout-navbar-theme-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition:
    background 0.28s ease,
    border-color 0.28s ease;
}

.layout-theme-option-navbar {
  height: 42px;
  border: 0;
  background: transparent;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition:
    background 0.2s ease,
    color 0.28s ease,
    box-shadow 0.2s ease;
}

.layout-theme-option-navbar:hover {
  background: rgba(255, 255, 255, 0.06);
}

.layout-theme-option-navbar.is-active {
  background: linear-gradient(180deg, #4f7cff 0%, #3f6ff2 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

/* =========================================================
   LIGHT MODE
   Override cromatici globali quando body.theme-light è attivo
========================================================= */

body.theme-light {
  background: #eef2f8;
  color: #1d2a3f;
}

body.theme-light #page-wrapper.layout-shell {
  background: #eef2f8;
}

body.theme-light
  .layout-header
  .page-controls.navbar.navbar-dashboard.layout-navbar,
body.theme-light .layout-sidebar #sidebar {
  background: transparent !important;
}

body.theme-light .layout-main,
body.theme-light .layout-main .content,
body.theme-light .layout-main .content-wrap {
  background: transparent !important;
  color: #1d2a3f;
}

/* -------------------------
   Testi principali
------------------------- */

body.theme-light .layout-sidebar #sidebar .sidebar-nav-title,
body.theme-light .layout-menu-link,
body.theme-light .layout-submenu-link,
body.theme-light .layout-navbar-user-name,
body.theme-light .breadcrumb,
body.theme-light .page-title,
body.theme-light .layout-footer-main,
body.theme-light .layout-footer-version {
  color: #1d2a3f !important;
}

/* -------------------------
   Navbar
------------------------- */

body.theme-light .layout-navbar-divider {
  background: rgba(29, 42, 63, 0.18);
}

body.theme-light .layout-navbar-notifications-badge {
  background: #e53935;
  border-color: #f7f9fc;
  color: #ffffff;
  box-shadow: 0 6px 14px rgba(229, 57, 53, 0.22);
}

body.theme-light .layout-navbar-settings-panel {
  background: rgba(250, 251, 255, 0.96);
  border: 1px solid rgba(29, 42, 63, 0.08);
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.12);
}

body.theme-light .layout-navbar-settings-title {
  color: #1d2a3f;
}


body.theme-light .layout-navbar-notifications-panel {
  background: rgba(250, 251, 255, 0.98);
  border: 1px solid rgba(29, 42, 63, 0.08);
  box-shadow: 0 22px 48px rgba(15, 23, 42, 0.14);
  color: #2563eb;
}

body.theme-light .layout-navbar-notifications-panel::before {
  border-left-color: rgba(29, 42, 63, 0.08);
  border-top-color: rgba(29, 42, 63, 0.08);
}

body.theme-light .layout-navbar-notifications-header {
  border-bottom-color: rgba(29, 42, 63, 0.08);
}

body.theme-light .layout-navbar-notifications-title-icon,
body.theme-light .layout-navbar-notification-icon {
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.12);
}

body.theme-light .layout-navbar-notifications-title,
body.theme-light .layout-navbar-notification-title,
body.theme-light .layout-navbar-notifications-empty-title {
  color: #1d2a3f;
}

body.theme-light .layout-navbar-notifications-subtitle,
body.theme-light .layout-navbar-notification-text,
body.theme-light .layout-navbar-notifications-empty-text {
  color: rgba(29, 42, 63, 0.62);
}

body.theme-light .layout-navbar-notifications-count {
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
  border-color: rgba(37, 99, 235, 0.14);
}

body.theme-light .layout-navbar-notification-item:hover,
body.theme-light .layout-navbar-notification-item:focus {
  background: rgba(37, 99, 235, 0.06);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.08);
}

body.theme-light .layout-navbar-notification-meta {
  color: rgba(29, 42, 63, 0.48);
}

body.theme-light .layout-navbar-notifications-empty,
body.theme-light .layout-navbar-notifications-empty-svg {
  color: #2563eb;
}

body.theme-light .layout-navbar-notifications-footer {
  background: rgba(37, 99, 235, 0.03);
  border-top-color: rgba(29, 42, 63, 0.08);
}

body.theme-light .layout-navbar-notifications-footer-btn {
  color: rgba(29, 42, 63, 0.7) !important;
}

body.theme-light .layout-navbar-notifications-footer-btn + .layout-navbar-notifications-footer-btn {
  border-left-color: rgba(29, 42, 63, 0.08);
}

body.theme-light .layout-navbar-notifications-footer-btn:hover,
body.theme-light .layout-navbar-notifications-footer-btn:focus {
  background: rgba(37, 99, 235, 0.07);
  color: #2563eb !important;
}

body.theme-light .layout-navbar-notifications-footer-btn-read {
  color: #7c3aed !important;
}

body.theme-light .layout-navbar-notifications-footer-btn-read.is-disabled:hover,
body.theme-light .layout-navbar-notifications-footer-btn-read:disabled:hover {
  background: transparent;
  color: #7c3aed !important;
}

body.theme-light .layout-navbar-notifications-body::-webkit-scrollbar-thumb {
  background: rgba(29, 42, 63, 0.16);
}

body.theme-light .layout-navbar-theme-switch {
  background: rgba(29, 42, 63, 0.04);
  border-color: rgba(29, 42, 63, 0.08);
}

body.theme-light .layout-theme-option-navbar {
  color: #1d2a3f;
}

body.theme-light .layout-theme-option-navbar:hover {
  background: rgba(29, 42, 63, 0.08);
}

body.theme-light .layout-theme-option-navbar.is-active {
  background: linear-gradient(180deg, #4f7cff 0%, #3f6ff2 100%);
  color: #ffffff;
}

body.theme-light .layout-navbar-user-avatar-generated {
  background: linear-gradient(180deg, #7c5cff 0%, #4f7cff 100%);
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(79, 124, 255, 0.18);
}

body.theme-light .layout-navbar-sidebar-toggle {
  background: rgba(29, 42, 63, 0.06);
}

body.theme-light .layout-navbar-sidebar-toggle:hover,
body.theme-light .layout-navbar-sidebar-toggle:focus {
  background: rgba(29, 42, 63, 0.12);
}

body.theme-light .layout-navbar-sidebar-toggle span {
  background: #1d2a3f;
}

/* -------------------------
   Menu laterale
------------------------- */

body.theme-light .layout-menu-link:hover,
body.theme-light .layout-menu-link:focus,
body.theme-light .layout-submenu-link:hover,
body.theme-light .layout-submenu-link:focus {
  background: rgba(29, 42, 63, 0.06);
  color: #2563eb !important;
}

body.theme-light .layout-menu-item.active > .layout-menu-link,
body.theme-light .layout-submenu-item.active > .layout-submenu-link {
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb !important;
}

/* -------------------------
   Widget legacy
------------------------- */

body.theme-light .widget {
  background: #ffffff !important;
  color: #1d2a3f !important;
  box-shadow: 0 10px 28px rgba(16, 24, 40, 0.08);
}

body.theme-light .widget h1,
body.theme-light .widget h2,
body.theme-light .widget h3,
body.theme-light .widget h4,
body.theme-light .widget h5,
body.theme-light .widget h6,
body.theme-light .widget p,
body.theme-light .widget li,
body.theme-light .widget strong {
  color: #1d2a3f !important;
}

/* -------------------------
   Footer
------------------------- */

body.theme-light footer.content-footer.app-footer,
body.theme-light footer.content-footer.layout-footer,
body.theme-light .layout-main footer.content-footer {
  border-top: 1px solid rgba(29, 42, 63, 0.1);
}

body.theme-light .layout-main footer.content-footer a {
  color: #2563eb !important;
}

/* =========================================================
   SWEETALERT2
   Tema globale popup + bottoni standard SBMS
========================================================= */

.swal2-popup {
  border-radius: 10px !important;
  transition:
    background 0.28s ease,
    color 0.28s ease,
    border 0.28s ease,
    box-shadow 0.28s ease;
}

/* -------------------------
   Dark mode
------------------------- */

body:not(.theme-light) .swal2-popup {
  background: #282c56 !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.35) !important;
}

body:not(.theme-light) .swal2-title {
  color: #ffffff !important;
}

body:not(.theme-light) .swal2-html-container,
body:not(.theme-light) .swal2-popup p {
  color: #e5e7eb !important;
}

/* -------------------------
   Light mode
------------------------- */

body.theme-light .swal2-popup {
  background: #ffffff !important;
  color: #1d2a3f !important;
  border: 1px solid rgba(29, 42, 63, 0.08);
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.12) !important;
}

body.theme-light .swal2-title {
  color: #1d2a3f !important;
}

body.theme-light .swal2-html-container,
body.theme-light .swal2-popup p {
  color: #4b5563 !important;
}

/* -------------------------
   Bottoni base
------------------------- */

.swal2-popup .swal2-actions .swal2-confirm.thcs-swal-ok,
.swal2-popup .swal2-actions .swal2-confirm.thcs-swal-elimina,
.swal2-popup .swal2-actions .swal2-cancel.thcs-swal-cancel {
  min-width: 132px !important;
  height: 44px !important;
  margin: 0 6px !important;
  padding: 0 18px !important;
  border-radius: 5px !important;
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-weight: 600 !important;
}

/* -------------------------
   OK / azione primaria
------------------------- */

.swal2-popup .swal2-confirm.thcs-swal-ok {
  background: #7c3aed !important;
  box-shadow: none !important;
}

.swal2-popup .swal2-confirm.thcs-swal-ok:hover {
  background: #8b5cf6 !important;
}

.swal2-popup .swal2-confirm.thcs-swal-ok:focus,
.swal2-popup .swal2-confirm.thcs-swal-ok:active {
  outline: none !important;
  box-shadow: none !important;
}

/* -------------------------
   Elimina
------------------------- */

.swal2-popup .swal2-confirm.thcs-swal-elimina {
  background: #e53935 !important;
  box-shadow: none !important;
}

.swal2-popup .swal2-confirm.thcs-swal-elimina:hover {
  background: #ef9a9a !important;
}

.swal2-popup .swal2-confirm.thcs-swal-elimina:focus,
.swal2-popup .swal2-confirm.thcs-swal-elimina:active {
  outline: none !important;
  box-shadow: none !important;
}

/* -------------------------
   Annulla
------------------------- */

.swal2-popup .swal2-cancel.thcs-swal-cancel {
  background: whitesmoke !important;
  color: #000000 !important;
  border: 1px solid #dcdcdc !important;
  box-shadow: none !important;
}

.swal2-popup .swal2-cancel.thcs-swal-cancel:hover {
  background: #ededed !important;
  color: #000000 !important;
}

.swal2-popup .swal2-cancel.thcs-swal-cancel:focus,
.swal2-popup .swal2-cancel.thcs-swal-cancel:active {
  outline: none !important;
  box-shadow: none !important;
}

/* =========================================================
   RESPONSIVE LAYOUT GENERALE
========================================================= */

@media (max-width: 991px) {
  #page-wrapper.layout-shell {
    grid-template-columns: 1fr !important;
    grid-template-rows: var(--layout-header-height) minmax(0, 1fr) !important;
    grid-template-areas:
      "header"
      "main" !important;
  }

  .layout-main {
    padding: 13px 14px;
    overflow: visible;
  }

  .layout-header {
    z-index: 10000;
  }

  .layout-header .layout-navbar > .container-fluid,
  .layout-header .page-controls .container-fluid {
    padding: 0 18px !important;
  }

  .layout-navbar .layout-navbar-inner {
    grid-template-columns: minmax(0, 1fr) auto !important;
    column-gap: 10px;
  }

  .layout-navbar-left {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-width: none !important;
    padding: 0 !important;
    gap: 10px;
  }

  .layout-navbar-center {
    display: none;
  }

  .layout-navbar-sidebar-toggle {
    order: -1;
    flex: 0 0 var(--layout-sidebar-toggle-size);
    width: var(--layout-sidebar-toggle-size);
    height: var(--layout-sidebar-toggle-size);
  }

  .layout-navbar-brand {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
  }

  .layout-navbar-brand-logo {
    width: auto;
    max-width: clamp(132px, 34vw, 178px);
    height: 52px;
  }

  .layout-navbar-right {
    flex: 0 0 auto;
    min-width: 0;
  }

  .layout-navbar-actions {
    gap: 12px;
  }

  .layout-navbar-user {
    min-height: 54px;
  }

  .layout-navbar-user-avatar-wrap,
  .layout-navbar-user-avatar,
  .layout-navbar-user-avatar-generated {
    width: 38px;
    height: 38px;
    min-width: 38px;
    flex-basis: 38px;
  }

  .layout-navbar-user-avatar-wrap {
    margin-right: 0;
  }

  .layout-sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: min(var(--layout-sidebar-width), 86vw) !important;
    max-width: 86vw !important;
    height: 100dvh !important;
    z-index: 10001 !important;
    transform: translateX(calc(-100% - 24px)) !important;
    opacity: 0;
    pointer-events: none;
    overflow: visible !important;
    background: transparent !important;
    box-shadow: none !important;
    transition:
      transform var(--layout-sidebar-transition),
      opacity var(--layout-sidebar-transition);
  }

  .layout-sidebar #sidebar {
    position: absolute !important;
    top: var(--layout-header-height) !important;
    left: 0 !important;
    right: auto !important;
    bottom: 0 !important;
    width: 100% !important;
    height: calc(100dvh - var(--layout-header-height)) !important;
    min-height: 0 !important;
    overflow: hidden !important;
    background: rgba(25, 31, 57, 0.98) !important;
    box-shadow: 18px 0 42px rgba(0, 0, 0, 0.32) !important;
  }

  .layout-sidebar #sidebar .js-sidebar-content {
    height: 100%;
    overflow-y: auto;
    padding: 28px 18px 18px;
  }

  body.sidebar-mobile-open .layout-sidebar {
    transform: translateX(0) !important;
    opacity: 1;
    pointer-events: auto;
  }

  body.sidebar-mobile-open .layout-header {
    z-index: 10002;
  }

  body.sidebar-mobile-open .layout-navbar-sidebar-toggle {
    position: relative;
    z-index: 10003;
  }

  body.sidebar-mobile-open {
    overflow: hidden !important;
  }

  body.sidebar-mobile-open::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.45);
  }

  body.sidebar-collapsed #page-wrapper.layout-shell,
  body.sidebar-collapsed .layout-navbar .layout-navbar-inner {
    grid-template-columns: 1fr !important;
  }

  .layout-footer-inner {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .layout-footer-version {
    padding-right: 0;
    text-align: left;
    white-space: normal;
  }
}

@media (max-width: 575px) {
  :root {
    --layout-header-height: 78px;
    --layout-shell-padding: 0;
    --layout-sidebar-toggle-size: 36px;
  }

  .layout-header .layout-navbar > .container-fluid,
  .layout-header .page-controls .container-fluid {
    padding: 0 12px !important;
  }

  .layout-navbar .layout-navbar-inner {
    column-gap: 8px;
  }

  .layout-navbar-left {
    gap: 8px;
  }

  .layout-navbar-brand-logo {
    max-width: clamp(118px, 33vw, 150px);
    height: 46px;
  }

  .layout-navbar-actions {
    gap: 10px;
  }

  .layout-navbar-divider {
    display: none;
  }

  .layout-navbar-icon-button,
  .layout-navbar-icon-image {
    width: 22px;
    height: 22px;
  }

  .layout-navbar-user-avatar-wrap,
  .layout-navbar-user-avatar,
  .layout-navbar-user-avatar-generated {
    width: 36px;
    height: 36px;
    min-width: 36px;
    flex-basis: 36px;
  }

  .layout-navbar-notifications-badge {
    top: -8px;
    right: -8px;
  }


  .layout-navbar-notifications-panel {
    position: fixed;
    top: calc(var(--layout-header-height) + 8px);
    left: auto;
    right: 12px;
    width: min(340px, calc(100vw - 24px));
    max-width: none;
    transform-origin: top right;
  }

  .layout-navbar-notifications-panel::before {
    right: 28px;
  }

  .layout-navbar-notifications-header {
    padding: 13px 14px;
  }

  .layout-navbar-notifications-title-icon {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 12px;
  }

  .layout-navbar-notifications-subtitle {
    display: none;
  }

  .layout-navbar-notifications-body {
    max-height: min(285px, calc(100dvh - var(--layout-header-height) - 146px));
  }

  .layout-navbar-notification-item {
    padding: 10px 9px;
  }

  .layout-navbar-notifications-empty {
    padding: 18px 18px 20px;
  }

  .layout-navbar-notifications-empty-svg {
    width: 104px;
  }

  .layout-sidebar {
    width: min(300px, calc(100vw - 52px)) !important;
    max-width: calc(100vw - 52px) !important;
  }

  .layout-menu-link {
    min-height: 52px;
    padding: 0 16px;
  }
}

@media (max-width: 420px) {
  .layout-header .layout-navbar > .container-fluid,
  .layout-header .page-controls .container-fluid {
    padding: 0 10px !important;
  }

  .layout-navbar-brand-logo {
    max-width: 126px;
  }

  .layout-navbar-actions {
    gap: 8px;
  }

  .layout-navbar-icon-button,
  .layout-navbar-icon-image {
    width: 21px;
    height: 21px;
  }


  .layout-navbar-notifications-panel {
    left: auto;
    right: 10px;
    width: min(330px, calc(100vw - 20px));
  }

  .layout-navbar-notifications-footer-btn {
    min-height: 44px;
    padding: 0 10px;
    font-size: 12px;
  }
}

body.theme-light .layout-sidebar {
  background: #f7f9fc;
  box-shadow: 18px 0 42px rgba(15, 23, 42, 0.16);
}

@media (min-width: 992px) {
  body.theme-light .layout-sidebar {
    background: transparent !important;
    box-shadow: none !important;
  }
}

@media (max-width: 991px) {
  body.theme-light.sidebar-mobile-open .layout-sidebar {
    background: transparent !important;
    box-shadow: none !important;
  }

  body.theme-light.sidebar-mobile-open .layout-sidebar #sidebar {
    background: #f7f9fc !important;
    box-shadow: 18px 0 42px rgba(15, 23, 42, 0.16) !important;
  }
}

/* =========================================================
   DRAWER LATERALE CUSTOM
   Single source of truth per tutti i pannelli laterali SBMS
========================================================= */

:root {
  --drawer-width: min(545px, 92vw);
  --drawer-zindex: 9998;
  --drawer-overlay-zindex: 9997;
  --drawer-transition: 0.28s ease;

  --drawer-overlay-bg-dark: rgba(3, 8, 20, 0.56);
  --drawer-overlay-bg-light: rgba(15, 23, 42, 0.2);
}

body.drawer-open {
  overflow: hidden;
}

/* -------------------------
   Overlay
------------------------- */

.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--drawer-overlay-zindex);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition:
    opacity var(--drawer-transition),
    visibility var(--drawer-transition);
}

body.theme-dark .drawer-overlay,
body:not(.theme-light) .drawer-overlay {
  background: var(--drawer-overlay-bg-dark);
}

body.theme-light .drawer-overlay {
  background: var(--drawer-overlay-bg-light);
}

.drawer-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* -------------------------
   Drawer panel
------------------------- */

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: var(--drawer-zindex);
  width: var(--drawer-width);
  height: 100vh;
  max-height: 100vh;
  border-radius: 24px 0 0 24px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(100%);
  transition:
    transform var(--drawer-transition),
    opacity var(--drawer-transition),
    visibility var(--drawer-transition);
}

.drawer.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0);
}

/* -------------------------
   Varianti larghezza
------------------------- */

.drawer--lg {
  --drawer-width: min(720px, 94vw);
}

.drawer--sm {
  --drawer-width: min(420px, 92vw);
}

/* =========================================================
   DRAWER THEME
   Colori e superfici dark/light
========================================================= */

/* -------------------------
   Dark mode
------------------------- */

body.theme-dark .drawer,
body:not(.theme-light) .drawer {
  background: linear-gradient(180deg, #1c2b49 0%, #18253f 100%);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: -30px 0 60px rgba(0, 0, 0, 0.45);
}

body.theme-dark .drawer__header,
body:not(.theme-light) .drawer__header {
  background: linear-gradient(180deg, #223252 0%, #1f2d49 100%);
  border-top: 6px solid #a855f7;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

body.theme-dark .drawer__title,
body:not(.theme-light) .drawer__title {
  color: #f8fafc;
}

body.theme-dark .drawer__subtitle,
body:not(.theme-light) .drawer__subtitle {
  color: #94a3b8;
}

body.theme-dark .drawer__close,
body:not(.theme-light) .drawer__close {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
}

body.theme-dark .drawer__close:hover,
body.theme-dark .drawer__close:focus-visible,
body:not(.theme-light) .drawer__close:hover,
body:not(.theme-light) .drawer__close:focus-visible {
  background: transparent;
  border-color: #da6771;
  color: #da6771;
}

body.theme-dark .drawer__body,
body:not(.theme-light) .drawer__body {
  color: #e5edf9;
}

body.theme-dark .drawer__footer,
body:not(.theme-light) .drawer__footer {
  background: rgba(18, 28, 48, 0.94);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* -------------------------
   Light mode
------------------------- */

body.theme-light .drawer {
  background: #ffffff;
  border-left: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: -24px 0 50px rgba(15, 23, 42, 0.16);
}

body.theme-light .drawer__header {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border-top: 6px solid #a855f7;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

body.theme-light .drawer__title {
  color: #1e293b;
}

body.theme-light .drawer__subtitle {
  color: #64748b;
}

body.theme-light .drawer__close {
  background: #f8fafc;
  border: 1px solid #d7dee8;
  color: #9aa7b8;
}

body.theme-light .drawer__close:hover,
body.theme-light .drawer__close:focus-visible {
  background: transparent;
  border-color: #da6771;
  color: #da6771;
}

body.theme-light .drawer__body {
  color: #1e293b;
}

body.theme-light .drawer__footer {
  background: #ffffff;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

/* =========================================================
   DRAWER STRUCTURE
   Spaziature e struttura interna indipendenti dal tema
========================================================= */

/* -------------------------
   Drawer form shell
------------------------- */

.drawer-form-shell {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.drawer-form-shell .drawer__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.drawer__header {
  padding: 20px 22px 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.drawer__header-main {
  min-width: 0;
  flex: 1 1 auto;
}

.drawer__title {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: 0;
}

.drawer__subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.45;
}

.drawer__close {
  width: 50px;
  height: 50px;
  min-width: 50px;
  margin-top: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  flex: 0 0 auto;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.drawer__close:hover,
.drawer__close:focus-visible {
  transform: scale(1.03);
}

.drawer__close:focus {
  outline: none;
  box-shadow: none;
}

.drawer__close i {
  font-size: 25px;
  line-height: 1;
}

.drawer__body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 18px 22px;
}

.drawer__footer {
  padding: 16px 22px 18px;
}

/* =========================
   ELEMENTI INTERNI
========================= */

/* =========================================================
   DRAWER INFO BOX
========================================================= */

.drawer .info-box-blue {
  margin-bottom: 22px;
  padding: 20px 18px;
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 16px;
}

.drawer .info-box-blue .info-box-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  flex: 0 0 44px;
  margin: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.drawer .info-box-blue .info-box-icon i {
  font-size: 22px;
  line-height: 1;
}

.drawer .info-box-blue .info-box-content {
  min-width: 0;
  flex: 1 1 auto;
}

.drawer .info-box-blue .info-box-content h5 {
  margin: 0 0 4px;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 800;
}

.drawer .info-box-blue .info-box-content p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}

/* -------------------------
   Dark mode
------------------------- */

body.theme-dark .drawer .info-box-blue,
body:not(.theme-light) .drawer .info-box-blue {
  background: rgba(45, 72, 128, 0.38);
  border: 1px solid rgba(74, 133, 255, 0.18);
}

body.theme-dark .drawer .info-box-blue .info-box-icon,
body:not(.theme-light) .drawer .info-box-blue .info-box-icon {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cfe0ff;
}

body.theme-dark .drawer .info-box-content h5,
body:not(.theme-light) .drawer .info-box-content h5 {
  color: #f8fafc;
}

body.theme-dark .drawer .info-box-content p,
body:not(.theme-light) .drawer .info-box-content p {
  color: #9fb0cb;
}

/* -------------------------
   Light mode
------------------------- */

body.theme-light .drawer .info-box-blue {
  background: #eef5ff;
  border: 1px solid #d8e7ff;
}

body.theme-light .drawer .info-box-blue .info-box-icon {
  background: #ffffff;
  border: 1px solid #bfd7ff;
  color: #3b82f6;
}

body.theme-light .drawer .info-box-content h5 {
  color: #1e293b;
}

body.theme-light .drawer .info-box-content p {
  color: #64748b;
}

/* =========================================================
   DRAWER FORM
   Campi, label, note e stati base
========================================================= */

.drawer .form-group {
  margin-bottom: 24px;
}

.drawer .form-group label {
  margin-bottom: 10px;
  display: inline-block;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.drawer .form-group label.required::after {
  content: " *";
}

/* -------------------------
   Drawer color preview
------------------------- */

.drawer .ruolo-color-label {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.drawer .ruolo-color-preview-dot {
  width: 13px !important;
  height: 13px !important;
  min-width: 13px !important;
  flex: 0 0 13px !important;
  border-radius: 50% !important;
  display: inline-block !important;
  background: #64748b;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}

body.theme-light .drawer .ruolo-color-preview-dot {
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
}

/* -------------------------
   Campi form
------------------------- */

.drawer .form-control,
.drawer select,
.drawer textarea {
  width: 100%;
  min-height: 56px;
  padding: 14px 18px;
  border-radius: 18px;
  font-size: 1rem;
  box-shadow: none !important;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    color 0.2s ease;
}

.drawer textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

.drawer input[type="radio"],
.drawer input[type="checkbox"] {
  margin-right: 6px;
}

/* -------------------------
   Note
------------------------- */

.drawer small.text-muted {
  transition: color 0.28s ease;
}

.drawer__note {
  margin-top: 4px;
  text-align: left;
}

.drawer__note small {
  display: inline-block;
  font-size: 13px;
  line-height: 1.45;
}

.drawer__note-star {
  color: #ed9ca8;
  font-weight: 700;
}

/* -------------------------
   Dark mode
------------------------- */

body.theme-dark .drawer .form-group label,
body:not(.theme-light) .drawer .form-group label {
  color: #f1f5f9;
}

body.theme-dark .drawer .form-group label.required::after,
body:not(.theme-light) .drawer .form-group label.required::after {
  color: #fda4af;
}

body.theme-dark .drawer .form-control,
body.theme-dark .drawer select,
body.theme-dark .drawer textarea,
body:not(.theme-light) .drawer .form-control,
body:not(.theme-light) .drawer select,
body:not(.theme-light) .drawer textarea {
  background: #031533;
  border: 1px solid rgba(76, 103, 149, 0.55);
  color: #e5edf9;
}

body.theme-dark .drawer .form-control::placeholder,
body.theme-dark .drawer textarea::placeholder,
body:not(.theme-light) .drawer .form-control::placeholder,
body:not(.theme-light) .drawer textarea::placeholder {
  color: #93a4c1;
}

body.theme-dark .drawer .form-control:focus,
body.theme-dark .drawer select:focus,
body.theme-dark .drawer textarea:focus,
body:not(.theme-light) .drawer .form-control:focus,
body:not(.theme-light) .drawer select:focus,
body:not(.theme-light) .drawer textarea:focus {
  background: #041a3f;
  border-color: #5b8cff;
  color: #ffffff;
}

body.theme-dark .drawer small.text-muted,
body:not(.theme-light) .drawer small.text-muted {
  color: #8fa4c3 !important;
}

/* -------------------------
   Light mode
------------------------- */

body.theme-light .drawer .form-group label {
  color: #1e293b;
}

body.theme-light .drawer .form-group label.required::after {
  color: #dc2626;
}

body.theme-light .drawer .form-control,
body.theme-light .drawer select,
body.theme-light .drawer textarea {
  background: #ffffff;
  border: 1px solid #d7e0ea;
  color: #1e293b;
}

body.theme-light .drawer .form-control::placeholder,
body.theme-light .drawer textarea::placeholder {
  color: #94a3b8;
}

body.theme-light .drawer .form-control:focus,
body.theme-light .drawer select:focus,
body.theme-light .drawer textarea:focus {
  background: #ffffff;
  border-color: #8b5cf6;
  color: #0f172a;
}

body.theme-light .drawer small.text-muted {
  color: #64748b !important;
}

/* =========================================================
   DRAWER INPUT DATE / TIME NATIVI
   Corregge rendering browser in dark/light mode
========================================================= */

body.theme-dark .drawer input[type="date"],
body.theme-dark .drawer input[type="datetime-local"],
body.theme-dark .drawer input[type="time"],
body.theme-dark .drawer input[type="month"],
body:not(.theme-light) .drawer input[type="date"],
body:not(.theme-light) .drawer input[type="datetime-local"],
body:not(.theme-light) .drawer input[type="time"],
body:not(.theme-light) .drawer input[type="month"] {
  color-scheme: dark;
}

body.theme-light .drawer input[type="date"],
body.theme-light .drawer input[type="datetime-local"],
body.theme-light .drawer input[type="time"],
body.theme-light .drawer input[type="month"] {
  color-scheme: light;
}

/* =========================================================
   DRAWER MEDIA / IMAGE CROP
   Single source of truth immagini drawer:
   - avatar utenti/team/profilo
   - cover card imbarcazioni
   - cover hero dettaglio imbarcazioni
========================================================= */

.drawer-media .drawer-cover-current-wrap,
.drawer-media .drawer-cover-editor-wrap {
  width: 100%;
  margin-bottom: 24px;
}

.drawer-media .drawer-cover-label {
  margin-bottom: 10px;
  display: inline-block;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.drawer-media .drawer-cover-current,
.drawer-media .drawer-cover-editor {
  width: 100%;
  overflow: hidden;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drawer-media .drawer-cover-current-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.drawer-media .drawer-cover-editor img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* -------------------------
   Empty state
------------------------- */

.drawer-media .drawer-cover-current-empty,
.drawer-media .drawer-cover-editor-empty {
  width: 100%;
  margin-top: 6px;
  padding: 18px 16px;
  border-radius: 18px;
  text-align: center;
  font-size: 14px;
  line-height: 1.45;
}

/* -------------------------
   Azioni immagine
------------------------- */

.drawer-media .drawer-cover-delete-wrap {
  width: 100%;
  margin: 10px 0 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drawer-media .drawer-cover-delete-wrap .btn,
.drawer-media .drawer-cover-tools .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.drawer-media .drawer-cover-tools {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.drawer-avatar-crop-buttons {
  width: 100%;
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* -------------------------
   File field custom
------------------------- */

.drawer-media .drawer-file-field {
  position: relative;
  width: 100%;
}

.drawer-media .drawer-file-field-input {
  padding-right: 58px !important;
  cursor: pointer;
}

.drawer-media .drawer-file-field-button {
  position: absolute;
  top: 50%;
  right: 10px;
  z-index: 2;
  width: 36px;
  height: 36px;
  min-width: 36px;
  padding: 0 !important;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-50%);
}

.drawer-media .drawer-file-field-icon {
  width: 18px;
  height: 18px;
  display: block;
}

/* -------------------------
   Dark mode
------------------------- */

body.theme-dark .drawer-media .drawer-cover-label,
body:not(.theme-light) .drawer-media .drawer-cover-label {
  color: #f1f5f9;
}

body.theme-dark .drawer-media .drawer-cover-current,
body.theme-dark .drawer-media .drawer-cover-editor,
body:not(.theme-light) .drawer-media .drawer-cover-current,
body:not(.theme-light) .drawer-media .drawer-cover-editor {
  background: #031533;
  border: 1px solid rgba(76, 103, 149, 0.55);
}

body.theme-dark .drawer-media .drawer-cover-current-empty,
body.theme-dark .drawer-media .drawer-cover-editor-empty,
body:not(.theme-light) .drawer-media .drawer-cover-current-empty,
body:not(.theme-light) .drawer-media .drawer-cover-editor-empty {
  background: rgba(255, 255, 255, 0.035);
  border: 1px dashed rgba(255, 255, 255, 0.14);
  color: #9fb0cb;
}

/* -------------------------
   Light mode
------------------------- */

body.theme-light .drawer-media .drawer-cover-label {
  color: #1e293b;
}

body.theme-light .drawer-media .drawer-cover-current,
body.theme-light .drawer-media .drawer-cover-editor {
  background: #f8fbff;
  border: 1px solid #d7e0ea;
}

body.theme-light .drawer-media .drawer-cover-current-empty,
body.theme-light .drawer-media .drawer-cover-editor-empty {
  background: #f8fbff;
  border: 1px dashed #d7e0ea;
  color: #64748b;
}

/* =========================================================
   DRAWER MEDIA VARIANTS
========================================================= */

/* Avatar: formato quadrato */
.drawer-media--avatar .drawer-cover-current,
.drawer-media--avatar .drawer-cover-editor {
  aspect-ratio: 1 / 1;
  min-height: 320px;
}

/* Card imbarcazioni: preview coerente con card elenco */
.drawer-media--boat-card .drawer-cover-current,
.drawer-media--boat-card .drawer-cover-editor {
  aspect-ratio: 2.35 / 1;
  min-height: 185px;
}

/* Hero dettaglio imbarcazione: 1600x500 */
.drawer-media--boat-hero .drawer-cover-current,
.drawer-media--boat-hero .drawer-cover-editor {
  aspect-ratio: 16 / 5;
  min-height: 170px;
}

/* -------------------------
   Responsive
------------------------- */

@media (max-width: 575.98px) {
  .drawer-media--avatar .drawer-cover-current,
  .drawer-media--avatar .drawer-cover-editor {
    min-height: 260px;
  }

  .drawer-media--boat-card .drawer-cover-current,
  .drawer-media--boat-card .drawer-cover-editor {
    min-height: 160px;
  }

  .drawer-media--boat-hero .drawer-cover-current,
  .drawer-media--boat-hero .drawer-cover-editor {
    min-height: 140px;
  }
}

/* =========================================================
   SELECT2 - BASE GLOBALE
========================================================= */

.select2-container {
  width: 100% !important;
  display: block;
}

.select2-container--default .select2-selection--single {
  width: 100%;
  height: 56px;
  min-height: 56px;
  border-radius: 18px !important;
  box-shadow: none !important;
  outline: none !important;
  display: flex;
  align-items: center;
  overflow: hidden;
  position: relative;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    color 0.2s ease;
}

.select2-container--default
  .select2-selection--single
  .select2-selection__rendered {
  width: 100%;
  min-height: 54px;
  padding-left: 18px;
  padding-right: 46px;
  line-height: 54px;
  font-size: 1rem;
  text-align: left;
  display: flex;
  align-items: center;
  background: transparent !important;
  box-shadow: none !important;
}

.select2-container--default
  .select2-selection--single
  .select2-selection__placeholder {
  background: transparent !important;
  box-shadow: none !important;
}

.select2-container--default
  .select2-selection--single
  .select2-selection__arrow {
  width: 34px;
  height: 54px;
  right: 10px;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.select2-container--default
  .select2-selection--single
  .select2-selection__arrow
  b {
  margin-top: 0 !important;
  position: static;
  border-width: 6px 5px 0;
}

.select2-container--open
  .select2-selection--single
  .select2-selection__arrow
  b {
  border-width: 0 5px 6px;
}

.select2-container--default
  .select2-selection--single
  .select2-selection__clear {
  position: absolute;
  left: 14px;
  top: 50%;
  right: auto;
  z-index: 2;
  margin: 0;
  padding: 0;
  background: transparent;
  font-size: 18px;
  line-height: 1;
  font-weight: 700;
  transform: translateY(-50%);
}

.select2-container--default
  .select2-selection--single
  .select2-selection__clear
  + .select2-selection__rendered {
  padding-left: 36px !important;
}

/* -------------------------
   Dropdown
------------------------- */

.select2-container--open .select2-dropdown {
  margin-top: 8px;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18);
}

.select2-search--dropdown {
  padding: 14px;
}

.select2-search--dropdown .select2-search__field {
  height: 46px;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 15px;
  outline: none !important;
  box-shadow: none !important;
}

.select2-results__options {
  padding: 0;
}

.select2-results__option {
  padding: 12px 16px;
  font-size: 15px;
  line-height: 1.35;
}

/* -------------------------
   Light mode
------------------------- */

body.theme-light .select2-container--default .select2-selection--single {
  background: #ffffff !important;
  border: 1px solid #d7e0ea !important;
}

body.theme-light
  .select2-container--default
  .select2-selection--single
  .select2-selection__rendered {
  background: transparent !important;
  color: #1e293b !important;
}

body.theme-light
  .select2-container--default
  .select2-selection--single
  .select2-selection__placeholder {
  background: transparent !important;
  color: #94a3b8 !important;
}

body.theme-light
  .select2-container--default
  .select2-selection--single
  .select2-selection__arrow
  b {
  border-color: #64748b transparent transparent;
}

body.theme-light
  .select2-container--default.select2-container--open
  .select2-selection--single,
body.theme-light .select2-container--default .select2-selection--single:focus,
body.theme-light
  .select2-container--default
  .select2-selection--single[aria-expanded="true"] {
  background: #ffffff !important;
  border-color: #8b5cf6 !important;
}

body.theme-light
  .select2-container--default.select2-container--open
  .select2-selection--single
  .select2-selection__arrow
  b {
  border-color: transparent transparent #64748b;
}

body.theme-light
  .select2-container--default
  .select2-selection--single
  .select2-selection__clear {
  color: #64748b;
}

body.theme-light
  .select2-container--default
  .select2-selection--single
  .select2-selection__clear:hover {
  color: #1e293b;
}

body.theme-light .select2-container--open .select2-dropdown {
  background: #ffffff;
  border: 1px solid #d7e0ea;
}

body.theme-light .select2-search--dropdown {
  background: #ffffff;
}

body.theme-light .select2-search--dropdown .select2-search__field {
  background: #ffffff;
  border: 1px solid #d7e0ea;
  color: #1e293b;
}

body.theme-light .select2-search--dropdown .select2-search__field::placeholder {
  color: #94a3b8;
}

body.theme-light .select2-results__option {
  background: #ffffff;
  color: #1e293b;
}

body.theme-light
  .select2-container--default
  .select2-results__option--highlighted[aria-selected] {
  background: #eef2ff;
  color: #1e293b;
}

body.theme-light
  .select2-container--default
  .select2-results__option[aria-selected="true"] {
  background: #f8fafc;
  color: #1e293b;
}

/* -------------------------
   Dark mode
------------------------- */

body.theme-dark .select2-container--default .select2-selection--single,
body:not(.theme-light) .select2-container--default .select2-selection--single {
  background: #031533 !important;
  border: 1px solid rgba(76, 103, 149, 0.55) !important;
}

body.theme-dark
  .select2-container--default
  .select2-selection--single
  .select2-selection__rendered,
body:not(.theme-light)
  .select2-container--default
  .select2-selection--single
  .select2-selection__rendered {
  background: transparent !important;
  color: #e5edf9 !important;
}

body.theme-dark
  .select2-container--default
  .select2-selection--single
  .select2-selection__placeholder,
body:not(.theme-light)
  .select2-container--default
  .select2-selection--single
  .select2-selection__placeholder {
  background: transparent !important;
  color: #93a4c1 !important;
}

body.theme-dark
  .select2-container--default
  .select2-selection--single
  .select2-selection__arrow
  b,
body:not(.theme-light)
  .select2-container--default
  .select2-selection--single
  .select2-selection__arrow
  b {
  border-color: #93a4c1 transparent transparent;
}

body.theme-dark
  .select2-container--default.select2-container--open
  .select2-selection--single,
body.theme-dark .select2-container--default .select2-selection--single:focus,
body.theme-dark
  .select2-container--default
  .select2-selection--single[aria-expanded="true"],
body:not(.theme-light)
  .select2-container--default.select2-container--open
  .select2-selection--single,
body:not(.theme-light)
  .select2-container--default
  .select2-selection--single:focus,
body:not(.theme-light)
  .select2-container--default
  .select2-selection--single[aria-expanded="true"] {
  background: #031533 !important;
  border-color: #5b8cff !important;
}

body.theme-dark
  .select2-container--default.select2-container--open
  .select2-selection--single
  .select2-selection__arrow
  b,
body:not(.theme-light)
  .select2-container--default.select2-container--open
  .select2-selection--single
  .select2-selection__arrow
  b {
  border-color: transparent transparent #93a4c1;
}

body.theme-dark
  .select2-container--default
  .select2-selection--single
  .select2-selection__clear,
body:not(.theme-light)
  .select2-container--default
  .select2-selection--single
  .select2-selection__clear {
  color: #cbd5e1;
}

body.theme-dark
  .select2-container--default
  .select2-selection--single
  .select2-selection__clear:hover,
body:not(.theme-light)
  .select2-container--default
  .select2-selection--single
  .select2-selection__clear:hover {
  color: #ffffff;
}

body.theme-dark .select2-container--open .select2-dropdown,
body:not(.theme-light) .select2-container--open .select2-dropdown {
  background: #132d5d;
  border: 1px solid rgba(76, 103, 149, 0.55);
}

body.theme-dark .select2-search--dropdown,
body:not(.theme-light) .select2-search--dropdown {
  background: #132d5d;
}

body.theme-dark .select2-search--dropdown .select2-search__field,
body:not(.theme-light) .select2-search--dropdown .select2-search__field {
  background: #031533;
  border: 1px solid rgba(76, 103, 149, 0.55);
  color: #e5edf9;
}

body.theme-dark .select2-search--dropdown .select2-search__field::placeholder,
body:not(.theme-light)
  .select2-search--dropdown
  .select2-search__field::placeholder {
  color: #93a4c1;
}

body.theme-dark .select2-results__option,
body:not(.theme-light) .select2-results__option {
  background: #132d5d;
  color: #e5edf9;
}

body.theme-dark
  .select2-container--default
  .select2-results__option--highlighted[aria-selected],
body:not(.theme-light)
  .select2-container--default
  .select2-results__option--highlighted[aria-selected] {
  background: #244889;
  color: #ffffff;
}

body.theme-dark
  .select2-container--default
  .select2-results__option[aria-selected="true"],
body:not(.theme-light)
  .select2-container--default
  .select2-results__option[aria-selected="true"] {
  background: rgba(139, 92, 246, 0.16);
  color: #ffffff;
}

/* =========================================================
   SELECT2 - OVERRIDE DRAWER
========================================================= */

.drawer .select2-container--default .select2-selection--single {
  height: 56px;
  min-height: 56px;
  border-radius: 18px !important;
}

.drawer
  .select2-container--default
  .select2-selection--single
  .select2-selection__rendered {
  min-height: 54px;
  padding-left: 18px;
  padding-right: 46px;
  line-height: 54px;
}

.drawer
  .select2-container--default
  .select2-selection--single
  .select2-selection__arrow {
  width: 34px;
  height: 54px;
  right: 10px;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drawer
  .select2-container--default
  .select2-selection--single
  .select2-selection__arrow
  b {
  margin-top: 0 !important;
  position: static;
}

.drawer
  .select2-container--default
  .select2-selection--single
  .select2-selection__clear {
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
}

.drawer
  .select2-container--default
  .select2-selection--single
  .select2-selection__clear
  + .select2-selection__rendered {
  padding-left: 8px !important;
}

.drawer .select2-flag-selection {
  min-height: 54px;
  margin-left: 14px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

/* Search sempre visibile nei dropdown Select2 dentro drawer */
.drawer .select2-container--open .select2-dropdown .select2-search--dropdown,
.drawer .select2-container--open .select2-dropdown .select2-search__field {
  display: block !important;
  width: 100% !important;
}

/* =========================================================
   SELECT2 - DETAIL SECTION CARD
========================================================= */

.detail-section-card .select2-container--default .select2-selection--single {
  height: 34px !important;
  min-height: 34px !important;
  padding: 0 !important;
  border-radius: 4px !important;
}

.detail-section-card
  .select2-container--default
  .select2-selection--single
  .select2-selection__rendered {
  min-height: 32px !important;
  padding-left: 12px !important;
  padding-right: 34px !important;
  line-height: 32px !important;
  font-size: 14px;
}

.detail-section-card
  .select2-container--default
  .select2-selection--single
  .select2-selection__arrow {
  width: 28px;
  height: 32px !important;
  right: 6px;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.detail-section-card
  .select2-container--default
  .select2-selection--single
  .select2-selection__arrow
  b {
  margin-top: 0 !important;
  position: static;
  border-width: 5px 4px 0;
}

.detail-section-card .select2-flag-selection {
  min-height: 32px !important;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* -------------------------
   Light mode detail
------------------------- */

body.theme-light
  .detail-section-card
  .select2-container--default
  .select2-selection--single {
  background: #f8fbff !important;
  border: 1px solid #d7e0ea !important;
}

body.theme-light
  .detail-section-card
  .select2-container--default
  .select2-selection--single
  .select2-selection__rendered {
  color: #1e293b !important;
}

body.theme-light
  .detail-section-card
  .select2-container--default
  .select2-selection--single
  .select2-selection__placeholder {
  color: #94a3b8 !important;
}

body.theme-light
  .detail-section-card
  .select2-container--default.select2-container--open
  .select2-selection--single,
body.theme-light
  .detail-section-card
  .select2-container--default
  .select2-selection--single:focus,
body.theme-light
  .detail-section-card
  .select2-container--default
  .select2-selection--single[aria-expanded="true"] {
  background: #ffffff !important;
  border-color: #6ea8fe !important;
}

/* -------------------------
   Dark mode detail
------------------------- */

body.theme-dark
  .detail-section-card
  .select2-container--default
  .select2-selection--single,
body:not(.theme-light)
  .detail-section-card
  .select2-container--default
  .select2-selection--single {
  background: #040620 !important;
  border: 1px solid rgba(76, 103, 149, 0.55) !important;
}

body.theme-dark
  .detail-section-card
  .select2-container--default
  .select2-selection--single
  .select2-selection__rendered,
body:not(.theme-light)
  .detail-section-card
  .select2-container--default
  .select2-selection--single
  .select2-selection__rendered {
  color: #e5edf9 !important;
}

body.theme-dark
  .detail-section-card
  .select2-container--default
  .select2-selection--single
  .select2-selection__placeholder,
body:not(.theme-light)
  .detail-section-card
  .select2-container--default
  .select2-selection--single
  .select2-selection__placeholder {
  color: #93a4c1 !important;
}

body.theme-dark
  .detail-section-card
  .select2-container--default.select2-container--open
  .select2-selection--single,
body.theme-dark
  .detail-section-card
  .select2-container--default
  .select2-selection--single:focus,
body.theme-dark
  .detail-section-card
  .select2-container--default
  .select2-selection--single[aria-expanded="true"],
body:not(.theme-light)
  .detail-section-card
  .select2-container--default.select2-container--open
  .select2-selection--single,
body:not(.theme-light)
  .detail-section-card
  .select2-container--default
  .select2-selection--single:focus,
body:not(.theme-light)
  .detail-section-card
  .select2-container--default
  .select2-selection--single[aria-expanded="true"] {
  background: #040620 !important;
  border-color: #5b8cff !important;
}

/* =========================================================
   SELECT2 - FLAG TEMPLATE
========================================================= */

.select2-flag-option,
.select2-flag-selection {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.select2-flag-option__img,
.select2-flag-selection__img {
  width: 22px;
  height: 15px;
  flex: 0 0 auto;
  object-fit: cover;
  border-radius: 2px;
  display: block;
}

.select2-flag-option__text,
.select2-flag-selection__text {
  min-width: 0;
  display: inline-block;
}

.select2-flag-option-placeholder {
  display: inline-block;
  background: transparent !important;
  box-shadow: none !important;
}

body.theme-light .select2-flag-selection__text {
  color: #1e293b;
}

body.theme-dark .select2-flag-selection__text,
body:not(.theme-light) .select2-flag-selection__text {
  color: #e5edf9;
}

/* =========================================================
   DRAWER GIORNO RILASCIATO - MEMBER/COMEMBER
========================================================= */

.released-day-info {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.released-day-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  border-radius: 18px;
  transition:
    background 0.28s ease,
    border-color 0.28s ease,
    color 0.28s ease;
}

.released-day-label {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.045em;
}

.released-day-value {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.35;
}

/* Badge tipo giorno */

.released-day-type-badge {
  width: fit-content;
  min-width: 54px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.released-day-type-badge--wk {
  background: rgba(146, 208, 80, 0.18);
  color: #92d050;
}

.released-day-type-badge--we {
  background: rgba(255, 110, 1, 0.18);
  color: #ff6e01;
}

.released-day-type-badge--hday {
  background: rgba(255, 0, 0, 0.14);
  color: #ff4d4d;
}

/* Dark mode */

body.theme-dark .released-day-card,
body:not(.theme-light) .released-day-card {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

body.theme-dark .released-day-label,
body:not(.theme-light) .released-day-label {
  color: rgba(226, 232, 240, 0.68);
}

body.theme-dark .released-day-value,
body:not(.theme-light) .released-day-value {
  color: #ffffff;
}

/* Light mode */

body.theme-light .released-day-card {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.1);
}

body.theme-light .released-day-label {
  color: #64748b;
}

body.theme-light .released-day-value {
  color: #0f172a;
}

body.theme-light .released-day-type-badge--wk {
  background: rgba(146, 208, 80, 0.22);
  color: #3f7f1f;
}

body.theme-light .released-day-type-badge--we {
  background: rgba(255, 110, 1, 0.18);
  color: #b84c00;
}

body.theme-light .released-day-type-badge--hday {
  background: rgba(255, 0, 0, 0.12);
  color: #c1121f;
}

#drawer-giorno-rilasciato .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

#drawer-giorno-rilasciato .drawer-form-shell {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#drawer-giorno-rilasciato .drawer__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

#drawer-giorno-rilasciato .drawer__footer {
  flex: 0 0 auto;
}

/* =========================================================
   DRAWER FOOTER ACTIONS
========================================================= */

.drawer__footer .ui-form-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.drawer__footer .btn {
  min-width: 140px;
  height: 46px;
  border-radius: 6px;
  font-weight: 700;
  box-shadow: none !important;
}

/* =========================================================
   DRAWER RESPONSIVE
========================================================= */

@media (max-width: 991.98px) {
  .drawer {
    width: min(620px, 100vw);
    border-radius: 20px 0 0 20px;
  }

  .drawer__title {
    font-size: 22px;
  }
}

@media (max-width: 767.98px) {
  .drawer {
    width: 100vw;
  }

  .drawer__header,
  .drawer__body,
  .drawer__footer {
    padding-left: 18px;
    padding-right: 18px;
  }

  .drawer__footer .ui-form-actions {
    gap: 12px;
  }

  .drawer__footer .btn {
    min-width: 120px;
  }
}

@media (max-width: 575.98px) {
  .drawer .info-box-blue {
    align-items: flex-start;
    gap: 12px;
    padding: 16px 14px;
  }

  .drawer .info-box-blue .info-box-icon {
    width: 38px;
    height: 38px;
    min-width: 38px;
    flex: 0 0 38px;
  }

  .drawer .info-box-blue .info-box-icon i {
    font-size: 18px;
  }

  .drawer .info-box-blue .info-box-content h5 {
    font-size: 16px;
  }

  .drawer .select2-container--default .select2-selection--single,
  .detail-section-card .select2-container--default .select2-selection--single {
    height: 52px;
    min-height: 52px;
  }

  .drawer
    .select2-container--default
    .select2-selection--single
    .select2-selection__rendered,
  .detail-section-card
    .select2-container--default
    .select2-selection--single
    .select2-selection__rendered {
    min-height: 50px;
    padding-left: 16px;
    padding-right: 42px;
    line-height: 50px;
  }

  .drawer
    .select2-container--default
    .select2-selection--single
    .select2-selection__arrow,
  .detail-section-card
    .select2-container--default
    .select2-selection--single
    .select2-selection__arrow {
    height: 50px;
    right: 8px;
  }

  .drawer .select2-flag-selection {
    min-height: 50px;
  }

  .select2-search--dropdown {
    padding: 10px;
  }

  .select2-search--dropdown .select2-search__field {
    height: 42px;
  }

  .select2-results__option {
    padding: 10px 14px;
    font-size: 14px;
  }
}

/* =========================================================
   PLANNER RELEASED DAY CLICKABLE
========================================================= */

.planner-release-badge,
.planner-release-badge-wrapper,
.fc-event:has(.planner-release-badge) {
  cursor: pointer;
}

/* =========================================================
   BOTTONI GLOBALI LEGACY
   Compatibilità con classi Bootstrap/template già usate
========================================================= */

.btn-cancel {
  background: whitesmoke;
  color: #000000;
  border: 0;
  border-radius: 6px;
}

.btn-cancel:hover,
.btn-cancel:focus {
  background: #ededed;
  color: #000000;
}

.btn-default {
  background: #7c3aed;
  color: #ffffff;
  border: 0;
  border-radius: 6px;
}

.btn-default:hover,
.btn-default:focus {
  background: #8b5cf6;
  color: #ffffff;
}

/* =========================================================
   GLOBAL PAGE LOADER
   Loader globale mostrato durante la navigazione interna
========================================================= */

#app-page-loader {
  position: fixed;
  inset: 0;
  z-index: 99999;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 24px;

  background: rgba(21, 31, 63, 0.42);

  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);

  opacity: 1;
  visibility: visible;

  transition:
    opacity 0.28s ease,
    visibility 0.28s ease;
}

/* =========================================================
   LIGHT MODE
========================================================= */

html.theme-light #app-page-loader,
body.theme-light #app-page-loader {
  background: rgba(238, 242, 248, 0.46);
}

/* =========================================================
   HIDDEN STATE
========================================================= */

#app-page-loader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* =========================================================
   LOADER PANEL
========================================================= */

.app-page-loader__panel {
  min-width: 240px;
  min-height: 240px;

  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;

  gap: 14px;
  padding: 26px 24px;

  border-radius: 26px;

  background: rgba(17, 27, 49, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.1);

  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.34);
}

/* =========================================================
   LIGHT MODE PANEL
========================================================= */

html.theme-light .app-page-loader__panel,
body.theme-light .app-page-loader__panel {
  background: rgba(255, 255, 255, 0.98);

  border: 1px solid rgba(41, 58, 92, 0.12);

  box-shadow: 0 24px 54px rgba(24, 39, 75, 0.18);
}

/* =========================================================
   LOADER CONTENT
========================================================= */

.app-page-loader__anim {
  width: 120px;
  height: 120px;
  display: block;
}

.app-page-loader__text {
  margin: 0;

  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.2px;

  color: #e7eefb;
  text-align: center;
}

/* =========================================================
   LIGHT MODE TEXT
========================================================= */

html.theme-light .app-page-loader__text,
body.theme-light .app-page-loader__text {
  color: #33415c;
}

/* =========================================================
   DETAIL PAGE SYSTEM
   Standard riusabile per pagine dettaglio SBMS
========================================================= */

.detail-page {
  min-width: 0;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* =========================================================
   DETAIL HERO
========================================================= */

.detail-hero {
  padding: 0;
  overflow: hidden;
}

.detail-hero-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  align-items: stretch;
}

.detail-hero-media {
  position: relative;

  overflow: hidden;

  border-top-left-radius: 22px;
  border-top-right-radius: inherit;

  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;

  aspect-ratio: 16 / 5;

  min-height: 0;

  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.02),
      rgba(255, 255, 255, 0.01)
    ),
    linear-gradient(135deg, rgba(80, 110, 160, 0.1), rgba(25, 35, 55, 0.18));
}

.detail-hero-image {
  position: absolute;
  inset: 0;

  width: 100%;
  height: 100%;

  display: block;

  object-fit: cover;
  object-position: center center;
}

/* =========================================================
   HERO PLACEHOLDER
========================================================= */

.detail-hero-placeholder {
  position: absolute;
  inset: 0;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  gap: 12px;

  text-align: center;

  color: rgba(255, 255, 255, 0.34);

  letter-spacing: 0.05em;
  text-transform: uppercase;

  background: rgba(255, 255, 255, 0.02);
}

.detail-hero-placeholder-icon {
  font-size: 54px;
  line-height: 1;
}

.detail-hero-placeholder-text {
  font-size: 16px;
  font-weight: 700;
}

/* =========================================================
   HERO FLAG
========================================================= */

.detail-hero-flag {
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 35;

  line-height: 0;
}

.detail-hero-flag img {
  width: 36px;
  height: 24px;

  display: block;

  object-fit: cover;

  border-radius: 3px;

  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* =========================================================
   HERO OVERLAY
========================================================= */

.detail-hero-overlay {
  position: absolute;
  inset: 0;

  display: flex;
  align-items: flex-end;

  padding: 22px 24px;

  background: linear-gradient(
    180deg,
    rgba(4, 11, 24, 0.02) 0%,
    rgba(4, 11, 24, 0.3) 100%
  );
}

.detail-hero-text {
  max-width: 520px;
}

.detail-hero-title {
  margin: 0;

  font-size: 34px;
  line-height: 1;
  font-weight: 800;

  color: #ffffff;
}

.detail-hero-subtitle {
  margin: 8px 0 0;

  font-size: 18px;
  line-height: 1.15;
  font-weight: 700;

  color: rgba(255, 255, 255, 0.88);
}

/* =========================================================
   HERO SIDE
========================================================= */

.detail-hero-side {
  display: flex;
  align-items: stretch;
  justify-content: stretch;

  padding: 18px 14px;

  border-top-right-radius: 22px;

  background: rgba(255, 255, 255, 0.04);
}

.detail-hero-side-inner {
  width: 100%;

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
}

.detail-hero-edit-btn {
  width: 100%;
  white-space: nowrap;
}

.detail-hero-edit-btn img {
  flex: 0 0 auto;
}

.detail-hero-edit-btn span {
  white-space: nowrap;
}

/* =========================================================
   DETAIL TABS
========================================================= */

.detail-tabs {
  position: relative;
  z-index: 2;
}

.detail-tabs-nav {
  padding-bottom: 1px;
  display: flex;
  align-items: stretch;
  gap: 2px;
  overflow-x: auto;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.detail-tab-link {
  position: relative;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 8px 8px 0 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none !important;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease;
}

.detail-tab-link:hover,
.detail-tab-link:focus,
.detail-tab-link:active {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  text-decoration: none !important;
}

.detail-tab-link.is-active {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.detail-tab-link-icon {
  min-width: 42px;
  padding: 0 12px;
}

/* =========================================================
   DETAIL TAB PANEL
========================================================= */

.detail-tab-panel {
  min-width: 0;
  overflow: visible !important;
}

.detail-tab-panel > .content-card,
.detail-tab-panel > .detail-section-card {
  overflow: visible;
}

.detail-tab-panel > .content-card.detail-section-card {
  padding: 26px 28px 30px;
}

/* =========================================================
   DETAIL SECTION CARD
========================================================= */

.detail-section-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow: visible;
}

.detail-section-head {
  margin-bottom: 8px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.detail-section-title {
  margin: 0;
  color: #ffffff;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 800;
}

.detail-section-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.detail-section-body {
  min-width: 0;
  padding-top: 4px;
  overflow: visible;
}

/* =========================================================
   DETAIL FORM
========================================================= */

.detail-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.detail-form-grid {
  display: grid;
  gap: 22px 24px;
}

.detail-form-grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* =========================================================
   DIVIDER
========================================================= */

.detail-divider {
  margin: 10px 0 0;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.detail-divider-danger {
  border-top-color: rgba(255, 74, 74, 0.45);
}

/* =========================================================
   DETAIL SUBSECTION
========================================================= */

.detail-subsection {
  padding-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.detail-subsection-title {
  margin: 0;
  color: #ffffff;
  font-size: 16px;
  line-height: 1.25;
  font-weight: 800;
}

.detail-subsection-text {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  line-height: 1.6;
}

.detail-subsection-danger {
  padding-top: 4px;
}

.detail-subsection-danger .detail-subsection-title {
  color: #ff5f5f;
}

.detail-subsection-danger .btn {
  margin-top: 4px;
  align-self: flex-start;
}

/* =========================================================
   CHECKBOX
========================================================= */

.detail-subsection .checkbox {
  margin: 0;
}

.detail-subsection .checkbox label {
  display: inline-flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.6;
}

.detail-subsection .checkbox input[type="checkbox"] {
  margin-top: 4px;
}

/* =========================================================
   BUTTON STATES
   Stati disabilitati per salvataggi drawer/detail
========================================================= */

.drawer__footer .btn[disabled],
.drawer__footer .btn.disabled,
.js-detail-save[disabled] {
  opacity: 0.55 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  filter: none !important;
  transform: none !important;
}

.drawer__footer .btn.btn-default[disabled],
.drawer__footer .btn.btn-default.disabled {
  background: #7c3aed !important;
  border-color: #7c3aed !important;
  color: #ffffff !important;
  box-shadow: none !important;
  background-image: none !important;
}

.drawer__footer .btn.btn-default[disabled]:hover,
.drawer__footer .btn.btn-default[disabled]:focus,
.drawer__footer .btn.btn-default[disabled]:active,
.drawer__footer .btn.btn-default.disabled:hover,
.drawer__footer .btn.btn-default.disabled:focus,
.drawer__footer .btn.btn-default.disabled:active {
  background: #7c3aed !important;
  border-color: #7c3aed !important;
  color: #ffffff !important;
  box-shadow: none !important;
  opacity: 0.55 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  transform: none !important;
}

.js-detail-save.is-enabled {
  opacity: 1;
}

/* =========================================================
   DETAIL EMPTY STATE
========================================================= */

.detail-empty-state {
  padding: 48px 20px;
  text-align: center;
}

.detail-empty-icon {
  margin-bottom: 12px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 34px;
  line-height: 1;
}

.detail-empty-title {
  margin: 0 0 8px;
  color: #ffffff;
  font-size: 18px;
  font-weight: 800;
}

.detail-empty-text {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  line-height: 1.6;
}

/* =========================================================
   CONTENT CARD LINK FIX
========================================================= */

.content-card--link {
  display: flex;
  flex-direction: column;
  color: inherit !important;
  text-decoration: none !important;
}

.content-card--link:hover,
.content-card--link:focus,
.content-card--link:active,
.content-card--link:visited {
  color: inherit !important;
  text-decoration: none !important;
}

.content-card--link .content-card-title,
.content-card--link .content-card-subtitle,
.content-card--link:hover .content-card-title,
.content-card--link:hover .content-card-subtitle,
.content-card--link:focus .content-card-title,
.content-card--link:focus .content-card-subtitle,
.content-card--link:active .content-card-title,
.content-card--link:active .content-card-subtitle,
.content-card--link:visited .content-card-title,
.content-card--link:visited .content-card-subtitle {
  color: inherit !important;
  text-decoration: none !important;
}

.content-card--link:focus-visible {
  outline: 2px solid rgba(96, 165, 250, 0.85);
  outline-offset: 2px;
}

/* =========================================================
   DETAIL PAGE — LIGHT MODE
========================================================= */

body.theme-light .detail-hero {
  background: #ffffff;
}

body.theme-light .detail-hero-media {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.1)),
    linear-gradient(
      135deg,
      rgba(148, 163, 184, 0.12),
      rgba(203, 213, 225, 0.18)
    );
}

body.theme-light .detail-hero-placeholder {
  color: rgba(71, 85, 105, 0.55);
  background: rgba(148, 163, 184, 0.08);
}

body.theme-light .detail-hero-overlay {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.02) 0%,
    rgba(15, 23, 42, 0.16) 100%
  );
}

body.theme-light .detail-hero-title {
  color: #ffffff;
}

body.theme-light .detail-hero-subtitle {
  color: rgba(255, 255, 255, 0.92);
}

body.theme-light .detail-hero-side {
  background: #eef3fb;
}

/* =========================================================
   TABS
========================================================= */

body.theme-light .detail-tabs-nav {
  border-bottom: 1px solid #dbe4f0;
}

body.theme-light .detail-tab-link {
  background: transparent;
  color: #4b5b74;
}

body.theme-light .detail-tab-link:hover,
body.theme-light .detail-tab-link:focus,
body.theme-light .detail-tab-link:active {
  background: rgba(31, 99, 191, 0.08);
  color: #163250;
}

body.theme-light .detail-tab-link.is-active {
  background: rgba(31, 99, 191, 0.12);
  color: #163250;
}

/* =========================================================
   SECTION
========================================================= */

body.theme-light .detail-section-title,
body.theme-light .detail-subsection-title,
body.theme-light .detail-empty-title {
  color: #163250;
}

body.theme-light .detail-subsection-text {
  color: #5f6f86;
}

body.theme-light .detail-empty-text {
  color: #64748b;
}

body.theme-light .detail-empty-icon {
  color: rgba(100, 116, 139, 0.48);
}

/* =========================================================
   DIVIDER
========================================================= */

body.theme-light .detail-divider {
  border-top-color: #dbe4f0;
}

body.theme-light .detail-divider-danger {
  border-top-color: rgba(220, 38, 38, 0.25);
}

/* =========================================================
   DANGER AREA
========================================================= */

body.theme-light .detail-subsection-danger .detail-subsection-title {
  color: #d92d20;
}

body.theme-light .detail-subsection-danger .btn.btn-danger-outline {
  background: rgba(217, 45, 32, 0.04);
  border-color: rgba(217, 45, 32, 0.35);
  color: #d92d20;
}

body.theme-light .detail-subsection-danger .btn.btn-danger-outline:hover,
body.theme-light .detail-subsection-danger .btn.btn-danger-outline:focus {
  background: rgba(217, 45, 32, 0.08);
  border-color: rgba(180, 35, 24, 0.4);
  color: #b42318;
}

/* =========================================================
   DETAIL CARD
========================================================= */

body.theme-light .detail-tab-panel > .content-card.detail-section-card {
  background: #ffffff;
  border: 1px solid #dbe4f0;

  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

/* =========================================================
   LABEL / HELP TEXT
========================================================= */

body.theme-light .detail-section-card .control-label,
body.theme-light .detail-section-card label.control-label {
  color: #334155;
}

body.theme-light .detail-section-card .help-block,
body.theme-light .detail-section-card small,
body.theme-light .detail-section-card .text-muted {
  color: #718096 !important;
}

/* =========================================================
   CHECKBOX
========================================================= */

body.theme-light .detail-subsection .checkbox label {
  color: #334155;
}

body.theme-light .detail-subsection .checkbox input[type="checkbox"] {
  accent-color: #2563eb;
}

/* =========================================================
   FORM CONTROL
========================================================= */

body.theme-light .detail-section-card .form-control {
  background: #f8fbff;
  border: 1px solid #cfd9e6;

  color: #163250;

  box-shadow: none;
}

body.theme-light .detail-section-card .form-control:focus {
  background: #ffffff;
  border-color: #6aa8ff;

  color: #163250;

  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

body.theme-light .detail-section-card .form-control::placeholder {
  color: #8ca0b8;
}

body.theme-light .detail-section-card select.form-control {
  background-color: #f8fbff;
  color: #163250;
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1199px) {
  .detail-hero-main {
    grid-template-columns: minmax(0, 1fr) 160px;
  }
}

@media (max-width: 991px) {
  .detail-hero-main {
    grid-template-columns: 1fr;
  }

  .detail-hero-media {
    border-top-right-radius: inherit;
    border-bottom-left-radius: 0;
  }

  .detail-hero-side {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    border-top-right-radius: 0;
  }

  .detail-hero-side-inner {
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
  }

  .detail-hero-edit-btn {
    width: auto;
  }

  body.theme-light .detail-hero-side {
    border-top-color: #dbe4f0;
  }
}

@media (max-width: 767px) {
  .detail-hero-media {
    aspect-ratio: 16 / 6;
  }

  .detail-hero-overlay {
    padding: 18px;
  }

  .detail-hero-title {
    font-size: 28px;
  }

  .detail-hero-subtitle {
    font-size: 16px;
  }

  .detail-hero-side-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .detail-tab-panel > .content-card.detail-section-card {
    padding: 20px 18px 24px;
  }

  .detail-form-grid {
    gap: 18px;
  }
}