/* ============================================================
   PLASMA — style.css
   Design system unico per tutte le pagine
   ------------------------------------------------------------
   INDICE
   01. Font
   02. Design tokens (:root)
   03. Reset & base
   04. Tipografia
   05. Glow decorativi
   06. Shell & wrapper
   07. Panel & card
   08. Bottoni & pill
   09. Chip & badge
   10. Sidebar tiles
   11. Main content
   12. Top bar
   13. Welcome card
   14. Stat cards
   15. Token widget
   16. Moltiplicatore widget
   17. Info box
   18. Footer
   19. Animazioni
   20. Responsive
   ============================================================ */

/* ---------- 01. FONT ---------- */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Sora:wght@600;700;800&display=swap');

/* ---------- 02. TOKENS ---------- */
:root {
  /* Colori base */
  --bg: #eee6dc;
  --bg-deep: #d9ccbc;
  --panel: rgba(252, 249, 244, 0.88);
  --panel-strong: rgba(255, 255, 255, 0.9);
  --line: rgba(255, 255, 255, 0.88);
  --line-soft: rgba(52, 40, 30, 0.08);
  --text: #171613;
  --muted: #6d655d;
  --chip: rgba(255, 255, 255, 0.72);

  /* Ombre */
  --shadow: 0 26px 60px rgba(102, 82, 61, 0.12);
  --shadow-soft: 0 14px 32px rgba(102, 82, 61, 0.08);

  /* Raggi */
  --radius-xl: 34px;
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;

  /* Layout */
  --content-width: 1460px;

  /* Sfondo pagina */
  --page-bg:
    radial-gradient(circle at 12% 10%, rgba(255, 255, 255, 0.92), transparent 24%),
    radial-gradient(circle at 88% 12%, rgba(224, 210, 194, 0.7), transparent 20%),
    linear-gradient(180deg, #f5efe7 0%, #ece3d9 50%, #e8ddd1 100%);

  /* Colori accent (stat card) */
  --accent-blue:   #6b8afd;
  --accent-green:  #6fbf8c;
  --accent-purple: #a78bfa;
  --accent-orange: #e8a56b;
  --accent-pink:   #e88fa3;
  --accent-teal:   #6bbfb3;
  --accent-red:    #e88a8a;
}

/* ---------- 03. RESET & BASE ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background: var(--page-bg);
  overflow-x: hidden;
  line-height: 1.6;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }

/* ---------- 04. TIPOGRAFIA ---------- */
h1, h2, h3, h4, .font-display {
  font-family: "Sora", sans-serif;
  font-weight: 800;
  letter-spacing: -0.06em;
  margin: 0;
  color: var(--text);
}
h1 { font-size: clamp(2rem, 3.8vw, 3.5rem); line-height: 0.95; }
h2 { font-size: clamp(1.6rem, 3vw, 2.6rem); line-height: 1; }
h3 { font-size: clamp(1.2rem, 2vw, 1.8rem); font-weight: 700; letter-spacing: -0.04em; }

.eyebrow {
  margin: 0 0 14px;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(23, 22, 19, 0.52);
}

.lead, .text-muted {
  color: var(--muted);
  line-height: 1.7;
}

/* ---------- 05. GLOW DECORATIVI ---------- */
.page-glow {
  position: fixed;
  width: 32rem;
  height: 32rem;
  border-radius: 50%;
  filter: blur(110px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.34;
}
.page-glow-one { top: -8rem; left: -8rem; background: rgba(255, 255, 255, 0.9); }
.page-glow-two { right: -10rem; bottom: -12rem; background: rgba(204, 187, 167, 0.68); }

/* ---------- 06. SHELL & WRAPPER ---------- */
.site-shell {
  position: relative;
  z-index: 1;
  width: min(calc(100% - 28px), var(--content-width));
  margin: 18px auto 28px;
}

/* Layout dashboard: sidebar + main */
.dashboard-wrapper {
  display: flex;
  gap: 18px;
  width: min(calc(100% - 28px), var(--content-width));
  margin: 18px auto 28px;
  position: relative;
  z-index: 1;
  min-height: calc(100vh - 46px);
}

/* ---------- 07. PANEL & CARD ---------- */
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, var(--panel-strong), var(--panel));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.card {
  padding: 20px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow-soft);
  transition: transform 0.22s ease, box-shadow 0.22s ease,
              border-color 0.22s ease, background-color 0.22s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.card.is-active {
  background: rgba(255, 255, 255, 0.82);
  border-color: #1c1b19;
  box-shadow: 0 18px 36px rgba(102, 82, 61, 0.14), inset 0 0 0 2px #1c1b19;
}

/* ---------- 08. BOTTONI & PILL ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}
.button:hover, .button:focus-visible { transform: translateY(-1px); }
.button:active { transform: scale(0.98); }

.button-dark {
  color: #faf8f4;
  background: #1c1b19;
  box-shadow: 0 18px 32px rgba(28, 27, 25, 0.18);
}
.button-dark:hover { background: #2a2825; color: #faf8f4; }

.button-soft {
  color: var(--text);
  background: rgba(255, 255, 255, 0.72);
  border-color: var(--line-soft);
  box-shadow: var(--shadow-soft);
}
.button-soft:hover { background: rgba(255, 255, 255, 0.9); color: var(--text); }

.button-icon {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
}

/* Pill link (topbar) */
.pill-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-soft);
  color: rgba(23, 22, 19, 0.72);
  white-space: nowrap;
  font-weight: 600;
  font-size: 13px;
  transition: transform 0.2s ease, background-color 0.2s ease;
}
.pill-link:hover, .pill-link:focus-visible {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
}
.pill-link.is-disabled { opacity: 0.55; pointer-events: none; }

/* ---------- 09. CHIP & BADGE ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--chip);
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-soft);
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

/* ---------- 10. SIDEBAR TILES ---------- */
.sidebar-tiles {
  width: 108px;
  min-height: calc(100vh - 46px);
  max-height: calc(100vh - 46px);
  background: linear-gradient(180deg, rgba(28, 27, 25, 0.96), rgba(60, 50, 40, 0.94));
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  position: sticky;
  top: 18px;
  overflow-y: auto;
  flex-shrink: 0;
  z-index: 100;
  transition: left 0.3s ease;
}
.sidebar-tiles::-webkit-scrollbar { width: 4px; }
.sidebar-tiles::-webkit-scrollbar-track { background: transparent; }
.sidebar-tiles::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
}

.tile-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 4px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  transition: all 0.25s ease;
  cursor: pointer;
  min-height: 72px;
  position: relative;
  gap: 4px;
  text-align: center;
}
.tile-item:hover {
  background: rgba(255, 255, 255, 0.12);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  border-color: rgba(255, 255, 255, 0.12);
}
.tile-item:active { transform: scale(0.96); }
.tile-item.active {
  background: rgba(255, 255, 255, 0.18);
  color: white;
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.tile-item .tile-icon {
  font-size: 20px;
  line-height: 1;
  transition: transform 0.25s ease;
}
.tile-item:hover .tile-icon { transform: scale(1.1); }

.tile-item .tile-label {
  font-size: 9px;
  font-weight: 600;
  text-align: center;
  line-height: 1.2;
  max-width: 84px;
  word-wrap: break-word;
  letter-spacing: 0.2px;
}

.tile-item .tile-tooltip {
  display: none;
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  background: #0f172a;
  color: white;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.06);
  z-index: 200;
  pointer-events: none;
}
.tile-item .tile-tooltip::before {
  content: '';
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-right-color: #0f172a;
}
.tile-item:hover .tile-tooltip { display: block; }

