/* ====== VARIABILI E ROOT ====== */
:root {
  --primary-color: #30589e;
  --primary-hover: #153cb2;
  --bg-main: #f5f8fe;
  --bg-card: #ffffff;
  --bg-sidebar: #fff;
  --bg-content: #f2f5fa;
  /* Versione molto chiara di #30589e (come se fosse al 3% di opacità) */
  --text-dark: #365dd3;
  --text-muted: #666;
  --text-light: #fff;
  --border-radius: 12px;
  --shadow-light: 0 2px 12px rgba(0, 0, 0, 0.06);
  --font-main: "Poppins", sans-serif;
}
/* ====== RESET E BASE ====== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html, body {
  height: 100%;
  min-height: 100%;
  font-family: var(--font-main);
  color: var(--text-dark);
  margin: 0;
  padding: 0;
  overflow-y: hidden; /* Disable page vertical scroll */
  overflow-x: hidden; /* Disable page horizontal scroll */
  background-color: var(--bg-content);
}
body {
  font-family: var(--font-main);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background-color: var(--bg-content);
}
.main-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  overflow-y: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-content);
}
.container {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: none;
  margin: 0;
  overflow-y: hidden;
  padding: 0;
  background-color: var(--bg-content);
}
.dashboard {
  display: flex;
  flex-direction: column;
  padding: 24px 12px;
  background-color: var(--bg-content);
  height: 100vh;
  overflow-y: hidden;
  overflow-x: hidden;
}
/* Card scrollabile solo per Carica Contratti */
.card-scrollable {
  max-height: 70vh;
  display: flex;
  flex-direction: column;
}
.card-scrollable-content {
  max-height: 60vh;
  overflow-y: auto;
  padding-top: 0;
}
/* Utility: allow internal scrolling where needed while page is locked */
.scrollable {
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  max-height: 100%;
}
.card-scrollable .card-header {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 2;
}
/* === MASTERPRODOTTI FLEX LAYOUT === */
/* --- MODALE CONTRATTO: overflow e allineamento valori dinamici --- */
#modal-contratto-dinamico {
  width: 100%;
  max-width: 100%;
}
#modal-contratto-dinamico label {
  display: inline-block;
  min-width: 110px;
  max-width: 180px;
  font-weight: bold;
  vertical-align: top;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#modal-contratto-dinamico span, #modal-contratto-dinamico input[type="text"] {
  display: inline-block;
  max-width: 240px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-all;
  vertical-align: top;
}
#modal-contratto-dinamico div {
  width: 100%;
  box-sizing: border-box;
}
#tabella-ordini-masterprodotti, #tabella-movimenti-stripe {
  width: 100%;
  min-width: 760px;
  font-size: 0.72em;
  table-layout: fixed;
}
#tabella-ordini-masterprodotti th, #tabella-ordini-masterprodotti td, #tabella-movimenti-stripe th, #tabella-movimenti-stripe td {
  padding: 5px 10px;
  min-width: 80px;
  max-width: 1fr;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* larghezza colonne ordini */
#tabella-ordini-masterprodotti th:nth-child(1), #tabella-ordini-masterprodotti td:nth-child(1) {
  width: 11%;
}
#tabella-ordini-masterprodotti th:nth-child(2), #tabella-ordini-masterprodotti td:nth-child(2) {
  width: 21%;
}
#tabella-ordini-masterprodotti th:nth-child(3), #tabella-ordini-masterprodotti td:nth-child(3) {
  width: 13%;
}
#tabella-ordini-masterprodotti th:nth-child(4), #tabella-ordini-masterprodotti td:nth-child(4) {
  width: 21%;
}
#tabella-ordini-masterprodotti th:nth-child(5), #tabella-ordini-masterprodotti td:nth-child(5) {
  width: 14%;
}
/* larghezza colonne stripe */
#tabella-movimenti-stripe th:nth-child(1), #tabella-movimenti-stripe td:nth-child(1) {
  width: 13%;
}
#tabella-movimenti-stripe th:nth-child(2), #tabella-movimenti-stripe td:nth-child(2) {
  width: 19%;
}
#tabella-movimenti-stripe th:nth-child(3), #tabella-movimenti-stripe td:nth-child(3) {
  width: 10%;
}
#tabella-movimenti-stripe th:nth-child(4), #tabella-movimenti-stripe td:nth-child(4) {
  width: 16%;
}
#tabella-movimenti-stripe th:nth-child(5), #tabella-movimenti-stripe td:nth-child(5) {
  width: 11%;
}
#tabella-movimenti-stripe th:nth-child(6), #tabella-movimenti-stripe td:nth-child(6) {
  width: 13%;
}
#tabella-ordini-masterprodotti th {
  font-weight: 700;
}
@media (max-width: 1200px) {
  #tabella-ordini-masterprodotti th, #tabella-ordini-masterprodotti td {
      font-size: 0.68em;
      max-width: 80px;
      min-width: 40px;
 }
}
.masterprodotti-container {
  display: flex;
  max-height: 100vh;
  gap: 32px;
  overflow: auto;
  align-items: flex-start;
  justify-content: space-between;
}
.masterprodotti-card, .movimenti-stripe-card {
  flex: 1 1 0;
  min-width: 500px;
  max-width: 100vw;
  overflow: visible;
  margin-bottom: 0;
  padding: 0;
}
#tabella-ordini-masterprodotti tbody, #tabella-movimenti-stripe tbody {
  display: block;
  max-height: 550px;
  min-width: 760px;
  overflow-y: auto;
}
#tabella-ordini-masterprodotti thead, #tabella-ordini-masterprodotti tbody tr, #tabella-movimenti-stripe thead, #tabella-movimenti-stripe tbody tr {
  display: table;
  width: 100%;
  border-radius: 20px;
  table-layout: fixed;
}
@media (max-width: 1100px) {
  .masterprodotti-container {
      flex-direction: column;
      gap: 20px;
 }
  .masterprodotti-card {
      min-width: unset;
      width: 100%;
 }
}
.dashboard-wrapper {
  display: flex;
  flex-direction: row;
  width: 100%;
  min-height: calc(100vh - 20px);
  margin: 0;
  padding: 0 0 20px 0;
  background-color: var(--bg-content);
  position: relative;
}
/* ====== LAYOUT LOCK: Sidebar fissa e contenuto elastico (coerente su tutte le pagine) ======
   - Imposta una larghezza unica per la sidebar e la blocca con flex-basis/min/max
   - Evita ridimensionamenti quando si cambia sezione o CSS di pagina
*/
:root {
  --sidebar-width: 280px;
}

.dashboard-wrapper > .sidebar {
  box-sizing: border-box !important;
  width: var(--sidebar-width) !important;
  min-width: var(--sidebar-width) !important;
  max-width: var(--sidebar-width) !important;
  flex: 0 0 var(--sidebar-width) !important;
}

.dashboard-wrapper > .main-content {
  flex: 1 1 auto !important;
  min-width: 0 !important; /* Previene overflow e salti layout */
}