/* Colori icone tile */
.tile-item.color-blue   .tile-icon { color: #7ea5ff; }
.tile-item.color-purple .tile-icon { color: #b8a2ff; }
.tile-item.color-cyan   .tile-icon { color: #7ad4f0; }
.tile-item.color-green  .tile-icon { color: #7ed6a8; }
.tile-item.color-red    .tile-icon { color: #f29a9a; }
.tile-item.color-yellow .tile-icon { color: #f5c95a; }
.tile-item.color-orange .tile-icon { color: #f3b177; }
.tile-item.color-pink   .tile-icon { color: #f0a0b8; }
.tile-item.color-indigo .tile-icon { color: #9ba6f5; }
.tile-item.color-teal   .tile-icon { color: #7ad0c5; }
.tile-item.color-rose   .tile-icon { color: #f19ba5; }
.tile-item.color-gray   .tile-icon { color: #a8b0bd; }

.tile-separator {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 4px 8px;
}

/* ---------- 11. MAIN CONTENT ---------- */
.main-content {
  flex: 1;
  min-width: 0;
  padding: 24px 28px 28px;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, var(--panel-strong), var(--panel));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

/* ---------- 12. TOP BAR ---------- */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}
.top-bar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}
.menu-toggle {
  display: none;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  width: 44px;
  height: 44px;
  font-size: 20px;
  color: var(--text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}
.menu-toggle:hover { transform: translateY(-1px); }

.page-title h1 {
  font-family: "Sora", sans-serif;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.04em;
  margin: 0;
  line-height: 1.1;
}
.page-title .subtitle {
  font-size: 14px;
  color: var(--muted);
  margin-top: 2px;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ---------- 13. WELCOME CARD ---------- */
.welcome-card {
  background: rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255, 255, 255, 0.86);
  margin-bottom: 24px;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.welcome-card:hover { box-shadow: var(--shadow); }

.welcome-card .greeting {
  font-family: "Sora", sans-serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0;
}
.welcome-card .greeting span { color: #8b6f4e; }

.welcome-card .sub-greeting {
  color: var(--muted);
  font-size: 14px;
  margin: 4px 0 0;
}

.welcome-card .welcome-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}
.welcome-card .welcome-row .info-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}
.welcome-card .welcome-row .info-item strong { color: var(--text); font-weight: 700; }
.welcome-card .welcome-row .info-item i { font-size: 15px; }

/* ---------- 14. STAT CARDS ---------- */
.stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255, 255, 255, 0.86);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  position: relative;
  overflow: hidden;
}
.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.stat-card .stat-icon {
  font-size: 26px;
  margin-bottom: 8px;
  display: inline-block;
  line-height: 1;
}

.stat-card .stat-number {
  font-family: "Sora", sans-serif;
  font-size: 30px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.15;
  letter-spacing: -0.03em;
}
.stat-card .stat-number.euro { font-size: 24px; }

.stat-card .stat-label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
  margin-top: 4px;
}

.stat-card .stat-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  margin-top: 8px;
}
.stat-card .stat-change.positive {
  background: rgba(111, 191, 140, 0.18);
  color: #2f6b48;
}
.stat-card .stat-change.negative {
  background: rgba(232, 138, 138, 0.18);
  color: #8a3a3a;
}
.stat-card .stat-change.neutral {
  background: rgba(109, 101, 93, 0.1);
  color: var(--muted);
}

.stat-card .stat-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.5;
}

.stat-card .stat-detail {
  font-size: 12px;
  color: var(--muted);
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}
.stat-card .stat-detail .detail-item {
  display: flex;
  align-items: center;
  gap: 4px;
}
.stat-card .stat-detail .detail-item strong { color: var(--text); font-weight: 700; }

/* Icona sfondo decorativa */
.stat-card .stat-bg-icon {
  position: absolute;
  right: -12px;
  bottom: -12px;
  font-size: 90px;
  opacity: 0.05;
  pointer-events: none;
  line-height: 1;
}

/* Colori accent */
.stat-card.blue   { border-left: 4px solid var(--accent-blue); }
.stat-card.blue   .stat-icon { color: var(--accent-blue); }
.stat-card.green  { border-left: 4px solid var(--accent-green); }
.stat-card.green  .stat-icon { color: var(--accent-green); }
.stat-card.purple { border-left: 4px solid var(--accent-purple); }
.stat-card.purple .stat-icon { color: var(--accent-purple); }
.stat-card.orange { border-left: 4px solid var(--accent-orange); }
.stat-card.orange .stat-icon { color: var(--accent-orange); }
.stat-card.pink   { border-left: 4px solid var(--accent-pink); }
.stat-card.pink   .stat-icon { color: var(--accent-pink); }
.stat-card.teal   { border-left: 4px solid var(--accent-teal); }
.stat-card.teal   .stat-icon { color: var(--accent-teal); }

/* ---------- 15. TOKEN WIDGET ---------- */
.token-widget {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-soft);
}

.token-widget .token-number {
  font-family: "Sora", sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.token-widget .token-label {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  display: inline-block;
  margin-bottom: 4px;
}

/* Colori numeri token */
.token-widget .text-primary   { color: #4a6cf7 !important; }
.token-widget .text-success   { color: #3f9d68 !important; }
.token-widget .text-warning   { color: #d49442 !important; }
.token-widget .text-danger    { color: #c5524f !important; }
.token-widget .text-secondary { color: #8a8178 !important; }

.no-token-warning {
  background: rgba(245, 200, 100, 0.18);
  border: 1px solid rgba(214, 158, 46, 0.4);
  color: #7a5a17;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.5;
}

/* ---------- 16. MOLTIPLICATORE WIDGET ---------- */
.moltiplicatore-widget {
  background: rgba(240, 248, 255, 0.7);
  border: 1px solid rgba(23, 162, 184, 0.3);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-soft);
}
.moltiplicatore-widget .moltiplicatore-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #0c5460;
  font-weight: 700;
}
.moltiplicatore-widget .moltiplicatore-value {
  font-family: "Sora", sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  color: #0c5460;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.moltiplicatore-widget .moltiplicatore-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(255, 243, 205, 0.9);
  color: #856404;
}
.moltiplicatore-widget .moltiplicatore-badge.ok {
  background: rgba(111, 191, 140, 0.2);
  color: #2f6b48;
}

/* ---------- 17. INFO BOX ---------- */
.info-box {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 22px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-soft);
  color: var(--muted);
  font-size: 14px;
}
.info-box i { font-size: 22px; color: var(--muted); flex-shrink: 0; }
.info-box strong { color: var(--text); font-weight: 700; }

/* ---------- 18. FOOTER ---------- */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 22px;
  margin-top: 18px;
}
.footer-brand {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  min-width: 0;
}
.footer-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-nav a {
  color: rgba(23, 22, 19, 0.72);
  font-weight: 700;
  letter-spacing: -0.02em;
  transition: color 0.2s ease;
}
.footer-nav a:hover { color: var(--text); }

.dashboard-footer {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 22px 0 8px;
  margin-top: 22px;
  border-top: 1px solid var(--line-soft);
}

/* ---------- 19. ANIMAZIONI ---------- */
@keyframes pulse {
  0%, 100% { transform: scale(0.98); opacity: 0.92; }
  50%      { transform: scale(1.04); opacity: 1; }
}

@keyframes button-arrow-bounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(4px); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes countUp {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}

.fade-in {
  animation: fadeIn 0.45s ease forwards;
}
.stat-number {
  animation: countUp 0.6s ease forwards;
}

/* ---------- 20. RESPONSIVE ---------- */
@media (max-width: 1200px) {
  .stat-card .stat-number { font-size: 26px; }
  .stat-card .stat-number.euro { font-size: 21px; }
}

@media (max-width: 992px) {
  .dashboard-wrapper {
    display: block;
    width: 100%;
    margin: 0;
    min-height: 100vh;
  }

  .sidebar-tiles {
    position: fixed;
    left: -130px;
    top: 12px;
    height: calc(100vh - 24px);
    min-height: 0;
    max-height: calc(100vh - 24px);
    border-radius: var(--radius-lg);
    z-index: 1000;
    transition: left 0.3s ease;
  }
  .sidebar-tiles.open { left: 12px; }
  .sidebar-tiles .tile-tooltip { display: none !important; }

  .main-content {
    border-radius: 0;
    border: 0;
    box-shadow: none;
    backdrop-filter: none;
    min-height: 100vh;
    padding: 18px 20px 24px;
  }

  .menu-toggle { display: inline-flex; }

  .stats-container {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
}

@media (max-width: 768px) {
  .welcome-card { padding: 20px 22px; }
  .welcome-card .greeting { font-size: 19px; }
  .page-title h1 { font-size: 22px; }

  .top-bar { flex-direction: column; align-items: stretch; }
  .top-bar-right { justify-content: flex-end; }

  .welcome-card .welcome-row { flex-direction: column; align-items: stretch; }

  .stats-container {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .stat-card { padding: 18px 20px; }
  .stat-card .stat-number { font-size: 24px; }
  .stat-card .stat-number.euro { font-size: 19px; }
}

@media (max-width: 520px) {
  .stats-container { grid-template-columns: 1fr; }

  .sidebar-tiles {
    width: 84px;
    left: -100px;
    padding: 10px 6px;
  }
  .sidebar-tiles.open { left: 8px; }
  .tile-item { min-height: 60px; padding: 8px 4px; }
  .tile-item .tile-icon { font-size: 17px; }
  .tile-item .tile-label { font-size: 8px; }

  .main-content { padding: 14px 14px 20px; }
  .stat-card .stat-number { font-size: 22px; }
  .stat-card .stat-number.euro { font-size: 18px; }

  .top-bar-right .button .btn-text { display: none; }
}

/* ---------- OVERLAY SIDEBAR MOBILE ---------- */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(23, 22, 19, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 999;
}
.sidebar-overlay.active { display: block; }

/* ============================================================
   21. HEADER (RDD_Header.php)
   ============================================================ */

/* Variabili header (coerenti col design system) */
:root {
  --header-bg: #1c1b19;
  --header-bg-light: #2a2825;
  --header-text: #faf8f4;
  --header-text-muted: rgba(250, 248, 244, 0.6);
  --header-border: rgba(255, 255, 255, 0.08);

  --piano-start: #7ea5ff;
  --piano-pro: #b8a2ff;
  --piano-enterprise: #f3b177;
}

/* --- Header principale --- */
.rdd-header {
  background: linear-gradient(135deg, var(--header-bg) 0%, var(--header-bg-light) 100%);
  color: var(--header-text);
  padding: 0 24px;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 6px 24px rgba(28, 27, 25, 0.16);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--header-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1;
  min-width: 0;
}

.logos-container {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-right: 20px;
  border-right: 1px solid var(--header-border);
  flex-shrink: 0;
}

.logo-item { display: flex; align-items: center; }

.logo-img {
  height: 32px;
  width: auto;
  object-fit: contain;
  transition: transform 0.25s ease, filter 0.25s ease;
}
.logo-img:hover {
  transform: scale(1.05);
  filter: brightness(1.1);
}
.logo-img.plasma-logo { height: 32px; }
.logo-img.azienda-logo { height: 34px; }

.logo-divider {
  width: 1px;
  height: 32px;
  background: var(--header-border);
  flex-shrink: 0;
}

.header-brand-mobile {
  display: none;
  align-items: center;
  gap: 8px;
}
.header-brand-mobile .brand-text {
  font-family: "Sora", sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--header-text);
  letter-spacing: -0.03em;
}
.header-brand-mobile .brand-text span { color: #8b6f4e; }

.azienda-name {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 16px;
  border-left: 1px solid var(--header-border);
}
.azienda-name .name {
  font-size: 14px;
  font-weight: 600;
  color: var(--header-text);
  white-space: nowrap;
}
.azienda-name .cod {
  font-size: 11px;
  color: var(--header-text-muted);
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 10px;
  border-radius: 50px;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--header-text);
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
}

/* --- Navigazione desktop --- */
.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.rdd-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.rdd-nav-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  color: var(--header-text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.25s ease;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
}
.rdd-nav-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--header-text);
  border-color: var(--header-border);
}
.rdd-nav-btn.active {
  background: rgba(255, 255, 255, 0.12);
  color: var(--header-text);
  border-color: rgba(255, 255, 255, 0.18);
}
.rdd-nav-btn i { font-size: 15px; }

/* --- Info utente --- */
.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 16px;
  border-left: 1px solid var(--header-border);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b6f4e, #b89b78);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #faf8f4;
  font-family: "Sora", sans-serif;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
}

.user-details {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.user-details .user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--header-text);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-details .user-role {
  font-size: 10px;
  color: var(--header-text-muted);
}
.user-details .user-piano {
  font-size: 9px;
  font-weight: 700;
  margin-top: 1px;
}
.user-details .user-piano.start      { color: var(--piano-start); }
.user-details .user-piano.pro        { color: var(--piano-pro); }
.user-details .user-piano.enterprise { color: var(--piano-enterprise); }

/* --- Bottone logout (nell'header, variante compatta) --- */
.btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(220, 38, 38, 0.15);
  color: #f0a3a3;
  border: 1px solid rgba(220, 38, 38, 0.22);
  border-radius: 999px;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.25s ease;
}
.btn-logout:hover {
  background: rgba(220, 38, 38, 0.25);
  color: #fdd0d0;
  transform: translateY(-1px);
}
.btn-logout i { font-size: 13px; }

/* --- Mobile nav overlay --- */
.mobile-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(28, 27, 25, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 999;
}
.mobile-nav-overlay.active { display: block; }

.mobile-nav {
  position: fixed;
  top: 0;
  right: -320px;
  width: 300px;
  height: 100vh;
  background: var(--header-bg);
  padding: 24px 20px;
  z-index: 1001;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.28);
}
.mobile-nav.open { right: 0; }

.mobile-nav .mobile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--header-border);
}
.mobile-nav .mobile-header .brand {
  font-family: "Sora", sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: var(--header-text);
  letter-spacing: -0.04em;
}
.mobile-nav .mobile-header .brand span { color: #8b6f4e; }

.mobile-nav .mobile-close {
  background: none;
  border: none;
  color: var(--header-text-muted);
  font-size: 28px;
  cursor: pointer;
  transition: transform 0.25s ease, color 0.25s ease;
}
.mobile-nav .mobile-close:hover {
  color: var(--header-text);
  transform: rotate(90deg);
}

.mobile-nav .mobile-logos {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}
.mobile-nav .mobile-logos img {
  height: 30px;
  width: auto;
  object-fit: contain;
}
.mobile-nav .mobile-logos .divider {
  width: 1px;
  height: 24px;
  background: var(--header-border);
}

.mobile-nav .mobile-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}
.mobile-nav .mobile-user .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b6f4e, #b89b78);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #faf8f4;
  font-family: "Sora", sans-serif;
  font-weight: 800;
  font-size: 16px;
  flex-shrink: 0;
}
.mobile-nav .mobile-user .info .name {
  font-size: 14px;
  font-weight: 600;
  color: var(--header-text);
}
.mobile-nav .mobile-user .info .role {
  font-size: 12px;
  color: var(--header-text-muted);
}

.mobile-nav .mobile-nav-links {
  list-style: none;
  padding: 0;
  margin: 0;
}
.mobile-nav .mobile-nav-links li { margin-bottom: 2px; }
.mobile-nav .mobile-nav-links a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--header-text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}
.mobile-nav .mobile-nav-links a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--header-text);
}
.mobile-nav .mobile-nav-links a i {
  width: 20px;
  text-align: center;
  font-size: 16px;
}
.mobile-nav .mobile-nav-links .nav-divider {
  padding: 8px 14px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.28);
  font-weight: 700;
  margin-top: 8px;
}

.mobile-nav .mobile-logout {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--header-border);
}
.mobile-nav .mobile-logout .btn-logout-mobile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  color: #f0a3a3;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: background-color 0.2s ease;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
}
.mobile-nav .mobile-logout .btn-logout-mobile:hover {
  background: rgba(220, 38, 38, 0.15);
}
.mobile-nav .mobile-logout .btn-logout-mobile i {
  width: 20px;
  text-align: center;
  font-size: 16px;
}

/* --- Responsive header --- */
@media (max-width: 1200px) {
  .rdd-nav-btn {
    padding: 5px 10px;
    font-size: 12px;
  }
  .rdd-nav-btn i { font-size: 14px; }
}

@media (max-width: 992px) {
  .rdd-header {
    padding: 0 16px;
    height: 64px;
  }
  .rdd-nav { display: none; }
  .menu-toggle { display: block; }
  .logos-container { padding-right: 12px; gap: 10px; }
  .logo-img              { height: 30px; }
  .logo-img.plasma-logo  { height: 26px; }
  .logo-img.azienda-logo { height: 28px; }
  .azienda-name { display: none; }
  .user-details .user-role,
  .user-details .user-piano { display: none; }
  .user-info { padding-left: 8px; border-left: none; }
  .btn-logout .btn-text { display: none; }
  .header-brand-mobile { display: flex; }
}

@media (max-width: 576px) {
  .rdd-header {
    padding: 0 10px;
    height: 58px;
  }
  .logos-container { gap: 8px; padding-right: 8px; }
  .logo-img              { height: 24px; }
  .logo-img.plasma-logo  { height: 20px; }
  .logo-img.azienda-logo { height: 22px; }
  .user-avatar { width: 30px; height: 30px; font-size: 12px; }
  .user-details .user-name { font-size: 12px; max-width: 80px; }
  .btn-logout { padding: 4px 10px; font-size: 11px; }
  .btn-logout i { font-size: 12px; }
  .mobile-nav { width: 280px; right: -300px; }
}

/* --- Utility condivisa --- */
.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================================
   22. LISTA UTENTI (RDD_ListaUtenti.php)
   ============================================================ */

/* Contenitore pagina (sotto l'header) */
.page-shell {
  max-width: var(--content-width);
  margin: 0 auto;
  padding-top: 28px;
  padding-bottom: 40px;
}