/* Evita che elementi interni allarghino la sidebar */
.sidebar .sidebar-logo img,
.sidebar .icon,
.sidebar .sidebar-menu a {
  max-width: calc(var(--sidebar-width) - 40px) !important;
  overflow: hidden !important;
}
/* ====== SIDEBAR ====== */
.sidebar {
  width: 280px;
  background-color: var(--bg-sidebar);
  color: var(--text-light);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px 0;
  min-height: calc(100vh - 40px) !important;
  height: calc(100vh - 40px) !important;
  border-radius: 16px;
  border-right: none;
  margin: 20px 0 20px 20px;
}
.sidebar-logo {
  text-align: center;
  padding: 0;
  width: 100%;
}
.sidebar-logo img {
  width: 230px;
}
.sidebar-menu {
  width: 100%;
  margin-top: 15px;
}
.sidebar-menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
}
.sidebar-menu li {
  margin: 8px 0;
  width: 100%;
  position: relative;
}
.sidebar-menu li:first-child {
  margin-top: 0;
}
.sidebar-menu a {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 15px;
  font-size: 16px;
  color: var(--primary-color);
  text-decoration: none;
  border-radius: 8px;
  margin: 2px 15px;
  transition: all 0.2s ease;
  font-weight: 500;
  width: calc(100% - 30px);
}
.sidebar-menu li.active a {
  background-color: rgba(48, 88, 158, 0.08);
  color: var(--primary-color);
  font-weight: 600;
}
.sidebar-menu li.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 70%;
  width: 3px;
  background-color: var(--primary-color);
  border-radius: 0;
}
.sidebar-menu a:hover:not(.sidebar-menu li.active a) {
  background-color: rgba(48, 88, 158, 0.03);
  color: var(--primary-color);
}
.sidebar-menu .icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  opacity: 0.9;
  min-width: 28px;
  background-color: rgba(48, 88, 158, 0.1);
  border-radius: 8px;
  padding: 8px;
}
.sidebar-menu li.active .icon {
  opacity: 1;
  background-color: rgba(48, 88, 158, 0.2);
}
.sidebar-menu .icon img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  filter: brightness(0.2) sepia(1) hue-rotate(190deg) saturate(3);
}
.sidebar-bottom {
  width: 100%;
  padding: 15px;
  margin-bottom: -30px;
}
/* Chatbot Promo Banner */
.chatbot-promo {
  background: linear-gradient(135deg, rgba(48, 88, 158, 0.05), rgba(48, 88, 158, 0.15));
  border-radius: 16px;
  padding: 24px 18px;
  margin: 0 0 20px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 8px 20px rgba(48, 88, 158, 0.08);
}
/* Decoration elements */
.chatbot-promo-decoration {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}
.deco-circle {
  position: absolute;
  border-radius: 50%;
  opacity: 0.05;
  background: var(--primary-color);
}
.deco-circle-1 {
  width: 180px;
  height: 180px;
  top: -110px;
  left: -70px;
}
.deco-circle-2 {
  width: 140px;
  height: 140px;
  bottom: -60px;
  right: -40px;
}
.deco-line {
  position: absolute;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(48, 88, 158, 0.2), transparent);
  transform: rotate(-45deg);
}
.deco-line-1 {
  width: 200px;
  top: 30%;
  left: -30px;
}
.deco-line-2 {
  width: 150px;
  bottom: 25%;
  right: -20px;
  transform: rotate(45deg);
}
.deco-dot {
  position: absolute;
  border-radius: 50%;
  background-color: var(--primary-color);
}
.deco-dot-1 {
  width: 6px;
  height: 6px;
  top: 20%;
  right: 15%;
  opacity: 0.2;
}
.deco-dot-2 {
  width: 10px;
  height: 10px;
  bottom: 35%;
  left: 10%;
  opacity: 0.15;
}
.deco-dot-3 {
  width: 4px;
  height: 4px;
  top: 60%;
  right: 30%;
  opacity: 0.25;
}
/* Bot graphic */
.chatbot-promo-graphic {
  position: relative;
  height: 100px;
  width: 100%;
  display: flex;
  justify-content: center;
  z-index: 2;
}
.chatbot-icon-circle {
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, var(--primary-color), #2045a5);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(48, 88, 158, 0.3), 0 0 0 6px rgba(48, 88, 158, 0.08);
  z-index: 3;
  animation: pulse 3s infinite;
}
@keyframes pulse {
  0% {
      box-shadow: 0 6px 16px rgba(48, 88, 158, 0.3), 0 0 0 0 rgba(48, 88, 158, 0.15);
 }
  70% {
      box-shadow: 0 6px 16px rgba(48, 88, 158, 0.3), 0 0 0 10px rgba(48, 88, 158, 0);
 }
  100% {
      box-shadow: 0 6px 16px rgba(48, 88, 158, 0.3), 0 0 0 0 rgba(48, 88, 158, 0);
 }
}
.chatbot-face {
  width: 38px;
  height: 38px;
  fill: none;
  stroke: white;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* Robot components */
.robot-head {
  fill: rgba(255,255,255,0.15);
  stroke: white;
}
.chatbot-eye {
  fill: white;
  animation: blink 3s infinite;
}
@keyframes blink {
  0% {
      transform: scale(1);
 }
  95% {
      transform: scale(1);
 }
  97% {
      transform: scale(1, 0.1);
 }
  99% {
      transform: scale(1);
 }
}
.robot-mouth {
  fill: white;
  stroke: none;
}
/* Antenne */
.antenna {
  stroke: white;
  stroke-width: 1.5;
}
.antenna-ball {
  fill: white;
  stroke: none;
}
.antenna-left {
  animation: wiggleLeft 2s ease-in-out infinite;
}
.antenna-ball-left {
  animation: glowLeft 2s ease-in-out infinite;
}
.antenna-right {
  animation: wiggleRight 2.5s ease-in-out infinite;
}
.antenna-ball-right {
  animation: glowRight 2.5s ease-in-out infinite;
}
@keyframes wiggleLeft {
  0% {
      transform: rotate(0deg);
      transform-origin: bottom;
 }
  25% {
      transform: rotate(-5deg);
      transform-origin: bottom;
 }
  50% {
      transform: rotate(0deg);
      transform-origin: bottom;
 }
  75% {
      transform: rotate(5deg);
      transform-origin: bottom;
 }
  100% {
      transform: rotate(0deg);
      transform-origin: bottom;
 }
}
@keyframes wiggleRight {
  0% {
      transform: rotate(0deg);
      transform-origin: bottom;
 }
  25% {
      transform: rotate(5deg);
      transform-origin: bottom;
 }
  50% {
      transform: rotate(0deg);
      transform-origin: bottom;
 }
  75% {
      transform: rotate(-5deg);
      transform-origin: bottom;
 }
  100% {
      transform: rotate(0deg);
      transform-origin: bottom;
 }
}
@keyframes glowLeft {
  0% {
      opacity: 1;
 }
  50% {
      opacity: 0.6;
      r: 0.8;
 }
  100% {
      opacity: 1;
 }
}
@keyframes glowRight {
  0% {
      opacity: 0.6;
      r: 0.8;
 }
  50% {
      opacity: 1;
      r: 1.2;
 }
  100% {
      opacity: 0.6;
      r: 0.8;
 }
}
.chatbot-bubble {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  z-index: 2;
  font-weight: 700;
  color: var(--primary-color);
  background: white;
  box-shadow: 0 4px 8px rgba(0,0,0,0.08);
  animation: float 4s infinite ease-in-out;
}
.chatbot-bubble:nth-child(odd) {
  animation-delay: 0.5s;
}
@keyframes float {
  0% {
      transform: translateY(0);
 }
  50% {
      transform: translateY(-10px);
 }
  100% {
      transform: translateY(0);
 }
}
.chatbot-bubble {
  width: 36px;
  height: 36px;
  right: 60px;
  top: 20px;
  font-size: 12px;
}
.chatbot-bubble-small {
  width: 26px;
  height: 26px;
  right: 40px;
  top: 5px;
  font-size: 10px;
  animation-delay: 0.7s;
  animation-duration: 3.5s;
}
.chatbot-bubble-xs {
  width: 20px;
  height: 20px;
  left: 50px;
  top: 30px;
  font-size: 10px;
  animation-delay: 1.2s;
  animation-duration: 3s;
}
.chatbot-promo-text {
  font-weight: 600;
  font-size: 18px;
  color: var(--primary-color);
  margin-bottom: 15px;
  margin-top: -15px;
  text-align: center;
  z-index: 2;
  letter-spacing: 0.3px;
  line-height: 1.4;
  text-shadow: 0 1px 0 rgba(255,255,255,0.8);
  position: relative;
}
.text-highlight {
  position: relative;
  font-weight: 700;
  color: var(--primary-hover);
}
.text-highlight::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color), transparent);
  border-radius: 3px;
}
.text-gradient {
  font-weight: 800;
  color: var(--primary-color);
  position: relative;
  background: linear-gradient(135deg, #1334a0, #4b77de);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
}
.text-dot {
  display: inline-block;
  font-weight: 700;
  color: var(--primary-color);
  margin-left: 2px;
  font-size: 20px;
  position: relative;
  top: 2px;
}
.chatbot-promo-button {
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px 20px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 10px rgba(48, 88, 158, 0.2);
  width: 100%;
  z-index: 2;
  font-family: var(--font-main);
 /* Poppins font */
  letter-spacing: 0.5px;
}
.chatbot-promo-button:hover {
  background: var(--primary-hover);
  box-shadow: 0 5px 12px rgba(48, 88, 158, 0.25);
}
/* ====== MAIN CONTENT ====== */
.main-content {
  flex: 1;
  padding: 24px;
  background: var(--bg-content);
  overflow-y: hidden;
  max-height: 100vh;
  width: 100%;
  margin-bottom: 20px;
  box-sizing: border-box;
}
/* Reset completo per il container principale */
.welcome-container {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-top: -10px;
    margin-bottom: 27px;
    flex-wrap: nowrap !important;
    gap: 15px !important;
    width: 100% !important;
    height: auto !important;
  }
  
  /* Force consistent sidebar height on attivazioni and assistenza pages */
  .attivazioni-page .sidebar,
  body.attivazioni-page .sidebar,
  .attivazioni-page #sidebar,
  body.attivazioni-page #sidebar,
  .assistenza-page .sidebar,
  body.assistenza-page .sidebar,
  .assistenza-page #sidebar,
  body.assistenza-page #sidebar {
    min-height: calc(100vh - 40px) !important;
    height: calc(100vh - 40px) !important;
  }
.welcome-card, .credito-card, .logout-card {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  background-color: white;
  border-radius: 12px;
  padding: 14px 20px;
  box-shadow: 0 4px 12px rgba(48, 88, 158, 0.08);
  border: 1px solid rgba(48, 88, 158, 0.06);
  transition: all 0.25s ease;
  height: auto;
  box-sizing: border-box;
}
.welcome-card:hover, .credito-card:hover, .logout-card:hover {
  box-shadow: 0 6px 16px rgba(48, 88, 158, 0.12);
  transform: translateY(-2px);
}
.welcome-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 10px;
  background: #30589e;
  color: white;
  flex-shrink: 0;
}
.welcome-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  line-height: 1.2;
}
.welcome-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: #667085;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: -8px;
  margin-bottom: -2px;
}
.welcome {
  font-size: 0.8rem;
  font-weight: 600;
  margin: 0;
  padding: 0;
  color: #000000;
  line-height: 1;
  white-space: nowrap;
}
.welcome-name {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  color: var(--primary-color);
  line-height: 1.2;
  margin-bottom: -1.1vh;
}
.credito-section, .logout-section {
  display: flex;
  align-items: center;
  margin: 0;
  justify-content: center;
  gap: 1rem;
  height: auto;
}
/* Card styles già definiti nella regola combinata sopra */
/* Hover già definito nella regola combinata */
.credito-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 10px;
  background: #30589e;
  color: white;
  flex-shrink: 0;
}
.credito-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.credito-label {
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: -7px;
  color: #667085;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.credito-amount {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  letter-spacing: 0.5px;
}
.btn-ricarica {
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 16px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-main);
  box-shadow: 0 2px 6px rgba(48, 88, 158, 0.2);
}
.btn-ricarica:hover {
  background-color: var(--primary-hover);
}
.btn-ricarica:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  background-color: #9aa8d0;
  box-shadow: none;
}
.cards-container {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 20px;
  margin: 0;
  height: 100%;
}
/* Logout section già definita nella regola combinata sopra */
.logout-card {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  background-color: white;
  border-radius: 12px;
  padding: 12px 20px;
  box-shadow: 0 4px 12px rgba(48, 88, 158, 0.08);
  border: 1px solid rgba(48, 88, 158, 0.06);
  transition: all 0.25s ease;
}
.logout-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 10px;
  background: #d32f2f;
  color: white;
  flex-shrink: 0;
}
.btn-logout {
  background-color: #d32f2f;
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 14px 20px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-main);
  box-shadow: 0 4px 12px rgba(211, 47, 47, 0.2);
  height: 100%;
  width: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-logout:hover {
  background-color: #b71c1c;
}
.btn-logout:active {
  transform: translateY(1px);
  box-shadow: 0 1px 3px rgba(211, 47, 47, 0.2);
}
.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ================================================================
MODIFICA CARD E TABELLE
Le sezioni seguenti sono state modificate per corrispondere a style_vecchio.css
================================================================
*/

/* ====== CARD GENERICA (MODIFICATA) ====== */
.new-card {
  background: #fff;
  border-radius: 20px;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
  /* MODIFICATO: Altezza fissa come nel vecchio CSS */
  height: 367px; 
}
.new-card:hover {
  transform: translateY(-4px);
}

/* === HEADER DELLA CARD === */
.card-header {
  padding: 5px 5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-title {
  font-size: 2em; /* Dimensione standardizzata dal vecchio file */
  font-weight: 700;
  color: #30589e;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Poppins", sans-serif;
  letter-spacing: 0.5px;
  position: relative;
  text-shadow: 0 1px 0 #f3f4f6, 0 2px 8px rgba(30,77,219,0.07);
}

/* === SELETTORE OPERATORE === */
.operatore-select-wrapper {
  margin-left: auto;
}
#operatore-select {
  background: #f0f4ff;
  border: 1px solid #c9d7f5;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.95rem;
  color: #1e4ddb;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s;
}
#operatore-select:focus {
  border-color: #1e4ddb;
  outline: none;
}
/* === Celle cliccabili per ultime attivazioni e ultimi ordini (dashboard dealer) */
.clickable-table-cell {
  cursor: pointer;
}

/* === RESPONSIVE DASHBOARD (MODIFICATO) === */
/* Evita barra di scorrimento orizzontale (lateral) su dashboard */
html, body {
  overflow-x: hidden;
}
.dashboard-grid {
  display: grid;
  /* Layout a griglia 2x2 (due card sopra e due sotto) */
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 12px;
}

/* Layout specifico per la dashboard principale - Con posizionamento esplicito */
.new-dashboard-grid,
.dashboard-grid.new-dashboard-grid {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  grid-template-rows: auto auto !important;
  grid-template-areas: 
    "attivazioni ordini"
    "obiettivi andamento" !important;
  gap: 24px !important;
  width: 100% !important;
}

/* Posizionamento esplicito delle card */
#attivazioni-card-generica {
  grid-area: attivazioni !important;
}

.ordini-card {
  grid-area: ordini !important;
}

#obiettivi-card, 
#dashboard-dealer #obiettivi-container {
  grid-area: obiettivi !important;
}

#andamento-mensile-dealer {
  grid-area: andamento !important;
}

/* Forza le card ad adattarsi alla griglia */
.dashboard-grid.new-dashboard-grid > section.card {
  width: 100% !important;
  max-width: none !important;
  margin-right: 0 !important;
  box-sizing: border-box !important;
}

/* Impone una larghezza massima consistente per tutte le pagine */
.dashboard-grid.new-dashboard-grid {
  width: 100%;
  margin: 0;
  padding: 0;
  max-width: none;
}

/* Standardizzazione degli stili interni delle card */
.dashboard-grid .card,
.card.new-card {
  padding: 20px;
  font-family: 'Poppins', sans-serif;
}

/* Stili specifici per la dashboard dell'agente */
#dashboard-agente {
  width: 100% !important;
  max-width: 100% !important;
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  grid-template-rows: auto auto !important;
  grid-gap: 24px !important;
  margin-bottom: 24px !important;
}

/* Posizionamento esplicito delle card nella dashboard agente */
#dashboard-agente > section:first-child {
  grid-column: 1 / 2;
  grid-row: 1 / 2;
}

#dashboard-agente > #future-card-placeholder {
  grid-column: 2 / 3;
  grid-row: 1 / 2;
}

#dashboard-agente > #obiettivi-agente {
  grid-column: 1 / 2;
  grid-row: 2 / 3;
}

#dashboard-agente > #andamento-mensile-agente {
  grid-column: 2 / 3;
  grid-row: 2 / 3;
}

/* Assicura che tutte le card abbiano la stessa larghezza */
#dashboard-agente > section,
.card.new-card,
section.card.card-large {
  width: 100% !important;
  box-sizing: border-box !important;
  margin-right: 0 !important;
  margin-bottom: 0 !important;
}

/* Aggiunta di scorrimento verticale per le tabelle nelle card di attivazioni e ordini */
#attivazioni-card-generica .table-container,
.ordini-card .table-container,
.attivazioni-card .table-container {
  max-height: 40px;
  overflow-y: auto;
  margin-bottom: 5px;
  scrollbar-width: thin;
  scrollbar-color: rgba(30, 77, 219, 0.3) rgba(240, 240, 240, 0.5);
}

.attiva-card .form-container {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.attiva-card .table-container {
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 5px;
  scrollbar-width: thin;
  scrollbar-color: rgba(30, 77, 219, 0.3) rgba(240, 240, 240, 0.5);
}

/* Stile della barra di scorrimento per Chrome, Edge e Safari */
#attivazioni-card-generica .table-container::-webkit-scrollbar,
.ordini-card .table-container::-webkit-scrollbar,
.attiva-card .table-container::-webkit-scrollbar {
  width: 6px;
}

#attivazioni-card-generica .table-container::-webkit-scrollbar-track,
.ordini-card .table-container::-webkit-scrollbar-track,
.attiva-card .table-container::-webkit-scrollbar-track {
  background: rgba(240, 240, 240, 0.5);
  border-radius: 3px;
}

#attivazioni-card-generica .table-container::-webkit-scrollbar-thumb,
.ordini-card .table-container::-webkit-scrollbar-thumb,
.attiva-card .table-container::-webkit-scrollbar-thumb {
  background-color: rgba(30, 77, 219, 0.3);
  border-radius: 3px;
}

/* Uniformità delle tabelle in tutte le card */
/* --- Dealer dashboard: usa paginazione, niente scrollbar verticali nelle card --- */
#dashboard-dealer .attivazioni-card .table-container,
#dashboard-dealer .ordini-card .table-container {
  max-height: none !important;
  overflow-y: visible !important;
}
.dashboard-grid .card table {
  font-family: 'Poppins', sans-serif;
  margin-top: 10px;
  margin-bottom: 5px;
}

/* Uniformità dei font nelle intestazioni delle tabelle */
.dashboard-grid .card table th {
  font-size: 0.78rem;
  font-weight: 600;
  color: #243559;
  padding: 10px 12px;
}

/* Uniformità del colore del testo nelle celle */
.dashboard-grid .card table td {
  color: #1f2532;
  padding: 10px 12px;
  text-transform: uppercase;
}

/* Uniformità dell'altezza delle righe */
.dashboard-grid .card table tr {
  height: 40px;
}

/* ================= Bootstrap integration overrides (index) ================= */
/* When we use Bootstrap grid on the dashboard wrapper, do NOT enforce the
   legacy fixed sidebar width and flex-based sizing. Let the .col-* classes win. */
.dashboard-wrapper.row > .sidebar {
  width: auto !important;
  min-width: 0 !important;
  max-width: 100% !important;
  flex: 0 0 auto !important;
  /* Remove extra left margin used by legacy flex layout */
  margin: 20px 0 !important;
}
.dashboard-wrapper.row > .main-content {
  flex: 0 0 auto !important;
  min-width: 0 !important;
  /* Allow vertical scrolling for content area on index */
  overflow-y: auto !important;
  max-height: calc(100vh - 40px) !important;
}


/* ================================================================
INIZIO BLOCCO TABELLE UNIFICATO
Tutti gli stili per le tabelle sono stati SOSTITUITI con questo blocco 
preso da style_vecchio.css per coerenza e correttezza.
================================================================
*/

/* === CONTENITORE TABELLA === */
.new-table-container {
  padding-left: 20px;
  padding-right: 20px;
  padding-bottom: 20px;
  margin-left: -4px;
  overflow: hidden
}

/* === TABELLA PROFESSIONALE PREMIUM === */
.new-table,
#tabella-ordi.new-table,
.attiva-table,
.card table {
  font-family: 'Poppins', sans-serif;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #ffffff;
  font-size: 0.78rem;
  color: #1f2532;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
  line-height: 1.352;
  table-layout: auto;
}

/* === INTESTAZIONE TABELLA === */
.new-table thead,
#tabella-ordini thead,
#tabella-attivazioni thead,
.card table thead {
  background: #f1f4fb;
}

.new-table thead th,
#tabella-ordini thead th,
#tabella-attivazioni thead th {
  padding: 8px 12px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #30589e;
  text-align: left;
  background: linear-gradient(180deg, #f1f5fc, #e9f0fc);
  white-space: nowrap;
}

/* === RIGHE === */
.new-table tbody tr:nth-child(even),
#tabella-ordini tbody tr:nth-child(even),
#tabella-attivazioni tbody tr:nth-child(even) {
  background-color: #f9fbfd;
}

.new-table tbody tr:hover,
#tabella-ordini tbody tr:hover,
#tabella-attivazioni tbody tr:hover,
.card table tbody tr:hover {
  background-color: #eef3ff;
}

/* === CELLE === */
.new-table tbody td,
#tabella-ordini tbody td,
#tabella-attivazioni tbody td,
.card table tbody td {
  padding: 6px 12px;
  font-size: 0.78rem;
  color: #2e3547;
  vertical-align: middle;
  white-space: nowrap;
  line-height: 1.3;
}

/* === BORDI ARROTONDATI === */
.new-table thead th:first-child,
#tabella-ordini thead th:first-child,
#tabella-attivazioni thead th:first-child {
  border-top-left-radius: 12px;
}
.new-table thead th:last-child,
#tabella-ordini thead th:last-child,
#tabella-attivazioni thead th:last-child {
  border-top-right-radius: 12px;
}
.new-table tbody tr:last-child td:first-child,
#tabella-ordini tbody tr:last-child td:first-child,
#tabella-attivazioni tbody tr:last-child td:first-child {
  border-bottom-left-radius: 12px;
}
.new-table tbody tr:last-child td:last-child,
#tabella-ordini tbody tr:last-child td:last-child,
#tabella-attivazioni tbody tr:last-child td:last-child {
  border-bottom-right-radius: 12px;
}

/* ================================================================
FINE BLOCCO TABELLE UNIFICATO
Il resto del file continua con gli stili originali di style_nuovo.css
================================================================
*/