/* Titolo pagina */
.page-shell h2 {
  font-family: "Sora", sans-serif;
  font-weight: 800;
  letter-spacing: -0.04em;
  font-size: 26px;
  color: var(--text);
  margin: 0;
}
.page-shell h2 i { color: #8b6f4e; }

/* Sottotitolo muted */
.page-shell .text-muted {
  color: var(--muted) !important;
}

/* ============================================================
   STAT CARDS (versione compatta per liste)
   ============================================================ */
.stats-card {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-left: 4px solid;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.stats-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.stats-card .card-body {
  padding: 14px 18px !important;
}

.stats-card .stats-number {
  font-family: "Sora", sans-serif;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-top: 2px;
}

.stats-card small {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
}

/* Colori bordi stats-card (Bootstrap ci mette già .border-*) */
.stats-card.border-success  { border-left-color: #3f9d68 !important; }
.stats-card.border-danger   { border-left-color: #c5524f !important; }
.stats-card.border-warning  { border-left-color: #d49442 !important; }
.stats-card.border-secondary{ border-left-color: #8a8178 !important; }
.stats-card.border-info     { border-left-color: #4a8fa8 !important; }
.stats-card.border-primary  { border-left-color: #6b8afd !important; }

/* ============================================================
   CARD GENERICHE (filtri, tabella)
   ============================================================ */
.page-shell .card {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.page-shell .card-header {
  background: rgba(255, 255, 255, 0.5);
  border-bottom: 1px solid var(--line-soft);
  padding: 16px 22px;
}
.page-shell .card-header h5 {
  font-family: "Sora", sans-serif;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: 15px;
  margin: 0;
}
.page-shell .card-footer {
  background: rgba(255, 255, 255, 0.5);
  border-top: 1px solid var(--line-soft);
  padding: 14px 22px;
}

/* ============================================================
   FORM & INPUT
   ============================================================ */
.page-shell .form-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.page-shell .form-control,
.page-shell .form-select,
.page-shell .input-group-text {
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.8);
  font-size: 13px;
  min-height: 42px;
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.page-shell .form-control:focus,
.page-shell .form-select:focus {
  border-color: #b89b78;
  box-shadow: 0 0 0 3px rgba(184, 155, 120, 0.15);
  background: white;
}
.page-shell .input-group-text {
  background: rgba(255, 255, 255, 0.6);
  color: var(--muted);
}

/* ============================================================
   BOTTONI (override Bootstrap con palette Plasma)
   ============================================================ */
.page-shell .btn {
  border-radius: 999px;
  font-weight: 600;
  font-size: 13px;
  padding: 8px 18px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  border: 1px solid transparent;
}
.page-shell .btn:hover { transform: translateY(-1px); }

.page-shell .btn-primary {
  background: #1c1b19;
  border-color: #1c1b19;
  box-shadow: 0 12px 24px rgba(28, 27, 25, 0.18);
}
.page-shell .btn-primary:hover { background: #2a2825; border-color: #2a2825; }

.page-shell .btn-secondary {
  background: rgba(109, 101, 93, 0.15);
  color: var(--text);
  border-color: transparent;
}
.page-shell .btn-secondary:hover { background: rgba(109, 101, 93, 0.25); color: var(--text); }

.page-shell .btn-outline-secondary {
  background: rgba(255, 255, 255, 0.72);
  border-color: var(--line-soft);
  color: var(--text);
  box-shadow: var(--shadow-soft);
}
.page-shell .btn-outline-secondary:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: #b89b78;
  color: var(--text);
}

/* Bottoni action (tabella) — compatti */
.btn-sm-action {
  padding: 5px 9px;
  font-size: 12px;
  border-radius: 10px;
  line-height: 1;
  min-width: 32px;
}
.btn-sm-action i { font-size: 13px; }

/* Colori action buttons (morbidi) */
.btn-info.btn-sm-action {
  background: rgba(74, 143, 168, 0.15);
  border-color: transparent;
  color: #2d5f73;
}
.btn-info.btn-sm-action:hover { background: rgba(74, 143, 168, 0.25); color: #1e4553; }

.btn-warning.btn-sm-action {
  background: rgba(212, 148, 66, 0.18);
  border-color: transparent;
  color: #8b5a17;
}
.btn-warning.btn-sm-action:hover { background: rgba(212, 148, 66, 0.28); color: #5f3d0f; }

.btn-success.btn-sm-action {
  background: rgba(63, 157, 104, 0.18);
  border-color: transparent;
  color: #2a6544;
}
.btn-success.btn-sm-action:hover { background: rgba(63, 157, 104, 0.28); color: #1a4630; }

.btn-danger.btn-sm-action {
  background: rgba(197, 82, 79, 0.15);
  border-color: transparent;
  color: #8a3a3a;
}
.btn-danger.btn-sm-action:hover { background: rgba(197, 82, 79, 0.25); color: #5f2828; }

.btn-secondary.btn-sm-action {
  background: rgba(109, 101, 93, 0.15);
  border-color: transparent;
  color: var(--text);
}
.btn-secondary.btn-sm-action:hover { background: rgba(109, 101, 93, 0.25); color: var(--text); }

.btn-disabled-operator {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* ============================================================
   TABELLA UTENTI
   ============================================================ */
.page-shell .table-responsive {
  border-radius: 0;
}

.page-shell .table {
  --bs-table-bg: transparent;
  --bs-table-striped-bg: rgba(250, 248, 244, 0.4);
  --bs-table-hover-bg: rgba(184, 155, 120, 0.08);
  margin-bottom: 0;
  font-size: 13px;
  color: var(--text);
}

.page-shell .table > :not(caption) > * > * {
  padding: 12px 14px;
  border-bottom-color: var(--line-soft);
  vertical-align: middle;
}

.page-shell .table thead.table-dark th {
  background: #1c1b19;
  color: #faf8f4;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: 0;
  padding: 14px 14px;
  white-space: nowrap;
}

.page-shell .table-hover tbody tr:hover {
  background-color: rgba(184, 155, 120, 0.08);
}

/* Riga Admin */
.page-shell .admin-row {
  background-color: rgba(139, 0, 0, 0.04);
}
.page-shell .admin-row td:first-child {
  border-left: 3px solid #8b0000;
}

/* Colonna azioni */
.table-actions {
  white-space: nowrap;
  min-width: 280px;
}
.table-actions .btn { margin: 0; }

/* ============================================================
   TOKEN CELL
   ============================================================ */
.token-cell {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}
.token-cell .token-text {
  background: rgba(255, 255, 255, 0.7);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--line-soft);
  cursor: pointer;
  transition: background-color 0.2s ease;
  color: var(--text);
}
.token-cell .token-text:hover {
  background: rgba(184, 155, 120, 0.15);
}
.copy-token {
  cursor: pointer;
  color: var(--muted);
  transition: color 0.2s ease;
}
.copy-token:hover { color: #8b6f4e; }

/* ============================================================
   BADGES
   ============================================================ */
.page-shell .badge {
  font-weight: 700;
  font-size: 10px;
  padding: 4px 9px;
  border-radius: 999px;
  letter-spacing: 0.02em;
  vertical-align: middle;
}

.page-shell .badge-admin {
  background: #8b0000;
  color: white;
}
.page-shell .badge-email-sent    { background: #3f9d68; }
.page-shell .badge-email-failed  { background: #c5524f; }
.page-shell .badge-email-pending { background: #8a8178; }

/* Override Bootstrap badge bg-* con palette Plasma */
.page-shell .badge.bg-primary   { background: #6b8afd !important; }
.page-shell .badge.bg-success   { background: #3f9d68 !important; }
.page-shell .badge.bg-danger    { background: #c5524f !important; }
.page-shell .badge.bg-warning   { background: #d49442 !important; color: #4a3208 !important; }
.page-shell .badge.bg-info      { background: #4a8fa8 !important; }
.page-shell .badge.bg-secondary { background: #8a8178 !important; }

/* ============================================================
   ALERT
   ============================================================ */
.page-shell .alert {
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: 14px;
  padding: 14px 20px;
}
.page-shell .alert-success {
  background: rgba(63, 157, 104, 0.12);
  border-color: rgba(63, 157, 104, 0.25);
  color: #2a6544;
}
.page-shell .alert-danger {
  background: rgba(197, 82, 79, 0.12);
  border-color: rgba(197, 82, 79, 0.25);
  color: #8a3a3a;
}
.page-shell .alert-info {
  background: rgba(74, 143, 168, 0.12);
  border-color: rgba(74, 143, 168, 0.25);
  color: #2d5f73;
}
.page-shell .alert-warning {
  background: rgba(212, 148, 66, 0.14);
  border-color: rgba(212, 148, 66, 0.3);
  color: #6b4519;
}

/* ============================================================
   PAGINAZIONE
   ============================================================ */
.page-shell .pagination .page-link {
  border-radius: 12px !important;
  margin: 0 3px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
  min-width: 38px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.page-shell .pagination .page-link:hover {
  background: rgba(184, 155, 120, 0.15);
  border-color: #b89b78;
  color: var(--text);
}
.page-shell .pagination .page-item.active .page-link {
  background: #1c1b19;
  border-color: #1c1b19;
  color: #faf8f4;
}
.page-shell .pagination .page-item.disabled .page-link {
  opacity: 0.4;
  background: rgba(255, 255, 255, 0.4);
}

/* ============================================================
   MODALS
   ============================================================ */
.modal-content {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel-strong), var(--panel));
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}
.modal-header {
  border-bottom: 1px solid var(--line-soft);
  padding: 18px 22px;
}
.modal-title {
  font-family: "Sora", sans-serif;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: 17px;
}
.modal-body { padding: 22px; }
.modal-footer {
  border-top: 1px solid var(--line-soft);
  padding: 16px 22px;
}

.modal-token {
  font-family: 'Courier New', monospace;
  font-size: 18px;
  background: rgba(255, 255, 255, 0.7);
  padding: 16px;
  border-radius: var(--radius-md);
  border: 2px dashed #b89b78;
  text-align: center;
  word-break: break-all;
  cursor: pointer;
  color: var(--text);
  transition: background-color 0.2s ease;
}
.modal-token:hover { background: rgba(184, 155, 120, 0.1); }

.modal .btn-close { opacity: 0.5; }
.modal .btn-close:hover { opacity: 0.9; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 992px) {
  .page-shell { padding-top: 20px; padding-bottom: 28px; }
  .page-shell h2 { font-size: 22px; }
  .stats-card .stats-number { font-size: 22px; }
  .table-actions { min-width: auto; }
}

@media (max-width: 576px) {
  .page-shell { padding-left: 12px; padding-right: 12px; }
  .page-shell .card-header,
  .page-shell .card-footer { padding-left: 14px; padding-right: 14px; }
  .stats-card .stats-number { font-size: 20px; }
  .btn-sm-action { padding: 4px 7px; }
}

/* ============================================================
   23. SICUREZZA — Token/Email mascherati
   ============================================================ */

.email-cell {
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  transition: background-color 0.2s ease;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  user-select: none;
}
.email-cell:hover {
  background: rgba(184, 155, 120, 0.15);
}
.email-cell.email-revealed {
  background: rgba(63, 157, 104, 0.12);
  color: #2a6544;
  font-weight: 600;
}

.token-text {
  transition: background-color 0.2s ease, color 0.2s ease;
}
.token-text.token-masked {
  color: var(--muted);
  cursor: help;
}
.token-text.token-revealed {
  background: rgba(63, 157, 104, 0.15);
  color: #2a6544;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}

.copy-token {
  cursor: pointer;
  color: var(--muted);
  transition: color 0.2s ease, transform 0.2s ease;
}
.copy-token:hover {
  color: #8b6f4e;
  transform: scale(1.15);
}

/* ============================================================
   24. LISTA MODELLI (RDD_ListaModelli.php)
   ============================================================ */

/* Contenitore principale — sostituisce .content-container */
.main-container {
  padding: 24px;
  margin-top: 0;
  min-height: calc(100vh - 76px);
}

.content-container {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 28px 32px;
  background: linear-gradient(180deg, var(--panel-strong), var(--panel));
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

/* --- Page header --- */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line-soft);
}

.page-header h1 {
  font-family: "Sora", sans-serif;
  color: var(--text);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.04em;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}
.page-header h1 i {
  color: #8b6f4e;
}

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

/* --- Search section --- */
.search-section {
  background: rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  margin-bottom: 24px;
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-soft);
}

.search-form {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.search-form .input-group {
  flex: 1;
  min-width: 250px;
  position: relative;
}
.search-form .input-group input {
  width: 100%;
  padding: 12px 45px 12px 20px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  font-size: 14px;
  font-family: "Manrope", sans-serif;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
}
.search-form .input-group input::placeholder {
  color: var(--muted);
}
.search-form .input-group input:focus {
  border-color: #b89b78;
  outline: none;
  box-shadow: 0 0 0 3px rgba(184, 155, 120, 0.15);
  background: white;
}
.search-form .input-group .search-icon {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

/* --- Bottoni (override palette Plasma) --- */
.content-container .btn {
  padding: 10px 20px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 13px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.content-container .btn:hover { transform: translateY(-1px); }

.content-container .btn-primary {
  background: #1c1b19;
  color: #faf8f4;
  box-shadow: 0 12px 24px rgba(28, 27, 25, 0.18);
}
.content-container .btn-primary:hover {
  background: #2a2825;
  box-shadow: 0 16px 28px rgba(28, 27, 25, 0.22);
}

.content-container .btn-secondary {
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-soft);
}
.content-container .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.95);
}

.content-container .btn-success {
  background: rgba(63, 157, 104, 0.15);
  color: #2a6544;
  border: 1px solid rgba(63, 157, 104, 0.25);
}
.content-container .btn-success:hover {
  background: rgba(63, 157, 104, 0.25);
}

.content-container .btn-warning {
  background: rgba(212, 148, 66, 0.18);
  color: #8b5a17;
  border: 1px solid rgba(212, 148, 66, 0.3);
}
.content-container .btn-warning:hover {
  background: rgba(212, 148, 66, 0.28);
}

.content-container .btn-outline-secondary {
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  border: 1px solid var(--line-soft);
}
.content-container .btn-outline-secondary:hover {
  background: white;
  border-color: #b89b78;
}

/* --- Stats cards --- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.72);
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-soft);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.stat-icon.active {
  background: rgba(63, 157, 104, 0.15);
  color: #2a6544;
}
.stat-icon.inactive {
  background: rgba(197, 82, 79, 0.15);
  color: #8a3a3a;
}
.stat-icon.total {
  background: rgba(184, 155, 120, 0.18);
  color: #8b6f4e;
}

.stat-info h4 {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.stat-info p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

/* --- Section divider (titoli sezioni attivo/non attivo) --- */
.section-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 28px 0 18px 0;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-lg);
  border-left: 4px solid var(--accent-red);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease;
  user-select: none;
}
.section-divider:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: translateX(4px);
}

.section-divider .section-title {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-divider .section-title i { font-size: 18px; }

.section-divider .section-count {
  background: var(--accent-red);
  color: white;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.section-divider .toggle-icon {
  margin-left: auto;
  font-size: 14px;
  transition: transform 0.3s ease;
  color: var(--muted);
}
.section-divider .toggle-icon.collapsed {
  transform: rotate(-90deg);
}

/* --- Griglia modelli --- */
.modelli-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
  margin-top: 18px;
  transition: all 0.3s ease;
}
.modelli-grid.hidden { display: none; }

.modello-card {
  background: rgba(255, 255, 255, 0.75);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.86);
  position: relative;
  display: flex;
  flex-direction: column;
}
.modello-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
  border-color: #b89b78;
}

.modello-card.inactive {
  opacity: 0.88;
  border-left: 4px solid var(--accent-red);
}
.modello-card.inactive:hover { opacity: 1; }

/* --- Immagine --- */
.image-container {
  width: 100%;
  height: 220px;
  background: rgba(250, 248, 244, 0.9);
  position: relative;
  overflow: hidden;
}

.image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.5s ease, transform 0.5s ease;
  opacity: 0;
}
.image-container img.loaded { opacity: 1; }
.modello-card:hover .image-container img.loaded { transform: scale(1.05); }

.image-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(250, 248, 244, 0.9) 0%, rgba(232, 221, 209, 0.9) 100%);
  color: var(--muted);
  font-size: 14px;
  transition: opacity 0.5s ease;
}
.image-placeholder.hidden {
  opacity: 0;
  pointer-events: none;
}
.image-placeholder i {
  font-size: 42px;
  margin-bottom: 8px;
  color: #c9bba8;
}

.image-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  border: 3px solid rgba(184, 155, 120, 0.2);
  border-top: 3px solid #8b6f4e;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.image-loader.active { opacity: 1; }

@keyframes spin {
  0%   { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* --- Badges --- */
.badge-container {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.content-container .badge {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.badge-active {
  background: rgba(63, 157, 104, 0.92);
  color: white;
}
.badge-inactive {
  background: rgba(197, 82, 79, 0.92);
  color: white;
}

.badge-primary {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(28, 27, 25, 0.88);
  color: #faf8f4;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(6px);
}

/* --- Card info --- */
.modello-info {
  padding: 18px 20px 14px;
  flex: 1;
}
.modello-info h3 {
  font-family: "Sora", sans-serif;
  margin: 0 0 8px 0;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}
.modello-info .description {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 12px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 40px;
}

.modello-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  font-size: 12px;
  color: var(--text);
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}
.modello-details .detail-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.modello-details .detail-item i {
  width: 14px;
  color: #8b6f4e;
  font-size: 12px;
}
.modello-details .detail-item .label {
  color: var(--muted);
  font-weight: 600;
}

/* --- Card actions --- */
.modello-actions {
  padding: 14px 20px;
  background: rgba(250, 248, 244, 0.6);
  border-top: 1px solid var(--line-soft);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.modello-actions .btn {
  flex: 1;
  justify-content: center;
  padding: 9px 12px;
  font-size: 12px;
  min-width: 80px;
}

/* --- Pagination --- */
.pagination-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.pagination {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.pagination .page-link {
  padding: 8px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
  transition: all 0.2s ease;
  font-weight: 600;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.7);
  min-width: 38px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.pagination .page-link:hover {
  background: rgba(184, 155, 120, 0.15);
  border-color: #b89b78;
  transform: translateY(-2px);
  color: var(--text);
}
.pagination .page-link.active {
  background: #1c1b19;
  color: #faf8f4;
  border-color: #1c1b19;
}
.pagination .page-link.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.4);
}

.pagination-info {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

/* --- No results --- */
.no-results {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.no-results i {
  color: #c9bba8;
  margin-bottom: 20px;
}
.no-results h3 {
  font-family: "Sora", sans-serif;
  color: var(--text);
  margin-bottom: 10px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

/* --- Responsive --- */
@media (max-width: 992px) {
  .main-container { padding: 16px; }
  .content-container { padding: 20px 18px; }
  .page-header h1 { font-size: 22px; }
  .stats-row { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .content-container { padding: 16px 14px; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .page-header h1 { font-size: 20px; }
  .stats-row { grid-template-columns: 1fr 1fr; gap: 12px; }
  .modelli-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
  }
  .search-form { flex-direction: column; align-items: stretch; }
  .search-form .input-group { min-width: auto; }
  .search-form .btn { width: 100%; justify-content: center; }
  .modello-details { grid-template-columns: 1fr; }
  .pagination-section { flex-direction: column; align-items: center; text-align: center; }
  .section-divider { flex-wrap: wrap; }
}

@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr; }
  .modelli-grid { grid-template-columns: 1fr; }
  .stat-card { padding: 16px; }
  .stat-info h4 { font-size: 20px; }
  .modello-actions .btn { font-size: 11px; padding: 8px 10px; }
}

/* ============================================================
   25. DASHBOARD MODELLO (RDD_DashboardModello.php)
   ============================================================ */

/* --- Contenitore principale --- */
.app-container {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 28px 32px;
  min-height: calc(100vh - 76px);
}

/* --- Header pagina --- */
.header { margin-bottom: 28px; }

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.header-title h1 {
  font-family: "Sora", sans-serif;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.05em;
  color: var(--text);
  line-height: 1.1;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}
.header-title h1 i {
  color: #8b6f4e;
  font-size: 26px;
}

.header-title p {
  color: var(--muted);
  font-size: 14px;
  margin-top: 4px;
  margin-bottom: 0;
}

.header-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* --- Breadcrumb --- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.breadcrumb a {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease;
}
.breadcrumb a:hover { color: #8b6f4e; }
.breadcrumb i { color: var(--muted); font-size: 9px; }
.breadcrumb span { color: var(--text); font-weight: 700; }

/* --- Alert --- */
.app-container .alert {
  padding: 14px 20px;
  border-radius: var(--radius-md);
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid transparent;
  animation: slideIn 0.3s ease;
  font-size: 14px;
}
.app-container .alert i { font-size: 18px; flex-shrink: 0; }

.app-container .alert-success {
  background: rgba(63, 157, 104, 0.12);
  border-color: rgba(63, 157, 104, 0.25);
  color: #2a6544;
}
.app-container .alert-danger {
  background: rgba(197, 82, 79, 0.12);
  border-color: rgba(197, 82, 79, 0.25);
  color: #8a3a3a;
}
.app-container .alert-info {
  background: rgba(74, 143, 168, 0.12);
  border-color: rgba(74, 143, 168, 0.25);
  color: #2d5f73;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- Stats grid --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stats-grid .stat-card {
  background: rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-soft);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  border: 1px solid rgba(255, 255, 255, 0.86);
  position: relative;
  overflow: hidden;
}
.stats-grid .stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #b89b78, #d4bea0);
}
.stats-grid .stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.stats-grid .stat-icon {
  width: 48px;
  height: 48px;
  background: rgba(184, 155, 120, 0.15);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.stats-grid .stat-icon i {
  font-size: 22px;
  color: #8b6f4e;
}

.stats-grid .stat-value {
  font-family: "Sora", sans-serif;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.1;
}
.stats-grid .stat-label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

/* --- Model card --- */
.model-card {
  background: rgba(255, 255, 255, 0.75);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 28px;
  border: 1px solid var(--line);
}

.model-card-header {
  background: linear-gradient(135deg, #1c1b19 0%, #2a2825 100%);
  padding: 20px 26px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.model-card-header h2 {
  color: #faf8f4;
  font-family: "Sora", sans-serif;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}
.model-card-header h2 i {
  font-size: 20px;
  color: #d4bea0;
}

.toggle-edit-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #faf8f4;
  padding: 9px 18px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}
.toggle-edit-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}

.model-card-body { padding: 26px; }

.model-info-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 32px;
}

.model-image-area { text-align: center; }

.model-image {
  width: 100%;
  max-width: 280px;
  height: auto;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  background: rgba(250, 248, 244, 0.9);
  object-fit: cover;
}

.placeholder-image {
  width: 100%;
  max-width: 280px;
  height: 200px;
  margin: 0 auto;
  background: linear-gradient(135deg, rgba(250, 248, 244, 0.9), rgba(232, 221, 209, 0.9));
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 13px;
  gap: 8px;
  border: 2px dashed rgba(184, 155, 120, 0.3);
}
.placeholder-image i { color: #c9bba8; }

.details-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.detail-field {
  background: rgba(250, 248, 244, 0.7);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border-left: 3px solid #b89b78;
}
.detail-field label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.detail-field label i { font-size: 11px; }
.detail-field value,
.detail-field .value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  display: block;
}

/* --- Edit form --- */
.edit-form {
  background: rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 28px;
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-soft);
}
.edit-form h4 {
  font-family: "Sora", sans-serif;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: 17px;
  margin-bottom: 20px;
  color: var(--text);
}
.edit-form h4 i { color: #8b6f4e; margin-right: 6px; }

.edit-form .form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

/* --- Form elements --- */
.form-group { margin-bottom: 14px; }

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-control {
  width: 100%;
  padding: 11px 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: "Manrope", sans-serif;
  transition: all 0.2s ease;
  background: rgba(255, 255, 255, 0.85);
  color: var(--text);
  min-height: 42px;
}
.form-control:focus {
  outline: none;
  border-color: #b89b78;
  box-shadow: 0 0 0 3px rgba(184, 155, 120, 0.15);
  background: white;
}
select.form-control { cursor: pointer; }

/* --- Bottoni --- */
.app-container .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  font-family: "Manrope", sans-serif;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.2;
}
.app-container .btn:hover { transform: translateY(-1px); }

.app-container .btn-primary {
  background: #1c1b19;
  color: #faf8f4;
  box-shadow: 0 12px 24px rgba(28, 27, 25, 0.18);
}
.app-container .btn-primary:hover {
  background: #2a2825;
  box-shadow: 0 16px 28px rgba(28, 27, 25, 0.22);
}

.app-container .btn-secondary {
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  border-color: var(--line-soft);
  box-shadow: var(--shadow-soft);
}
.app-container .btn-secondary:hover { background: rgba(255, 255, 255, 0.95); }

.app-container .btn-success {
  background: rgba(63, 157, 104, 0.15);
  color: #2a6544;
  border-color: rgba(63, 157, 104, 0.25);
}
.app-container .btn-success:hover { background: rgba(63, 157, 104, 0.25); }

.app-container .btn-warning {
  background: rgba(212, 148, 66, 0.18);
  color: #8b5a17;
  border-color: rgba(212, 148, 66, 0.3);
}
.app-container .btn-warning:hover { background: rgba(212, 148, 66, 0.28); }

.app-container .btn-danger {
  background: rgba(197, 82, 79, 0.15);
  color: #8a3a3a;
  border-color: rgba(197, 82, 79, 0.25);
}
.app-container .btn-danger:hover { background: rgba(197, 82, 79, 0.25); }

.app-container .btn-info {
  background: rgba(74, 143, 168, 0.15);
  color: #2d5f73;
  border-color: rgba(74, 143, 168, 0.25);
}
.app-container .btn-info:hover { background: rgba(74, 143, 168, 0.25); }

.app-container .btn-outline {
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-soft);
}
.app-container .btn-outline:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: #b89b78;
}

.app-container .btn-sm {
  padding: 7px 14px;
  font-size: 12px;
}

.btn-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
}

/* --- Section --- */
.section {
  background: rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 28px;
  border: 1px solid var(--line);
}

.section-header {
  padding: 18px 26px;
  background: rgba(250, 248, 244, 0.6);
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}
.section-header h3 {
  font-family: "Sora", sans-serif;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  margin: 0;
}
.section-header h3 i { color: #8b6f4e; }

.section-body { padding: 26px; }

/* --- Feature cards grid --- */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

.feature-card {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-lg);
  padding: 22px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}
.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: #b89b78;
}

.feature-card-icon {
  width: 54px;
  height: 54px;
  background: linear-gradient(135deg, rgba(184, 155, 120, 0.15), rgba(212, 190, 160, 0.08));
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.feature-card-icon i {
  font-size: 24px;
  color: #8b6f4e;
}

.feature-card h4 {
  font-family: "Sora", sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
  color: var(--text);
}

.feature-card p {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
  line-height: 1.55;
}

.feature-card .badge {
  position: absolute;
  top: 18px;
  right: 18px;
  background: rgba(184, 155, 120, 0.15);
  color: #8b6f4e;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* --- Titoli grid --- */
.titoli-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 18px;
}

.titolo-card {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  box-shadow: var(--shadow-soft);
}
.titolo-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.titolo-card-header {
  padding: 14px 20px;
  background: rgba(250, 248, 244, 0.7);
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.titolo-lang {
  font-weight: 700;
  color: var(--text);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.titolo-lang i { color: #8b6f4e; }

.status-badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.status-active {
  background: rgba(63, 157, 104, 0.18);
  color: #2a6544;
}
.status-inactive {
  background: rgba(197, 82, 79, 0.15);
  color: #8a3a3a;
}

.titolo-card-body { padding: 18px 20px; }

.titolo-preview {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  max-height: 100px;
  overflow: hidden;
  position: relative;
}
.titolo-preview::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 36px;
  background: linear-gradient(transparent, rgba(255, 255, 255, 0.9));
}

.titolo-card-footer {
  padding: 12px 20px;
  background: rgba(250, 248, 244, 0.5);
  border-top: 1px solid var(--line-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.titolo-date {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* --- Form titolo --- */
.form-titolo {
  background: rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 28px;
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-soft);
}
.form-titolo h4 {
  font-family: "Sora", sans-serif;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: 17px;
  margin-bottom: 20px;
}
.form-titolo h4 i { color: #8b6f4e; margin-right: 6px; }
.form-titolo .form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

/* --- Summernote custom --- */
.note-editor.note-frame {
  border: 1px solid var(--line-soft) !important;
  border-radius: var(--radius-sm) !important;
  background: rgba(255, 255, 255, 0.85);
}
.note-toolbar {
  background: rgba(250, 248, 244, 0.8) !important;
  border-bottom: 1px solid var(--line-soft) !important;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0 !important;
}
.note-editable {
  font-family: "Manrope", sans-serif !important;
  font-size: 14px !important;
  min-height: 250px !important;
  background: white !important;
  color: var(--text) !important;
}

/* --- Responsive --- */
@media (max-width: 992px) {
  .app-container { padding: 20px; }
  .model-info-grid { grid-template-columns: 1fr; }
  .details-grid { grid-template-columns: repeat(2, 1fr); }
  .header-title h1 { font-size: 24px; }
}

@media (max-width: 768px) {
  .app-container { padding: 16px; }
  .header-top { flex-direction: column; align-items: flex-start; }
  .header-title h1 { font-size: 22px; }
  .details-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .titoli-grid { grid-template-columns: 1fr; }
  .cards-grid { grid-template-columns: 1fr; }
  .model-card-header { padding: 16px 18px; }
  .section-header { padding: 16px 18px; }
  .section-body { padding: 18px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .app-container .btn { padding: 8px 16px; font-size: 12px; }
  .app-container .btn-sm { padding: 6px 12px; }
}

/* ============================================================
   26. STAT CARDS — versione leggibile (Dashboard)
   ============================================================ */

.stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

/* --- Card base --- */
.stat-card {
  background: rgba(255, 255, 255, 0.85);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-left: 4px solid var(--line-soft);
  box-shadow: var(--shadow-soft);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

/* --- Header: icona + label --- */
.stat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 2px;
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 18px;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
}

.stat-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  line-height: 1.3;
}

/* --- Numero grande --- */
.stat-number {
  font-family: "Sora", sans-serif;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text);
  line-height: 1.05;
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.stat-number.euro { font-size: 24px; }
.stat-unit {
  font-size: 0.6em;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: -0.02em;
}

.na-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(109, 101, 93, 0.12);
  color: var(--muted);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

/* --- Variazione (pill) --- */
.stat-change {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  width: fit-content;
  letter-spacing: 0.01em;
}
.stat-change.positive {
  background: rgba(63, 157, 104, 0.15);
  color: #2a6544;
}
.stat-change.negative {
  background: rgba(197, 82, 79, 0.13);
  color: #8a3a3a;
}
.stat-change.neutral {
  background: rgba(109, 101, 93, 0.1);
  color: var(--muted);
}

/* --- Sottotesto --- */
.stat-sub {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  font-weight: 500;
}
.stat-sub strong {
  color: var(--text);
  font-weight: 700;
}
.stat-sub i {
  color: var(--muted);
  margin-right: 2px;
}

/* --- Dettagli (righe mese/anno) --- */
.stat-detail {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px dashed var(--line-soft);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}
.detail-label {
  color: var(--muted);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.detail-label i {
  font-size: 12px;
  color: var(--muted);
}
.detail-value {
  color: var(--text);
  font-weight: 800;
  font-family: "Sora", sans-serif;
  font-size: 13px;
  letter-spacing: -0.02em;
}

/* --- Progress bar (Performance) --- */
.stat-progress {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px dashed var(--line-soft);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.progress-track {
  width: 100%;
  height: 6px;
  background: rgba(109, 101, 93, 0.12);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: currentColor;
  border-radius: 999px;
  transition: width 0.6s ease;
}
.progress-caption {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}

/* ============================================================
   ACCENTI COLORATI (sfondo icon + bordo sinistro + progress)
   ============================================================ */

.stat-card.accent-blue    { border-left-color: #6b8afd; }
.stat-card.accent-blue    .stat-icon { background: linear-gradient(135deg, #6b8afd, #4d6fe0); }
.stat-card.accent-blue    .progress-fill { background: #6b8afd; }

.stat-card.accent-green   { border-left-color: #6fbf8c; }
.stat-card.accent-green   .stat-icon { background: linear-gradient(135deg, #6fbf8c, #4a9d6c); }
.stat-card.accent-green   .progress-fill { background: #6fbf8c; }

.stat-card.accent-purple  { border-left-color: #a78bfa; }
.stat-card.accent-purple  .stat-icon { background: linear-gradient(135deg, #a78bfa, #8a6fe0); }
.stat-card.accent-purple  .progress-fill { background: #a78bfa; }

.stat-card.accent-orange  { border-left-color: #e8a56b; }
.stat-card.accent-orange  .stat-icon { background: linear-gradient(135deg, #e8a56b, #d48845); }
.stat-card.accent-orange  .progress-fill { background: #e8a56b; }

.stat-card.accent-pink    { border-left-color: #e88fa3; }
.stat-card.accent-pink    .stat-icon { background: linear-gradient(135deg, #e88fa3, #d06f85); }
.stat-card.accent-pink    .progress-fill { background: #e88fa3; }

.stat-card.accent-teal    { border-left-color: #6bbfb3; }
.stat-card.accent-teal    .stat-icon { background: linear-gradient(135deg, #6bbfb3, #4a9d8f); }
.stat-card.accent-teal    .progress-fill { background: #6bbfb3; }

/* ============================================================
   INFO BOX — navigazione
   ============================================================ */
.info-box {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-left: 4px solid #6bbfb3;
  box-shadow: var(--shadow-soft);
  margin-bottom: 24px;
}

.info-box-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #6bbfb3, #4a9d8f);
  display: grid;
  place-items: center;
  color: white;
  font-size: 20px;
  flex-shrink: 0;
  box-shadow: 0 6px 14px rgba(74, 157, 143, 0.2);
}

.info-box-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.info-box-content strong {
  font-family: "Sora", sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.info-box-content span {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 992px) {
  .stats-container {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
  }
  .stat-number { font-size: 26px; }
  .stat-number.euro { font-size: 20px; }
}

@media (max-width: 768px) {
  .stats-container { grid-template-columns: repeat(2, 1fr); }
  .stat-card { padding: 16px 18px; }
  .stat-icon { width: 36px; height: 36px; font-size: 16px; border-radius: 10px; }
  .stat-number { font-size: 24px; }
  .stat-number.euro { font-size: 18px; }
  .stat-label { font-size: 10px; }
  .info-box { padding: 14px 18px; }
  .info-box-icon { width: 38px; height: 38px; font-size: 18px; }
}

@media (max-width: 480px) {
  .stats-container { grid-template-columns: 1fr; }
  .stat-number { font-size: 28px; }
  .stat-number.euro { font-size: 22px; }
}

/* ============================================================
   27. DETTAGLIO LISTINO (RDD_DettaglioListino.php)
   ============================================================ */

/* --- Container principale --- */
.container-custom {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 24px 28px;
}

/* --- Head card (titolo pagina) --- */
.head-card {
  background: linear-gradient(180deg, var(--panel-strong), var(--panel));
  padding: 24px 28px;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  margin-bottom: 20px;
}

.head-card h1 {
  font-family: "Sora", sans-serif;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.04em;
  margin: 0;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.head-card h1 i { color: #8b6f4e; }
.head-card h1 small {
  font-size: 0.55em;
  color: var(--muted);
  font-weight: 500;
  font-family: "Manrope", sans-serif;
  letter-spacing: 0;
}

.head-card .meta {
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: center;
}
.head-card .meta i { color: #8b6f4e; }

/* --- Toolbar (riga con bottoni) --- */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

/* --- Bottone "soft" (variante Plasma) --- */
.btn-soft {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  font-family: "Manrope", sans-serif;
  white-space: nowrap;
}
.btn-soft:hover { transform: translateY(-1px); }

.btn-soft-primary {
  background: #1c1b19;
  color: #faf8f4;
  box-shadow: 0 12px 24px rgba(28, 27, 25, 0.18);
}
.btn-soft-primary:hover { background: #2a2825; color: #faf8f4; }

.btn-soft-secondary {
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  border-color: var(--line-soft);
  box-shadow: var(--shadow-soft);
}
.btn-soft-secondary:hover { background: rgba(255, 255, 255, 0.95); color: var(--text); }

.btn-soft-warn {
  background: rgba(212, 148, 66, 0.15);
  color: #8b5a17;
  border-color: rgba(212, 148, 66, 0.28);
}
.btn-soft-warn:hover { background: rgba(212, 148, 66, 0.28); color: #6b4519; }

.btn-soft-danger {
  background: rgba(197, 82, 79, 0.13);
  color: #8a3a3a;
  border-color: rgba(197, 82, 79, 0.25);
}
.btn-soft-danger:hover { background: rgba(197, 82, 79, 0.25); color: #5f2828; }

/* --- Alert --- */
.container-custom .alert {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
}
.container-custom .alert i { font-size: 17px; flex-shrink: 0; }

.container-custom .alert-success {
  background: rgba(63, 157, 104, 0.12);
  color: #2a6544;
  border-color: rgba(63, 157, 104, 0.25);
}
.container-custom .alert-danger {
  background: rgba(197, 82, 79, 0.12);
  color: #8a3a3a;
  border-color: rgba(197, 82, 79, 0.25);
}
.container-custom .alert-info {
  background: rgba(74, 143, 168, 0.12);
  color: #2d5f73;
  border-color: rgba(74, 143, 168, 0.25);
}

/* --- Blocco modello (details/summary) --- */
details.modello-block {
  background: rgba(255, 255, 255, 0.85);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  margin-bottom: 16px;
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}
details.modello-block[open] { box-shadow: var(--shadow); }

details.modello-block > summary {
  padding: 16px 22px;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
  background: rgba(250, 248, 244, 0.6);
  border-bottom: 1px solid transparent;
  transition: background-color 0.2s ease;
}
details.modello-block > summary:hover {
  background: rgba(250, 248, 244, 0.9);
}
details.modello-block[open] > summary {
  border-bottom-color: var(--line-soft);
  background: rgba(250, 248, 244, 0.9);
}
details.modello-block > summary::-webkit-details-marker { display: none; }
details.modello-block > summary .cod {
  font-family: "Sora", sans-serif;
  color: #8b6f4e;
  font-weight: 800;
  letter-spacing: -0.02em;
}
details.modello-block > summary .badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* --- Badge soft --- */
.badge-soft {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(184, 155, 120, 0.15);
  color: #6b5535;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.badge-soft i { font-size: 11px; }
.badge-soft.green {
  background: rgba(63, 157, 104, 0.15);
  color: #2a6544;
}
.badge-soft.amber {
  background: rgba(212, 148, 66, 0.18);
  color: #7a5217;
}

/* --- Body del blocco --- */
.block-body { padding: 20px 22px; }

.section-title {
  font-family: "Sora", sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 14px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title i { color: #8b6f4e; font-size: 14px; }

/* --- Tabella matrice prezzi --- */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--line-soft);
  background: white;
}

table.price-matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: white;
}

.price-matrix thead th {
  background: #1c1b19;
  padding: 12px 14px;
  text-align: center;
  font-weight: 700;
  color: #faf8f4;
  border-bottom: 2px solid #1c1b19;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.price-matrix thead th.cat-mix {
  background: #4a3a1e;
  color: #f5d78e;
}

.price-matrix tbody td {
  padding: 10px 12px;
  text-align: center;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}

.price-matrix tbody tr:last-child td { border-bottom: 0; }

.price-matrix tbody td.version-cell {
  text-align: left;
  background: rgba(250, 248, 244, 0.6);
  font-weight: 700;
  white-space: nowrap;
  color: var(--text);
  font-family: "Sora", sans-serif;
  font-size: 13px;
  letter-spacing: -0.01em;
}
.price-matrix tbody td.version-cell .desc {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  font-family: "Manrope", sans-serif;
  letter-spacing: 0;
  margin-top: 2px;
}

.price-matrix tbody tr:hover td { background: rgba(184, 155, 120, 0.06); }
.price-matrix tbody tr:hover td.version-cell { background: rgba(184, 155, 120, 0.15); }

/* --- Celle prezzo --- */
.price-val {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: #3f9d68;
  font-family: "Sora", sans-serif;
  letter-spacing: -0.02em;
}
.price-val.mix {
  color: #b45309;
  background: rgba(212, 148, 66, 0.15);
  padding: 3px 10px;
  border-radius: 6px;
}
.price-na {
  color: var(--muted);
  font-weight: 500;
}

/* --- Icone azione nella cella --- */
.icon-action {
  opacity: 0.35;
  cursor: pointer;
  color: #8b6f4e;
  font-size: 12px;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.icon-action:hover { transform: scale(1.15); opacity: 1; }
.icon-action.history { color: #4a8fa8; }
td:hover .icon-action { opacity: 0.85; }

/* --- Mix grid --- */
.mix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 10px;
}

.mix-card {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.mix-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
  border-color: #b89b78;
}

.mix-card .mix-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.mix-card .mix-code {
  font-family: "Sora", sans-serif;
  font-weight: 800;
  color: #8b6f4e;
  font-size: 15px;
  letter-spacing: -0.02em;
}
.mix-card .mix-desc {
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
  margin: 4px 0;
}
.mix-card .mix-detail {
  font-size: 12px;
  color: var(--muted);
  margin: 3px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.mix-card .mix-detail i { color: #8b6f4e; font-size: 11px; }
.mix-card .mix-actions {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line-soft);
}

/* --- Badge mix attivo/off --- */
.mix-badge {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(63, 157, 104, 0.18);
  color: #2a6544;
}
.mix-badge.off {
  background: rgba(197, 82, 79, 0.15);
  color: #8a3a3a;
}

/* --- Empty state mini --- */
.empty-mini {
  text-align: center;
  padding: 26px 20px;
  color: var(--muted);
  font-size: 13px;
  background: rgba(250, 248, 244, 0.5);
  border-radius: var(--radius-md);
  border: 1px dashed rgba(184, 155, 120, 0.3);
}
.empty-mini i { color: #c9bba8; }

/* --- Modali --- */
/* ============================================================
   MODALI — override SOLO del contenuto, non del wrapper Bootstrap
   Lasciamo a Bootstrap: .modal, .modal-backdrop, .modal.show (z-index, display, position)
   Personalizziamo solo: .modal-content, .modal-header, .modal-footer, .modal-dialog
   ============================================================ */
/* Stile estetico del contenuto, senza toccare max-width di default */
.modal-dialog {
  margin: 1.75rem auto;
}

/* Applica gli stili "Plasma" al contenuto, NON al wrapper */
.modal-content {
  background: linear-gradient(180deg, var(--panel-strong), var(--panel));
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

/* Variante wide personalizzata (già usata in DettaglioListino) */
.modal-dialog.wide { max-width: 900px; }

.modal-dialog.modal-lg { max-width: 800px; }
.modal-dialog.modal-xl { max-width: 1140px; }
.modal-dialog.modal-dialog-scrollable .modal-content {
  max-height: calc(100vh - 3.5rem);
}

/* Header / Body / Footer */
.modal-header {
  border-bottom: 1px solid var(--line-soft);
  padding: 18px 22px;
}
.modal-footer {
  border-top: 1px solid var(--line-soft);
  padding: 16px 22px;
}
.modal-body {
  padding: 22px;
}

/* Titolo */
.modal-title {
  font-family: "Sora", sans-serif;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: 17px;
}

/* Close button */
.modal .btn-close { opacity: 0.5; }
.modal .btn-close:hover { opacity: 0.9; }


.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}
.modal-head h5 {
  font-family: "Sora", sans-serif;
  font-size: 17px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.modal-head h5 i { color: #8b6f4e; }
.modal-head .close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
  transition: color 0.2s ease, transform 0.2s ease;
}
.modal-head .close:hover { color: var(--text); transform: rotate(90deg); }

/* --- Form nel modal --- */
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: "Manrope", sans-serif;
  background: rgba(255, 255, 255, 0.85);
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  min-height: 42px;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #b89b78;
  box-shadow: 0 0 0 3px rgba(184, 155, 120, 0.15);
  background: white;
}
.form-group input[readonly] {
  background: rgba(250, 248, 244, 0.6);
  color: var(--muted);
  cursor: not-allowed;
}

.form-group small.text-muted {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}

/* --- Checkbox grid --- */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: rgba(250, 248, 244, 0.5);
}
.checkbox-grid label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background-color 0.15s ease;
}
.checkbox-grid label:hover { background: rgba(184, 155, 120, 0.1); }
.checkbox-grid input[type=checkbox] {
  accent-color: #8b6f4e;
  width: 15px;
  height: 15px;
}

/* --- Azioni modal --- */
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  flex-wrap: wrap;
}

/* --- Tabella storico nel modal --- */
.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 4px;
}
.history-table th {
  background: rgba(250, 248, 244, 0.7);
  padding: 10px 12px;
  text-align: left;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.06em;
  border-bottom: 2px solid var(--line-soft);
}
.history-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text);
}
.history-table tr:last-child td { border-bottom: 0; }
.history-table tr:hover td { background: rgba(184, 155, 120, 0.05); }

/* --- Responsive --- */
@media (max-width: 768px) {
  .container-custom { padding: 16px; }
  .head-card { padding: 18px 20px; }
  .head-card h1 { font-size: 20px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .block-body { padding: 16px; }
  .mix-grid { grid-template-columns: 1fr; }
  .modal-dialog { padding: 20px; }
  .modal-dialog.wide { max-width: 100%; }
  .mix-card .mix-actions { flex-wrap: wrap; }
}

@media (max-width: 480px) {
  .btn-soft { padding: 7px 14px; font-size: 12px; }
  .head-card h1 small { font-size: 0.5em; }
}

/* ============================================================
   28. LOGIN (RDD_login.php)
   ============================================================ */

body.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: var(--page-bg);
  overflow-x: hidden;
}

/* --- Container --- */
.login-container {
  width: 100%;
  max-width: 460px;
  position: relative;
  z-index: 1;
}

/* --- Card principale (usa .panel + .login-card) --- */
.login-card {
  border-radius: var(--radius-xl);
  overflow: hidden;
  padding: 0;
  animation: fadeIn 0.5s ease forwards;
}

/* --- Header --- */
.login-header {
  background: linear-gradient(135deg, #1c1b19 0%, #2a2825 100%);
  color: #faf8f4;
  padding: 28px 28px 24px;
  text-align: center;
  border-bottom: 1px solid var(--line-soft);
}

.login-header .logo-container {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

.login-header .login-logo {
  max-width: 180px;
  max-height: 80px;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.login-header .login-logo:hover {
  transform: scale(1.04);
}

/* Logo su sfondo scuro → invertito */
.login-header .login-logo-white {
  filter: brightness(0) invert(1);
}

.login-header h1 {
  font-family: "Sora", sans-serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.04em;
  margin: 0;
  color: #faf8f4;
}

.login-header p {
  margin: 6px 0 0;
  font-size: 13px;
  color: rgba(250, 248, 244, 0.62);
  font-weight: 500;
}

/* --- Body --- */
.login-body {
  padding: 28px 28px 24px;
}

/* --- Alert --- */
.login-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 18px;
  border: 1px solid transparent;
  line-height: 1.45;
}

.login-alert i {
  font-size: 16px;
  flex-shrink: 0;
}

.login-alert.alert-danger {
  background: rgba(197, 82, 79, 0.1);
  border-color: rgba(197, 82, 79, 0.25);
  color: #8a3a3a;
}

.login-alert.alert-success {
  background: rgba(63, 157, 104, 0.12);
  border-color: rgba(63, 157, 104, 0.25);
  color: #2a6544;
}

/* --- Info box variante login --- */
.login-info-box {
  padding: 14px 18px;
  margin-bottom: 22px;
  border-left-color: #6bbfb3;
}

.login-info-box .info-box-content span {
  font-size: 12.5px;
  line-height: 1.5;
}

/* --- Form --- */
.login-form .form-group {
  margin-bottom: 18px;
}

.login-form label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 7px;
}

.login-form label i {
  color: #8b6f4e;
  font-size: 12px;
}

/* Input generico */
.login-form .form-control {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.85);
  color: var(--text);
  font-family: "Manrope", sans-serif;
  font-size: 14px;
  min-height: 48px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.login-form .form-control:focus {
  outline: none;
  border-color: #b89b78;
  box-shadow: 0 0 0 3px rgba(184, 155, 120, 0.15);
  background: #ffffff;
}

.login-form .form-control::placeholder {
  color: rgba(109, 101, 93, 0.55);
  font-weight: 500;
}

/* Token input: monospace + tracking */
.login-form .token-input {
  font-family: 'Courier New', monospace;
  font-size: 15px;
  letter-spacing: 3px;
  text-transform: uppercase;
  padding-right: 52px;
  font-weight: 600;
}

/* Wrapper per toggle */
.token-input-wrap {
  position: relative;
}

.password-toggle-icon {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(184, 155, 120, 0.12);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--muted);
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
  padding: 0;
}

.password-toggle-icon:hover {
  background: rgba(184, 155, 120, 0.22);
  color: #8b6f4e;
  transform: translateY(-50%) scale(1.05);
}

.password-toggle-icon i {
  font-size: 14px;
  pointer-events: none;
}

/* Hint sotto il token */
.token-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.4;
}

.token-hint i {
  color: #d49442;
  font-size: 12px;
  flex-shrink: 0;
}

.token-hint code {
  font-family: 'Courier New', monospace;
  background: rgba(184, 155, 120, 0.12);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  color: #6b5535;
  letter-spacing: 0.5px;
}

/* Preview formattata token */
.token-preview {
  margin-top: 10px;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 4px;
  text-align: center;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(250, 248, 244, 0.7);
  border: 1px dashed rgba(184, 155, 120, 0.35);
  color: var(--muted);
  transition: all 0.25s ease;
}

.token-preview.complete {
  background: rgba(63, 157, 104, 0.1);
  border-color: rgba(63, 157, 104, 0.4);
  border-style: solid;
  color: #2a6544;
  box-shadow: 0 0 0 3px rgba(63, 157, 104, 0.08);
}

/* --- Bottone login (full width) --- */
.login-form .btn-login {
  width: 100%;
  min-height: 52px;
  margin-top: 6px;
  font-size: 14px;
  letter-spacing: 0.01em;
}

.login-form .btn-login .button-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* --- Footer --- */
.login-footer {
  text-align: center;
  padding-top: 20px;
  margin-top: 24px;
  border-top: 1px solid var(--line-soft);
  font-size: 13px;
  color: var(--muted);
}

.login-footer p {
  margin: 0 0 6px;
}

.login-footer a {
  color: #8b6f4e;
  font-weight: 700;
  transition: color 0.2s ease;
}

.login-footer a:hover {
  color: #6b5535;
  text-decoration: underline;
}

.login-copyright {
  font-size: 11px !important;
  color: rgba(109, 101, 93, 0.7) !important;
  letter-spacing: 0.02em;
}

/* --- Responsive --- */
@media (max-width: 520px) {
  body.login-page {
    padding: 12px;
    align-items: flex-start;
  }

  .login-header {
    padding: 22px 20px 18px;
  }

  .login-header .login-logo {
    max-width: 140px;
    max-height: 60px;
  }

  .login-header h1 {
    font-size: 19px;
  }

  .login-body {
    padding: 22px 20px 20px;
  }

  .login-form .form-control {
    min-height: 46px;
    font-size: 14px;
  }

  .login-form .token-input {
    font-size: 14px;
    letter-spacing: 2px;
  }

  .token-preview {
    font-size: 13px;
    letter-spacing: 3px;
  }
}

/* ============================================ */
/* BOTTONI PREZZO CLICCABILI                    */
/* ============================================ */
.price-btn {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-width: 110px;
    padding: 6px 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #0f172a;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
}

.price-btn:hover {
    background: #eff6ff;
    border-color: #2563eb;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
    transform: translateY(-1px);
}

.price-btn:active {
    transform: translateY(0);
}

.price-btn .price-num {
    flex: 1;
    color: #0f172a;
}

.price-btn .price-icons {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.price-btn:hover .price-icons {
    opacity: 1;
}

.price-btn .price-icons i {
    font-size: 12px;
    color: #2563eb;
    cursor: pointer;
    padding: 2px;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.price-btn .price-icons i:hover {
    background: #2563eb;
    color: #fff;
}

/* Bottone vuoto (cella senza prezzo) */
.price-btn-empty {
    justify-content: center;
    background: transparent;
    border: 2px dashed #cbd5e1;
    color: #94a3b8;
    min-width: 60px;
    padding: 4px;
}

.price-btn-empty:hover {
    border-color: #2563eb;
    background: #eff6ff;
    color: #2563eb;
}

.price-btn-empty i {
    font-size: 14px;
}