/* ====== MODALE CONTRATTO ====== */
.modal-contratto-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}
.modal-contratto-overlay[style*="display: flex"] {
  animation: fadeIn 0.2s ease-out;
}
.modal-contratto-content {
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 5px 25px rgba(0,0,0,0.18);
  width: 100%;
  max-width: 700px;
  min-width: 320px;
  max-height: 90vh;
  margin: 0 12px;
  padding: 32px 28px 24px 28px;
  display: block;
  overflow-y: auto;
  overflow-x: hidden;
}
@media (max-width: 600px) {
  .modal-contratto-content {
      max-width: 98vw;
      min-width: unset;
      padding: 18px 6px 14px 6px;
 }
}
@keyframes slideIn {
  from {
      transform: translateY(-20px);
      opacity: 0;
 }
  to {
      transform: translateY(0);
      opacity: 1;
 }
}
.modal-contratto-title {
  margin: 0;
  padding: 20px 25px;
  font-size: 18px;
  font-weight: 600;
  color: #333;
  border-bottom: none;
  flex-shrink: 0;
}
.modal-contratto-body {
  padding: 20px 30px 25px;
  flex-grow: 1;
}
.modal-contratto-label {
  font-size: 12px;
  text-transform: uppercase;
  color: #666;
  font-weight: 600;
  margin-bottom: 5px;
  letter-spacing: 0.5px;
}
.modal-contratto-dealer {
  font-size: 16px;
  font-weight: 500;
  color: #333;
  margin-bottom: 20px;
}
.modal-contratto-row {
  display: flex;
  margin: 0 -10px 20px;
}
.modal-contratto-col {
  padding: 0 10px;
  flex: 1;
}
.modal-contratto-col div:not(.modal-contratto-label) {
  font-size: 15px;
  color: #444;
}
/* Stili per i dettagli attivazione nella modale */
.dettaglio-attivazione {
  display: flex;
  margin-bottom: 8px;
  padding: 0 10px;
}
.dettaglio-attivazione-label {
  font-size: 13px;
  font-weight: 600;
  color: #555;
  min-width: 140px;
  padding-right: 15px;
}
.dettaglio-attivazione-valore {
  font-size: 13px;
  color: #333;
  flex-grow: 1;
}
.dettagli-sezione {
  margin-bottom: 15px;
  border-bottom: none;
  padding-bottom: 10px;
}
.dettagli-sezione:last-child {
  border-bottom: none;
}
.modal-contratto-documento {
  display: block;
  color: #3366cc;
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 20px;
  word-break: break-all;
}
.modal-contratto-documento:hover {
  text-decoration: underline;
}
.modal-contratto-titolo {
  display: inline-block;
  background-color: #3366cc;
  color: white;
  padding: 5px 10px;
  border-radius: 0;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 15px;
}
.modal-contratto-note-container {
  margin-top: 15px;
  border-top: none;
  padding-top: 15px;
}
.modal-contratto-note {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 0;
  resize: vertical;
  font-family: inherit;
  font-size: 14px;
  margin: 8px 0 15px;
  box-sizing: border-box;
}
.modal-contratto-conferma {
  background-color: #3366cc;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 10px 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
  font-size: 14px;
}
.modal-contratto-conferma:hover {
  background-color: #2955aa;
}
.modal-contratto-footer {
  padding: 15px 25px;
  border-top: 1px solid #eaeaea;
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
}
.modal-contratto-chiudi {
  background-color: #f0f0f0;
  color: #333;
  border: none;
  border-radius: 4px;
  padding: 10px 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
  font-size: 14px;
}
.modal-contratto-chiudi:hover {
  background-color: #e0e0e0;
}

/* Evidenziazione forte per i pulsanti "Chiudi" nelle modali (override inline) */
#modal-contratto #btn-chiudi-modale-contratto,
#modal-contratto-master #btn-chiudi-modale-contratto-master {
  background-color: #1f57c3 !important; /* blu primario */
  color: #ffffff !important;
  border: 1px solid #1848a5 !important;
  font-weight: 700;
  padding: 10px 22px !important;
  border-radius: 8px !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10) !important;
  cursor: pointer !important;
}
#modal-contratto #btn-chiudi-modale-contratto:hover,
#modal-contratto-master #btn-chiudi-modale-contratto-master:hover {
  background-color: #1848a5 !important;
  border-color: #153e8f !important;
}

/* ====== BOTTONI GENERICI (MODALI E UI) ======
   Migliora visibilità dei pulsanti come "CHIUDI" nelle modali
============================================================== */
.btn-primary {
  background-color: #30589e;
  color: #ffffff;
  border: 1px solid #2a4f90;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(48, 88, 158, 0.2);
  transition: background-color 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.btn-primary:hover {
  background-color: #264b98;
  box-shadow: 0 3px 8px rgba(48, 88, 158, 0.25);
}
.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  background-color: #9aa8d0;
  border-color: #8c9cc6;
  box-shadow: none;
}

.btn-secondary {
  background-color: #eef2f7;
  color: #1f2937;
  border: 1px solid #cbd5e1; /* visibilità su sfondi chiari */
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.btn-secondary:hover {
  background-color: #e2e8f0;
  border-color: #94a3b8;
}

.btn-primary:focus,
.btn-secondary:focus {
  outline: 3px solid rgba(48, 88, 158, 0.35);
  outline-offset: 2px;
}

/* === CREDITI / VALORI NUMERICI === */
.credito-plafond-valore {
  font-size: 5.2rem;
  font-weight: 700;
  color: #1e4ddb;
  padding: 24px 28px 16px;
  text-align: center;
}
/* Pulsante Ricarica */
.credito-plafond-actions {
  padding: 0 28px 28px;
  text-align: center;
}
.btn-ricarica:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(30, 77, 219, 0.2);
}
.btn-ricarica-icon {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1;
}

@media (max-width: 768px) {
  .card-header {
      flex-direction: column;
      align-items: flex-start;
      gap: 8px;
      padding: 18px 20px;
 }
  .new-table-container {
      padding: 18px 20px;
 }
  .credito-plafond-valore {
      padding: 20px;
 }
}
/* ====== SELECT, INPUT, BUTTON ====== */
select, input[type="text"], input[type="email"], input[type="password"] {
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  border: none;
  font-size: 1rem;
  margin-top: 6px;
}
button {
  padding: 10px 16px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  transition: background 0.3s;
}
button:hover {
  opacity: 0.95;
}
button.attiva-offerta-btn, .login-btn, #send-chatbox, #checkout-btn {
  background-color: var(--primary-color);
  color: #fff;
}
button.attiva-offerta-btn:hover, .login-btn:hover, #send-chatbox:hover, #checkout-btn:hover {
  background-color: var(--primary-hover);
}

/* Stato badge */
.stato-badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
}
.stato-badge.success {
  background: #d4edda;
  color: #155724;
}
.stato-badge.warning {
  background: #fff3cd;
  color: #856404;
}
.stato-badge.danger {
  background: #f8d7da;
  color: #721c24;
}
.stato-badge.info {
  background: #d1ecf1;
  color: #0c5460;
}
.stato-badge.secondary {
  background: #e2e3e5;
  color: #383d41;
}
/* ====== GRIGLIA OFFERTE ====== */
.offerte-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-left: 3vh;
  margin-right: 3vh;
  margin-bottom: 3vh;
}
/* ====== CARD OFFERTA ====== */
.offerta-card {
  background: #fff;
  border-radius: var(--border-radius);
  padding: 20px;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}
.offerta-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}
.offerta-card.selezionata {
  border: 2px solid var(--primary-color);
  box-shadow: 0 0 0 4px rgba(30, 77, 219, 0.2);
}
.offerta-card h3 {
  font-size: 1.1rem;
  font-family: 'Noto Sans', sans-serif;
  margin: 10px 0;
}
.offerta-card p {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-family: 'Noto Sans', sans-serif;
  margin-bottom: 12px;
}
.offerta-card strong {
  display: block;
  margin-bottom: 10px;
  font-weight: bold;
  font-family: 'Noto Sans', sans-serif;
  color: var(--primary-color);
}
/* ====== FORM DINAMICO ====== */
#form-dinamico {
  max-height: 900px;
  overflow-y: auto;
 /* Aggiunto più spazio in alto per il pulsante di chiusa */
  position: relative;
 /* Per posizionare il pulsante di chiusa */
  background: #fff;
  margin-top: -30px;
  margin-bottom: 125px;
  border-radius: 8px;
}
#form-attivazione {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 5px;
}
.form-group {
  display: flex;
  flex-direction: column;
  font-family: 'Noto Sans', sans-serif;
  gap: 4px;
  margin-bottom: 8px;
}
.form-group label {
  font-weight: 500;
  font-size: 1rem;
  font-family: 'Noto Sans', sans-serif;
  color: #333;
}
.form-group input, .form-group select {
  padding: 10px 12px;
  font-family: 'Noto Sans', sans-serif;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.9rem;
  background-color: #fff;
  transition: border-color 0.2s;
}
.form-group input:focus, .form-group select:focus {
  border-color: #1e4ddb;
  outline: none;
  box-shadow: 0 0 0 2px rgba(30, 77, 219, 0.1);
}
/* ====== FORM BUTTON ====== */
#form-attivazione button[type="submit"], #form-attivazione button[type="button"] {
  background: var(--primary-color);
  color: #fff;
  border: none;
  padding: 10px 16px;
  font-size: 0.95rem;
  font-weight: 500;
  font-family: 'Noto Sans', sans-serif;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 8px;
  transition: all 0.2s ease;
  align-self: flex-start;
  min-width: 120px;
  text-align: center;
}
#form-attivazione button[type="submit"]:hover, #form-attivazione button[type="button"]:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
/* Stile per i file input */
.form-group input[type="file"] {
  padding: 6px 8px;
  border: 1px dashed #ccc;
  background-color: #f9f9f9;
}
.form-group input[type="file"]:focus {
  border-color: #1e4ddb;
  background-color: #f0f5ff;
}
/* Stile per i checkbox */
.form-group input[type="checkbox"] {
  width: auto;
  margin-right: 8px;
  transform: scale(1.1);
}
/* Selettore per i campi obbligatori */
.form-group.required label:after {
  content: " *";
  color: #e74c3c;
}
/* ====== ALERT / ERROR ====== */
.alert {
  background: #ffe9e9;
  border-left: 4px solid #ff4d4d;
  padding: 12px 16px;
  border-radius: 8px;
  color: #a94442;
  font-weight: 500;
  margin-top: 16px;
}
/* ====== SCROLL WRAPPER ====== */
#offerte-grid-wrapper {
  max-height: 480px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--primary-color) transparent;
}
#offerte-grid-wrapper::-webkit-scrollbar {
  width: 6px;
}
#offerte-grid-wrapper::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 6px;
}
/* ====== RESPONSIVE DESIGN ENTERPRISE ====== */
/* Mobile First - Preserva la bellezza del design attuale */

/* Small Laptops: 768px - 1366px (include 1280x1024, 1366x768) */
@media (max-width: 1366px) and (min-width: 768px) {
  .sidebar {
    width: 200px !important;
    margin: 20px 0 20px 15px;
  }
  
  .main-content {
    padding: 20px 15px;
    /* Rimuovo margin-left fisso - il flexbox gestisce automaticamente lo spazio */
  }
  
  .sidebar-menu a {
    padding: 10px 14px;
    font-size: 13px;
  }
  
  .sidebar-logo img {
    max-width: 160px;
  }
  
  .sidebar-logo {
    margin-bottom: 15px;
  }
  
  /* Assicura che il dashboard wrapper usi correttamente il flexbox */
  .dashboard-wrapper {
    display: flex !important;
    flex-direction: row !important;
  }
  
  /* Ottimizza la top bar per schermi medi */
  /* Ottimizza il blocco credito */
  
  /* Riduce i font dei titoli delle card per small laptops */
  
  /* Riduce i font delle tabelle */
  .new-table th {
    font-size: 0.75rem !important;
    padding: 8px 6px !important;
  }
  
  .new-table td {
    font-size: 0.7rem !important;
    padding: 8px 6px !important;
  }
  
  /* Riduce drasticamente il nome dealer */
  /* Ottimizza i titoli delle sezioni */
  h1, h2, h3 {
    font-size: 1.2rem !important;
  }
  
  /* Riduce padding delle card per recuperare spazio */
  .card {
    padding: 16px !important;
  }
  
  .card-header {
    margin-bottom: 12px !important;
  }
  
  /* Fix dashboard grid per evitare sovrapposizioni */
  .dashboard-grid,
  .new-dashboard-grid,
  .dashboard-grid.new-dashboard-grid {
    gap: 12px !important;
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows: auto auto !important;
  }
  
  /* Assicura che le card non si sovrappongano */
  .dashboard-grid .card,
  .dashboard-grid section.card {
    min-width: 0 !important;
    overflow: hidden !important;
  }
  
  /* Ottimizza le tabelle per evitare overflow */
  .new-table {
    table-layout: fixed !important;
    width: 100% !important;
  }
  
  .new-table th,
  .new-table td {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    max-width: 0 !important;
  }
  
  /* Distribuisce le colonne in modo più equilibrato */
  .new-table th:first-child,
  .new-table td:first-child {
    width: 15% !important;
  }
  
  .new-table th:nth-child(2),
  .new-table td:nth-child(2) {
    width: 25% !important;
  }
  
  .new-table th:nth-child(3),
  .new-table td:nth-child(3) {
    width: 15% !important;
  }
  
  .new-table th:nth-child(4),
  .new-table td:nth-child(4) {
    width: 20% !important;
  }
  
  .new-table th:nth-child(5),
  .new-table td:nth-child(5) {
    width: 15% !important;
  }
  
  .new-table th:nth-child(6),
  .new-table td:nth-child(6) {
    width: 10% !important;
  }
  
  /* Forza visibilità della card grafico */
  #andamento-mensile-agente {
    min-height: 300px !important;
    overflow: visible !important;
  }
}

/* Medium Laptops: 1367px - 1600px (include 1440x900, 1536x864) */
@media (min-width: 1367px) and (max-width: 1600px) {
  .sidebar {
    width: 240px !important;
    margin: 20px 0 20px 20px;
  }
  
  .main-content {
    padding: 24px 20px;
  }
  
  .sidebar-menu a {
    padding: 12px 16px;
    font-size: 14px;
  }
  /* Top bar ottimizzata per schermi medi */
}

/* Large Desktop: 1920x1080+ - Full experience */
@media (min-width: 1920px) {
  .sidebar {
    width: 280px !important;
    margin: 20px 0 20px 20px;
  }
  
  .sidebar-menu a {
    padding: 14px 20px;
    font-size: 15px;
  }
  
  /* Top bar con dimensioni standard per schermi grandi */
  
  .welcome-card, .credito-card, .logout-card {
    padding: 14px 20px !important;
    gap: 1.2rem !important;
  }
  
  .welcome-icon {
    width: 50px !important;
    height: 50px !important;
    border-radius: 10px !important;
  }
  
  .welcome-label {
    font-size: 0.85rem !important;
  }
  
  .welcome {
    font-size: 0.9rem !important;
    max-width: none !important;
  }
  
  .welcome-card {
    max-width: none !important;
  }
}

/* Mobile: 320px - 767px */
@media (max-width: 767px) {
  /* Body responsive */
  body {
    overflow-y: auto;
    overflow-x: hidden;
  }
  
  /* Dashboard wrapper mobile */
  .dashboard-wrapper {
    flex-direction: column;
    min-height: 100vh;
    padding: 0;
  }
  
  /* Sidebar mobile: collassabile off-canvas */
  .sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    width: 280px;
    height: 100vh;
    margin: 0;
    border-radius: 0 16px 16px 0;
    z-index: 1000;
    transition: left 0.3s ease;
    overflow-y: auto;
  }
  
  .sidebar.mobile-active {
    left: 0;
  }
  
  /* Main content mobile */
  .main-content {
    width: 100%;
    padding: 20px 15px;
    margin: 0;
    max-height: none;
    min-height: 100vh;
  }
  
  .welcome-card, .credito-card, .logout-card {
    width: 100% !important;
    max-width: none !important;
    padding: 16px 20px !important;
    margin: 0 !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    min-height: 56px !important;
    box-sizing: border-box !important;
    background: white !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06) !important;
    border: 1px solid rgba(30, 77, 219, 0.1) !important;
    transition: all 0.3s ease !important;
  }
  
  .welcome-card:hover, .credito-card:hover, .logout-card:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 20px rgba(30, 77, 219, 0.12) !important;
  }
  
  /* Pulsanti header mobile - ELEGANT */
  .welcome-card button, .credito-card button, .logout-card button,
  .btn, .button {
    padding: 10px 16px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    min-width: 90px !important;
    min-height: 40px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    border-radius: 8px !important;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover)) !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 2px 8px rgba(30, 77, 219, 0.2) !important;
    transition: all 0.3s ease !important;
  }
  
  .welcome-card button:hover, .credito-card button:hover, .logout-card button:hover,
  .btn:hover, .button:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(30, 77, 219, 0.3) !important;
  }
  
  /* Stili per il nuovo header mobile unificato */
  .mobile-header {
    display: flex !important; /* Mostra l'header su mobile */
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1001;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  }

  .header-dealer-name {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    text-align: center;
    flex-grow: 1;
    margin: 0 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .header-actions .btn-ricarica,
  .header-actions .btn-logout {
    padding: 6px 10px !important;
    min-height: 0 !important;
    width: auto !important;
    font-size: 12px !important;
    margin-bottom: 0 !important;
  }

  /* Nasconde il vecchio welcome container su mobile */
  .welcome-container {
    display: none !important;
  }

  /* Adatta il padding del main-content per non sovrapporsi all'header fisso */
  .main-content {
    padding-top: 70px !important; /* Altezza header + margine */
  }

  /* Utility class per nascondere forzatamente un elemento */
  .force-hide {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    overflow: hidden !important;
  }

  /* Menu burger button */
  /* === RESPONSIVE AGENT CARDS (ATTIVAZIONI & ORDINI) === */

  /* Stili per le tabelle responsive dell'agente */
  [id^='corpo-tabella-'] tr {
    display: block !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 8px !important;
    margin-bottom: 10px !important;
    padding: 12px !important;
    background: #fff !important;
  }

  [id^='corpo-tabella-'] td {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 10px !important;
    border-bottom: 1px solid #f3f4f6; /* Separatore leggero */
  }

  [id^='corpo-tabella-'] tr:last-child td:last-child {
    border-bottom: none; /* Rimuove l'ultimo separatore */
  }

  [id^='corpo-tabella-'] td strong {
    font-weight: 600 !important;
    color: #374151 !important;
    font-size: 12px !important;
    text-transform: uppercase !important;
    margin-right: 15px; /* Spazio tra etichetta e valore */
    flex-shrink: 0; /* Impedisce alla label di restringersi */
  }

  [id^='corpo-tabella-'] td span {
    text-align: right; /* Allinea il valore a destra */
    font-size: 14px;
    color: #1f2937;
    word-break: break-word; /* Va a capo se il testo è troppo lungo */
  }

  /* Stili per la visualizzazione condizionale desktop/mobile */
.mobile-only { display: none; }
.desktop-only { display: block; }

@media (max-width: 767px) {
  .mobile-only { display: block; }
  .desktop-only { display: none; }

  /* Fix dashboard grid on mobile - stack cards vertically */
  .dashboard-grid,
  .new-dashboard-grid,
  .dashboard-grid.new-dashboard-grid {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: none !important;
    grid-template-rows: none !important;
    grid-template-areas: none !important;
    gap: 16px !important;
    width: 100% !important;
  }

  /* Ensure all cards are visible and full width on mobile */
  .dashboard-grid .card,
  .dashboard-grid section.card {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    flex: none !important;
  }

  .mobile-card {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    width: 100%;
    box-sizing: border-box;
  }

  .mobile-card-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
    gap: 16px;
    min-height: 32px;
  }

  .mobile-card-row:last-child {
    border-bottom: none;
  }

  .mobile-card-label {
    font-weight: 600;
    font-size: 10px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.3;
    flex-shrink: 0;
    min-width: 70px;
    max-width: 90px;
  }

  .mobile-card-value {
    font-size: 13px;
    color: #1f2937;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    line-height: 1.4;
    flex: 1;
    text-align: right;
    min-width: 0;
  }

  /* For very small screens, stack everything vertically */
  @media (max-width: 480px) {
    .mobile-card {
      padding: 12px;
      margin-bottom: 8px;
    }
    
    .mobile-card-row {
      padding: 6px 0;
      gap: 2px;
    }
    
    .mobile-card-label {
      font-size: 9px;
    }
    
    .mobile-card-value {
      font-size: 12px;
      line-height: 1.2;
    }
  }

  /* Ensure mobile containers have proper spacing */
  #mobile-card-container-attivazioni,
  #mobile-card-container-ordini {
    padding: 0;
    margin: 0;
    width: 100%;
  }

  /* Fix any potential table remnants on mobile */
  .mobile-only table,
  .mobile-only thead,
  .mobile-only tbody,
  .mobile-only tr,
  .mobile-only td,
  .mobile-only th {
    display: none !important;
  }

  /* Mobile pagination styling - more compact and proportional */
  .pagination-controls {
    margin-top: 12px !important;
    margin-bottom: 8px !important;
    gap: 6px !important;
  }

  .pagination-btn {
    padding: 6px 10px !important;
    min-width: 32px !important;
    height: 32px !important;
    font-size: 12px !important;
    border-radius: 6px !important;
  }

  .pagination-btn svg {
    width: 14px !important;
    height: 14px !important;
  }

  .pagination-info {
    font-size: 12px !important;
    padding: 0 8px !important;
    color: #6b7280 !important;
  }

  .pagination-current {
    font-weight: 600 !important;
    color: #1e4ddb !important;
  }

  .pagination-separator {
    margin: 0 4px !important;
    color: #9ca3af !important;
  }

  .pagination-total {
    color: #6b7280 !important;
  }
}

/* Stili per la paginazione responsive dell'agente */
  [id$='-pagination-container'] {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
  }

  [id^='prev-'], [id^='next-'] {
    padding: 8px 12px !important;
    min-width: 40px !important;
    width: auto !important;
    font-size: 14px !important;
    flex-shrink: 0;
  }

  [id^='pagination-info-'] {
    font-size: 14px;
    font-weight: 500;
  }

  /* FIX per bottoni paginazione enormi */
  .pagination-button-mobile {
      width: auto !important; /* Sovrascrive il 100% width generico */
      max-width: 80px; /* Limita la larghezza massima */
      flex-grow: 0 !important; /* Impedisce al bottone di crescere */
      flex-shrink: 0 !important; /* Impedisce al bottone di restringersi */
  }

  .mobile-menu-btn {
    display: none; /* Nascosto di default, gestito da JS */
    z-index: 1001;
    background: transparent;
    color: var(--primary-color);
    border: none;
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
  }
  
  .mobile-menu-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
  }
  
  /* Overlay sidebar */
  .sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
  }
  
  .sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
  }
  
  /* Cards responsive */
  .card {
    margin-bottom: 15px;
    padding: 16px;
  }
  
  /* Dashboard grid mobile - FIX SEPARAZIONE CARDS */
  .dashboard-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 25px !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  
  /* Cards mobile - ELEGANT DESIGN + SEPARAZIONE */
  .card, .graph-card, .kpi-card, .stats-card {
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    min-height: 280px !important;
    margin: 0 0 30px 0 !important;
    padding: 24px !important;
    box-sizing: border-box !important;
    display: block !important;
    overflow: visible !important;
    background: linear-gradient(135deg, #ffffff 0%, #fafbff 100%) !important;
    border-radius: 16px !important;
    box-shadow: 0 8px 32px rgba(30, 77, 219, 0.08) !important;
    border: 1px solid rgba(30, 77, 219, 0.06) !important;
    transition: all 0.3s ease !important;
    position: relative !important;
    flex-shrink: 0 !important;
    clear: both !important;
  }
  
  /* Forza separazione tra cards */
  .card + .card, .graph-card + .graph-card, .kpi-card + .kpi-card {
    margin-top: 25px !important;
  }
  
  .card:hover, .graph-card:hover, .kpi-card:hover, .stats-card:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 12px 40px rgba(30, 77, 219, 0.12) !important;
  }
  
  /* Card header elegant */
  .card::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 4px !important;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-hover)) !important;
    border-radius: 16px 16px 0 0 !important;
  }
  
  /* Card content visibility */
  .card * {
    visibility: visible !important;
    opacity: 1 !important;
    display: block !important;
  }
  
  .card h3, .card h4, .card .card-title {
    display: block !important;
    margin-bottom: 16px !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    color: var(--primary-color) !important;
    letter-spacing: -0.02em !important;
    line-height: 1.3 !important;
  }
  
  .card .card-content, .card .card-body {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    color: #64748b !important;
  }
  
  /* Card data styling */
  .card .data-item {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 8px 0 !important;
    border-bottom: 1px solid rgba(30, 77, 219, 0.06) !important;
  }
  
  .card .data-item:last-child {
    border-bottom: none !important;
  }
  
  /* Main content mobile - scroll ottimizzato */
  .main-content {
    height: auto !important;
    max-height: none !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding-bottom: 30px !important;
  }
  
  /* Container mobile - full width */
  .container {
    width: 100% !important;
    max-width: none !important;
    padding: 0 10px !important;
    margin: 0 !important;
  }
  
  /* Dashboard wrapper mobile */
  .dashboard-wrapper {
    height: auto !important;
    min-height: 100vh !important;
    overflow: visible !important;
  }
  
  /* Typography mobile */
  h1 { font-size: 24px !important; }
  h2 { font-size: 20px !important; }
  h3 { font-size: 18px !important; }
  
  /* Card content mobile */
  .card h3, .card h4 {
    font-size: 16px !important;
    margin-bottom: 8px !important;
  }
  
  .card p, .card span {
    font-size: 14px !important;
    line-height: 1.4 !important;
  }
  
  /* Buttons mobile */
  .btn, button {
    width: 100% !important;
    margin: 5px 0 !important;
    padding: 12px 16px !important;
    font-size: 14px !important;
    min-height: 44px !important;
  }
  
  /* Charts mobile */
  canvas {
    max-width: 100% !important;
    height: auto !important;
    max-height: 200px !important;
  }
  
  /* Tables mobile - scroll horizontal */
  .table-container {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  
  table {
    min-width: 300px !important;
    font-size: 12px !important;
  }
}

/* Tablet: 768px - 1023px */
@media (min-width: 768px) and (max-width: 1023px) {
  /* Sidebar compatta tablet */
  .sidebar {
    width: 220px;
    margin: 20px 0 20px 15px;
  }
  
  .sidebar-logo img {
    width: 180px;
  }
  
  /* Main content tablet */
  .main-content {
    padding: 20px;
  }
  
  /* Welcome container tablet */
  .welcome-container {
    flex-wrap: wrap;
    gap: 12px;
  }
  
  .welcome-card, .credito-card, .logout-card {
    flex: 1;
    min-width: 200px;
  }
  
  /* Dashboard grid tablet */
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  
  /* Cards tablet */
  .card {
    margin-bottom: 18px;
  }
  
  /* Hide mobile elements */
  .mobile-menu-btn,
  .sidebar-overlay {
    display: none;
  }
}

/* Desktop: 1024px+ */
@media (min-width: 1024px) {
  /* Layout desktop ottimizzato */
  .dashboard-wrapper {
    padding: 0 0 20px 0;
  }
  
  /* Sidebar desktop */
  .sidebar {
    width: 280px;
    margin: 20px 0 20px 20px;
  }
  
  /* Main content desktop */
  .main-content {
    padding: 24px;
  }
  
  /* Welcome container desktop */
  .welcome-container {
    justify-content: space-between;
    gap: 15px;
  }
  
  /* Dashboard grid desktop */
  .dashboard-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
  }
  
  /* Hide mobile elements */
  .mobile-menu-btn,
  .sidebar-overlay {
    display: none;
  }
}

/* Large Desktop: 1200px+ */
@media (min-width: 1200px) {
  .main-content {
    padding: 30px;
  }
  
  .dashboard-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
  }
}
/* ====== LOGIN PAGE ====== */
.login-bg {
  background: linear-gradient(135deg, #1e4ddb, #153cb2);
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  background: #fff;
  padding: 40px 32px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-light);
  width: 100%;
  max-width: 420px;
}
.login-logo {
  text-align: center;
  margin-bottom: 20px;
}
.login-logo img {
  height: 48px;
}
.login-title {
  font-size: 1.5rem;
  text-align: center;
  margin-bottom: 24px;
  font-weight: bold;
}
.login-card input {
  margin-bottom: 14px;
}
.login-btn {
  width: 100%;
  margin-top: 10px;
}
.forgot-password {
  display: block;
  margin-top: 12px;
  font-size: 0.9rem;
  text-align: center;
  color: var(--primary-color);
}
/* ====== CHATBOX FLOTANTE ====== */
#chatbox-float {
  font-family: var(--font-main);
  border-radius: 12px;
  border: 1px solid #ddd;
}
#chatbox-float #messages {
  font-size: 0.9rem;
  line-height: 1.4;
}
#chatbox-float input[type="text"] {
  font-size: 0.95rem;
}
#chatbox-float button {
  font-size: 0.95rem;
}
#chatbox-float .alert {
  margin: 4px 0;
  font-style: italic;
  color: #e53935;
}
/* ====== TOOLTIP STYLE (placeholder, futura espansione) ====== */
.tooltip {
  position: relative;
  cursor: help;
}
.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  background: #333;
  color: #fff;
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 6px;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  display: none;
}
.tooltip:hover::after {
  display: block;
  z-index: 10;
}
/* ====== ANIMAZIONI ====== */
@keyframes fadeIn {
  from {
      opacity: 0;
      transform: translateY(10px);
 }
  to {
      opacity: 1;
      transform: translateY(0);
 }
}
.card, .offerta-card, .form-group, .login-card {
  animation: fadeIn 0.3s ease-in-out;
}
/* ====== UTILITY BADGE ====== */
.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eee;
  color: #333;
  margin-left: 6px;
}
.badge.green {
  background: #e0f6e9;
  color: #1e8449;
}
.badge.blue {
  background: #e5f0ff;
  color: #1e4ddb;
}
.badge.red {
  background: #fdecea;
  color: #c0392b;
}
.badge.gray {
  background: #f1f1f1;
  color: #666;
}
.attivazioni-card, .ordini-card, .andamento-card {
  grid-column: span 2;
}
/* Badge di stato con cerchio colorato */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  border-radius: 50px;
  font-size: 0.87rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: #f8fafd;
  color: #4a5568;
  border: 1px solid #e2e8f0;
  transition: all 0.2s ease;
  line-height: 1.2;
}
/* Cerchio colorato */
.status-badge::before {
  content: '';
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-left: 2px;
  background: #a0aec0;
 /* Colore di default */
  flex-shrink: 0;
}
/* Stili per la card degli obiettivi */
#test-card {
  grid-column: span 2;
  min-height: 300px;
  overflow: auto;
  position: relative;
}
/* Stile per i menu a tendina */
.operatore-select-wrapper {
  position: absolute;
  top: 12px;
  right: 16px;
}
.operatore-select-wrapper select {
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid #ddd;
  background-color: white;
  font-size: 0.85em;
  cursor: pointer;
  outline: none;
}
.operatore-select-wrapper select:hover {
  border-color: #1e4ddb;
}
/* Stile per il messaggio di nessun risultato */
.nessun-risultato {
  padding: 20px;
  text-align: center;
  color: #666;
  font-size: 0.9em;
  margin-top: 20px;
}
.nessun-risultato p {
  margin: 0;
}
.obiettivi-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  padding: 16px;
}
.obiettivo-card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease;
}
.obiettivo-card:hover {
  transform: translateY(-4px);
}
.obiettivo-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.obiettivo-stato {
  font-weight: bold;
  font-size: 1em;
}
.progress-container {
  background: #f0f0f0;
  border-radius: 6px;
  overflow: hidden;
  height: 12px;
  margin-bottom: 12px;
}
.progress-bar {
  background: #4caf50;
  height: 100%;
  transition: width 0.4s ease;
}
.obiettivo-footer {
  display: flex;
  justify-content: space-between;
  font-size: 0.9em;
  color: #555;
}
.obiettivo-completato .progress-bar {
  background: #2196f3;
}
/* ====== PAGINA PRODOTTI ====== */
.catalogo-container {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 30px;
  width: 100%;
  align-items: start;
 /* questo già va bene */
  min-height: 100vh;
 /* lasciamo almeno min-height 100vh */
}
.prodotti-lista {
  width: 100%;
  max-width: 100%;
  overflow: auto;
}
/* Stile principale del carrello */
/* Contenuto scrollabile del carrello */
/* Stile per la scrollbar del carrello */
#carrello-contenuto::-webkit-scrollbar {
  width: 6px;
}
#carrello-contenuto::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}
#carrello-contenuto::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 10px;
}
#carrello-contenuto::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}
/* Responsive layout */
@media (max-width: 1200px) {
  .catalogo-container {
      grid-template-columns: 1fr;
 }
  .carrello-box {
      position: static;
      max-height: none;
      margin-top: 20px;
 }
}
.carrello-box h3 {
  margin-top: 0;
  margin-bottom: 20px;
  color: var(--primary-color);
  border-bottom: 1px solid #e0e4f0;
  padding-bottom: 10px;
}
.prodotti-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 20px;
  width: 100%;
  padding-right: 10px;
  max-height: calc(100vh - 370px);
  overflow-y: auto;
  padding-bottom: 20px;
}
/* Stile personalizzato per la scrollbar */
.prodotti-grid::-webkit-scrollbar {
  width: 6px;
}
.prodotti-grid::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}
.prodotti-grid::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}
.prodotti-grid::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}
.prodotto-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  border: 1px solid #e0e4f0;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.prodotto-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}
.prodotto-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.prodotto-immagine {
  width: 100%;
  height: 180px;
  background: #f8faff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.prodotto-immagine img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}
.prodotto-card:hover .prodotto-immagine img {
  transform: scale(1.05);
}
.prodotto-immagine img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.prodotto-info {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.prodotto-titolo {
  font-size: 1.1rem;
  font-weight: 600;
  color: #2c3e50;
  margin: 0 0 8px 0;
  line-height: 1.3;
}
.prodotto-descrizione {
  color: #6c757d;
  font-size: 0.9rem;
  margin-bottom: 15px;
  line-height: 1.5;
  flex-grow: 1;
}
.prodotto-prezzo {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1e4ddb;
  margin: 10px 0 15px 0;
}
.btn-aggiungi {
  display: block;
  width: 100%;
  padding: 12px;
  background: #1e4ddb;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  font-size: 0.95rem;
  margin-top: auto;
}
.btn-aggiungi:hover {
  background: #153cb2;
  transform: translateY(-1px);
}
.btn-aggiungi:active {
  transform: translateY(0);
}
.prodotto-titolo {
  font-weight: 600;
  margin-bottom: 8px;
  color: #333;
  font-size: 1rem;
}
.prodotto-descrizione {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 10px;
}
.prodotto-prezzo {
  font-size: 1.2em;
  font-weight: 700;
  color: var(--primary-color);
  margin: 10px 0;
}
.btn-aggiungi {
  display: block;
  width: 100%;
  padding: 10px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 0.95rem;
}
.btn-aggiungi:hover {
  background: var(--primary-hover);
}
/* Stili per il carrello */
.voce-carrello:last-child {
  border-bottom: none;
}
.voce-carrello .quantita {
  display: flex;
  align-items: center;
  gap: 8px;
}
.voce-carrello button {
  background: #f0f2f5;
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}
.voce-carrello button:hover {
  background: #e0e4e8;
}
/* Pulsante di chiusura */
.close-form-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 32px;
  height: 32px;
  border: none;
  background: #f0f2f5;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #6c757d;
  transition: all 0.2s ease;
  z-index: 10;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  outline: none;
}
.close-form-btn:hover {
  background: #e0e4e8;
  color: #dc3545;
  transform: rotate(90deg);
}
.totale-carrello {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 2px solid #e0e4f0;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  font-size: 1.1rem;
}
/* Stili per i filtri */
.filtri {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
}
.filtri .form-group {
  margin-bottom: 0;
}
.obiettivo-loading, .obiettivo-error, .nessun-risultato {
  text-align: center;
  padding: 40px 16px;
  font-size: 1em;
  color: #666;
}
.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px auto;
}
@keyframes spin {
  0% {
      transform: rotate(0deg);
 }
  100% {
      transform: rotate(360deg);
 }
}
.btn-retry {
  margin-top: 12px;
  padding: 8px 16px;
  background: #2196f3;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
.btn-retry:hover {
  background: #1976d2;
}
/* Colori stati */
.status-badge.success {
  color: #1a7f5c;
  border-color: #e3f7ed;
  background: #f0faf5;
}
.status-badge.success::before {
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}
.status-badge.warning {
  color: #b76b00;
  border-color: #fff4dc;
  background: #fff9ed;
}
.status-badge.warning::before {
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}
.status-badge.danger {
  color: #c12525;
  border-color: #fce8e6;
  background: #fef2f2;
}
.status-badge.danger::before {
  background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}
.status-badge.info {
  color: #1e40af;
  border-color: #dbeafe;
  background: #eff6ff;
}
.status-badge.info::before {
  background: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
/* Trend Chart Styles */
.chart-container {
  position: relative;
  width: 100%;
  height: 300px;
  padding: 15px;
  margin-top: -3vh;
}
#operatorTrendChart {
  width: 100% !important;
  height: 100% !important;
}
/* Responsive adjustments */
@media (max-width: 1200px) {
  .chart-container {
      height: 250px;
 }
}
@media (max-width: 768px) {
  .chart-container {
      height: 200px;
 }
}
.status-badge.pending {
  color: #6b7280;
  border-color: #f3f4f6;
  background: #f9fafb;
}
.status-badge.pending::before {
  background: #9ca3af;
  box-shadow: 0 0 0 3px rgba(156, 163, 175, 0.15);
}
.status-badge.secondary {
  color: #4b5563;
  border-color: #e5e7eb;
  background: #f3f4f6;
}
.status-badge.secondary::before {
  background: #6b7280;
  box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.15);
}
/* Hover effect */
.status-badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}
/* ====== SCROLL SMOOTH ====== */
html {
  scroll-behavior: smooth;
}
/* ====== PAGINA DOCUMENTAZIONE ====== */
.documentazione-card {
  height: calc(100vh - 200px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(30,77,219,0.06);
}
.documentazione-container {
  padding: 32px 36px;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #f8fafc;
  border-radius: 16px;
}
.documenti-table {
  margin-top: 28px;
  flex: 1;
  overflow-y: auto;
  border: none;
  border-radius: 16px;
  background: white;
  box-shadow: 0 1px 6px rgba(30,77,219,0.05);
}
/* Tabella documenti moderna */
.docs-table {
  font-family: 'Poppins', sans-serif;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 16px;
  overflow: hidden;
  font-family: 'Noto Sans', Arial, sans-serif;
}
.docs-table th {
  background: linear-gradient(90deg, #eaf0fb 0%, #f8fafc 100%);
  color: #1e293b;
  font-weight: 700;
  text-align: left;
  padding: 18px 28px;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 2px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 2;
}
.docs-table th:first-child {
  border-top-left-radius: 16px;
}
.docs-table th:last-child {
  border-top-right-radius: 16px;
}
.docs-table td {
  padding: 18px 28px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  vertical-align: middle;
  font-size: 1.04rem;
  background: #fff;
  transition: background 0.2s, box-shadow 0.2s;
}
.docs-table td:first-child {
  font-weight: 600;
}
.docs-table tbody tr:last-child td {
  border-bottom: none;
}
.docs-table tbody tr {
  transition: background 0.2s, box-shadow 0.2s;
}
.docs-table tbody tr:hover {
  background: #eaf0fb;
  box-shadow: 0 2px 12px rgba(30,77,219,0.09);
}
/* Icone tipo file */
.file-type {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  margin-right: 14px;
  background: #eef2ff;
  color: #4f46e5;
  font-size: 1.2em;
  box-shadow: 0 1px 2px rgba(30,77,219,0.07);
}
.file-type.pdf {
  background: #fef2f2;
  color: #dc2626;
}
.file-type.doc {
  background: #eff6ff;
  color: #1d4ed8;
}
.file-type.xls {
  background: #f0fdf4;
  color: #059669;
}
.file-type.txt {
  background: #f3f4f6;
  color: #64748b;
}
.file-type.zip {
  background: #fefce8;
  color: #a16207;
}
/* Stile per evidenziare lo stato 'in attesa di pagamento' */
td.in-attesa {
  color: #d32f2f;
  font-weight: bold;
  background-color: #ffebee;
  border-left: 3px solid #d32f2f;
  padding-left: 8px;
}
.doc-link {
  color: #1e4ddb;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
  font-size: 1.02em;
  letter-spacing: 0.2px;
  transition: color 0.2s, transform 0.2s;
  position: relative;
}
.doc-link:hover {
  color: #153cb2;
  transform: translateX(6px) scale(1.03);
  text-decoration: underline;
}
.doc-link .icon {
  font-size: 1.3em;
  color: #6b7280;
  transition: color 0.2s;
}
.doc-link:hover .icon {
  color: #1e4ddb;
}
/* Messaggio nessun documento */
.no-docs {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: #6b7280;
  text-align: center;
  padding: 20px;
  font-size: 1.1em;
}
.no-docs .icon {
  font-size: 2.7em;
  margin-bottom: 12px;
  color: #d1d5db;
}
/* Responsive */
@media (max-width: 900px) {
  .documentazione-container {
      padding: 16px 6px;
 }
  .docs-table th, .docs-table td {
      padding: 12px 8px;
      font-size: 0.98em;
 }
}
/* Messaggio nessun documento */
.no-docs {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: #6b7280;
  text-align: center;
  padding: 20px;
}
.no-docs .icon {
  font-size: 2.5em;
  margin-bottom: 10px;
  color: #d1d5db;
}
/* Responsive */
@media (max-width: 768px) {
  .documentazione-container {
      padding: 16px;
 }
  .docs-table th, .docs-table td {
      padding: 12px 14px;
 }
}
/* === Stile elegante per la sezione form === */
.attiva-card {
  height: 81vh;
}
.form-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
 /* spazio uniforme tra i gruppi */
  padding: 20px 0;
}
/* Singolo gruppo form */
.form-group {
  width: 97%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}
/* Label */
.form-label {
  font-weight: 600;
  font-size: 1.05em;
  margin-bottom: 8px;
  color: #333;
  letter-spacing: 0.3px;
  transition: color 0.2s;
}
/* Select pulita e professionale */
.form-select {
  appearance: none;
  background-color: #fff;
  border: 2px solid #d1d5db;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 1em;
  color: #111827;
  font-weight: 500;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
  background-image: url('data:image/svg+xml;charset=UTF-8,<svg fill="%231e40af" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px 16px;
  cursor: pointer;
}
.form-select:hover {
  border-color: #1e40af;
  background-color: #f9fafb;
}
.form-select:focus {
  border-color: #1e40af;
  box-shadow: 0 0 0 4px rgba(30, 64, 175, 0.12);
  outline: none;
}
#form-dinamico {
  padding: 24px 32px;
  max-width: 1500px;
 /* ancora più largo */
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: -1vh;
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  font-family: 'Segoe UI', sans-serif;
}
#form-dinamico form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px 32px;
}
/* Gruppo di campo */
#form-dinamico .form-group {
  margin-bottom: 0;
  text-align: left;
  width: 100%;
 /* Ogni gruppo occupa una cella */
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
#form-dinamico h4 {
  grid-column: 1 / -1;
}
#form-dinamico .form-actions {
  display: flex;
  gap: 18px;
  grid-column: 1 / -1;
  justify-content: flex-start;
}
#form-dinamico .btn-cancel {
  background: #e53935;
  color: #fff;
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
  box-shadow: none;
  width: 220px;
  display: inline-block;
  margin: 0;
}
#form-dinamico .btn-cancel:hover {
  background: #b71c1c;
}
/* Etichette */
#form-dinamico label {
  display: block;
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 6px;
  color: #1f2937;
}
/* Input, select */
#form-dinamico .form-control {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #e0e7ff;
  border-radius: 10px;
  font-size: 15px;
  color: #111827;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
#form-dinamico .form-control:hover {
  border-color: #1f57c3;
}
#form-dinamico .form-control:focus {
  border-color: #1f57c3;
  box-shadow: 0 0 0 3px rgba(31, 87, 195, 0.15);
  outline: none;
}
/* Checkbox */
#form-dinamico input[type="checkbox"] {
  margin-right: 8px;
  transform: scale(1.2);
  accent-color: #1f57c3;
}
/* Bottoni */
#form-dinamico button.btn-secondary {
  width: 220px;
 /* non full-width, meglio per i form */
  padding: 14px;
  background-color: #ff0000;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s;
  margin-top: 16px;
}
#form-dinamico button[type="submit"] {
  width: 220px;
 /* non full-width, meglio per i form */
  padding: 14px;
  background-color: #1f57c3;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s;
  margin-top: 16px;
}
#form-dinamico button[type="submit"]:hover {
  background-color: #1848a5;
}
#form-dinamico button.btn-secondary:hover {
  background-color: #ff4d4d;
}
/* Pulsante annulla secondario */
#form-dinamico .btn-secondary {
  background-color: #e5e7eb;
  color: #1f2937;
}
#form-dinamico .btn-secondary:hover {
  background-color: #d1d5db;
}
/* Sezione Documenti */
#form-dinamico h4 {
  font-size: 16px;
  margin-top: 24px;
  margin-bottom: 12px;
  color: #1f2937;
  text-align: left;
}
/* Input file */
#form-dinamico input[type="file"] {
  padding: 12px 14px;
  border: 2px solid #e0e7ff;
  border-radius: 10px;
  font-size: 14px;
  background-color: #f9fafc;
  width: 100%;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
#form-dinamico input[type="file"]:hover {
  border-color: #1f57c3;
}
#form-dinamico input[type="file"]:focus {
  border-color: #1f57c3;
  box-shadow: 0 0 0 3px rgba(31, 87, 195, 0.15);
  outline: none;
}
/* Responsive */
@media (max-width: 900px) {
  #form-dinamico {
      max-width: 100%;
      padding: 12px;
 }
  #form-dinamico form {
      grid-template-columns: 1fr;
 }
  #form-dinamico button[type="submit"], #form-dinamico button.btn-secondary {
      justify-self: stretch;
 }
  #form-dinamico h4 {
      grid-column: 1;
 }
  #form-dinamico .form-group {
      margin-bottom: 0;
 }
  #form-dinamico label {
      font-size: 14px;
 }
}
.catalogo-container {
  position: relative;
  display: flex;
  gap: 30px;
  width: 100%;
  min-height: 100vh;
}
.prodotti-lista {
  flex: 1;
  margin-right: 350px;
 /* Larghezza carrello + gap */
}
#carrello-box {
  position: absolute;
  top: 0;
  right: 0;
  width: 320px;
  height: 73%;
  display: flex;
  flex-direction: column;
  background: #f8faff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  box-sizing: border-box;
  overflow: hidden;
  padding: 15px;
}
/* Stile per il titolo del carrello */
#carrello-box h2 {
  font-size: 2.5rem !important;
 /* Aumentato a 2.5rem con !important */
  font-weight: 700 !important;
  margin: 0 0 15px 0 !important;
  padding-bottom: 12px;
  border-bottom: 2px solid #e0e4f0;
  color: #1a1a1a !important;
  letter-spacing: -0.5px;
  line-height: 1.2;
}
#carrello-contenuto {
  flex: 1;
  width: 100%;
  box-sizing: border-box;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  box-shadow: none;
  gap: 5px;
 /* Ridotto lo spazio tra gli elementi */
  padding-right: 5px;
  margin-right: -5px;
  max-height: 100%;
  padding-top: 5px;
 /* Spazio sopra il contenuto scrollabile */
}
/* Stile per gli elementi del carrello */
.voce-carrello {
  padding: 8px 10px;
  background: white;
  border-radius: 8px;
  font-size: 2.9rem;
  line-height: 1.4;
}
/* Stile per la scrollbar */
#carrello-contenuto::-webkit-scrollbar {
  width: 6px;
}
#carrello-contenuto::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
  margin: 5px 0;
}

/* --- BADGE DI STATO --- */
.badge {
  padding: 5px 12px;
  border-radius: 20px;
 /* Badge a pillola */
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-block;
  text-align: center;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge-success {
  background-color: #e0f5e9;
  color: #1a9347;
  border-color: #a3e9b8;
}
.badge-warning {
  background-color: #fff4e0;
  color: #d97706;
  border-color: #ffdca9;
}
.badge-danger {
  background-color: #ffebee;
  color: #c62828;
  border-color: #ffcdd2;
}
.badge-info {
  background-color: #e3f2fd;
  color: #1e88e5;
  border-color: #bbdefb;
}
.badge-default {
  background-color: #f0f2f5;
  color: #5a6e82;
  border-color: #e9ecef;
}

/* Personalizzazione scrollbar */
.table-container::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
.table-container::-webkit-scrollbar-track {
  background: transparent;
}
.table-container::-webkit-scrollbar-thumb {
  background-color: rgba(48, 88, 158, 0.3);
  border-radius: 10px;
}
.table-container::-webkit-scrollbar-thumb:hover {
  background-color: rgba(48, 88, 158, 0.5);
}

/* ===== LOGOUT BUTTON STYLES ===== */
.logout-container {
  padding: 0 24px;
  margin-bottom: 16px;
  margin-top: auto;
}
.logout-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px 0;
  border-radius: 8px;
  border: 1px solid rgba(64, 103, 219, 0.15);
  background: linear-gradient(to right, #f5f8ff, #edf2ff);
  color: #4067db;
  font-family: 'Noto Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.logout-button:hover {
  background: linear-gradient(to right, #eef3ff, #e4eaff);
  box-shadow: 0 2px 5px rgba(64, 103, 219, 0.12);
  transform: translateY(-1px);
}
.logout-button:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(64, 103, 219, 0.08);
}
.logout-icon {
  display: inline-flex;
  margin-right: 8px;
}
.logout-icon svg {
  stroke: #4067db;
  width: 16px;
  height: 16px;
}
/* ===== HEADER LOGOUT BUTTON STYLES ===== */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.header-logout-button {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid rgba(64, 103, 219, 0.15);
  background: rgba(255, 255, 255, 0.8);
  color: #4067db;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.header-logout-button:hover {
  background: #f5f8ff;
  box-shadow: 0 2px 6px rgba(64, 103, 219, 0.12);
  transform: translateY(-1px);
}
.header-logout-button:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(64, 103, 219, 0.08);
  background: #eef3ff;
}
.header-logout-button .logout-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}
.header-logout-button .logout-icon svg {
  width: 14px;
  height: 14px;
  stroke: #4067db;
}
@media (max-width: 768px) {
  .welcome-container {
      flex-direction: column;
      align-items: flex-start;
 }
  .header-actions {
      margin-top: -5px;
      margin-bottom: 10px;
      width: 100%;
 }
  .header-logout-button {
      width: auto;
 }
 }
/* ===== FINAL OVERRIDES: LOCK SIDEBAR LAYOUT ACROSS ALL PAGES ===== */
/* Use ID selector to outrank later class-based rules (e.g., .prodotti-page .sidebar) */
:root {
  --sidebar-width: 280px;
}

/* Highest-specificity, important-flag overrides */
#sidebar,
.dashboard-wrapper > aside#sidebar,
body .dashboard-wrapper > aside#sidebar {
  width: var(--sidebar-width) !important;
  min-width: var(--sidebar-width) !important;
  max-width: var(--sidebar-width) !important;
  flex: 0 0 var(--sidebar-width) !important;
  box-sizing: border-box !important;
}

/* Ensure main content accounts for fixed sidebar */
.dashboard-wrapper > .main-content {
  flex: 1 1 auto !important;
  min-width: 0; /* prevent overflow */
}

/* Prevent any page-scoped rules from shrinking the sidebar */
body.prodotti-page #sidebar,
body[class*="page"] #sidebar,
.prodotti-page .dashboard-wrapper > aside#sidebar,
.prodotti-page aside#sidebar {
  width: var(--sidebar-width) !important;
  min-width: var(--sidebar-width) !important;
  max-width: var(--sidebar-width) !important;
  flex: 0 0 var(--sidebar-width) !important;
}

/* Optional: guard against media queries elsewhere */
@media (max-width: 5000px) {
  #sidebar { width: var(--sidebar-width) !important; }
}

/* ULTRA-HIGH SPECIFICITY: Force 280px on prodotti page at all breakpoints */
@media screen and (min-width: 1px) {
  body.prodotti-page .dashboard-wrapper > aside.sidebar#sidebar,
  .prodotti-page .dashboard-wrapper > aside.sidebar#sidebar {
    width: var(--sidebar-width) !important;
    min-width: var(--sidebar-width) !important;
    max-width: var(--sidebar-width) !important;
    flex: 0 0 var(--sidebar-width) !important;
    flex-basis: var(--sidebar-width) !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
  }
}

@media screen and (max-width: 1366px) {
  body.prodotti-page .dashboard-wrapper > aside.sidebar#sidebar {
    width: var(--sidebar-width) !important;
    flex: 0 0 var(--sidebar-width) !important;
  }
}

@media screen and (max-width: 1023px) {
  body.prodotti-page .dashboard-wrapper > aside.sidebar#sidebar {
    width: var(--sidebar-width) !important;
    flex: 0 0 var(--sidebar-width) !important;
  }
}

