﻿/* Nosumo v2 — Design System (Glass Morphism) */

/* ════════════════════════════════════════════════════════════ */
/* ROOT VARIABLES */
/* ════════════════════════════════════════════════════════════ */

:root {
  /* Green design system */
  --accent:       #388E3C;
  --accent-dim:   rgba(76, 175, 80, 0.15);
  --accent-glow:  rgba(76, 175, 80, 0.25);
  --green:        #4CAF50;
  --green-dim:    rgba(76, 175, 80, 0.15);
  --orange:       #fb923c;
  --orange-dim:   rgba(251, 146, 60, 0.15);
  --red:          #f87171;

  /* Surface tokens (light) */
  --glass-bg:         #ffffff;
  --glass-bg-hover:   #f0f8f0;
  --glass-border:     #D8EDD8;
  --glass-border-strong: #9AB89A;
  --glass-shadow:     0 2px 12px rgba(26, 46, 26, 0.07);
  --glass-shadow-lg:  0 8px 32px rgba(26, 46, 26, 0.13);

  /* Text */
  --text:   #1A2E1A;
  --text2:  #4A6B4A;
  --text3:  #9AB89A;

  /* Layout */
  --radius:    18px;
  --radius-sm: 11px;

  /* UI Component Variables */
  --ui-surface:       var(--glass-bg);
  --ui-border:        var(--glass-border-strong);
  --ui-text:          var(--text);
  --ui-text2:         var(--text2);
  --ui-hover:         var(--glass-bg-hover);
  --ui-accent:        var(--accent);
  --ui-accent-dim:    var(--accent-dim);
  --ui-selected:      rgba(76, 175, 80, 0.08);
  --ui-radius:        var(--radius);
}

/* body.light kept for legacy but no longer toggled */
body.light {
  --accent:       #388E3C;
  --accent-dim:   rgba(76, 175, 80, 0.15);
  --accent-glow:  rgba(76, 175, 80, 0.25);
  --green:        #4CAF50;
  --green-dim:    rgba(76, 175, 80, 0.15);
  --glass-bg:     #ffffff;
  --glass-bg-hover: #f0f8f0;
  --glass-border: #D8EDD8;
  --glass-border-strong: #9AB89A;
  --text:   #1A2E1A;
  --text2:  #4A6B4A;
  --text3:  #9AB89A;
  --ui-surface:       var(--glass-bg);
  --ui-border:        var(--glass-border-strong);
  --ui-text:          var(--text);
  --ui-text2:         var(--text2);
  --ui-hover:         var(--glass-bg-hover);
  --ui-accent:        var(--accent);
  --ui-accent-dim:    var(--accent-dim);
  --ui-selected:      rgba(76, 175, 80, 0.08);
}

/* ════════════════════════════════════════════════════════════ */
/* GLOBAL */
/* ════════════════════════════════════════════════════════════ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  font-family: 'DM Sans', sans-serif;
  background: #F4FAF4;
  color: var(--text);
  overflow: hidden;
}

body.light {
  background: #F4FAF4;
}

/* ════════════════════════════════════════════════════════════ */
/* BG SCENE */
/* ════════════════════════════════════════════════════════════ */

.bg-scene {
  display: none; /* Non necessario con il design system chiaro */
}

.bg-orb { display: none; }

@keyframes orbFloat {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(30px, 30px) scale(1.05); }
}

/* ════════════════════════════════════════════════════════════ */
/* LAYOUT MAIN */
/* ════════════════════════════════════════════════════════════ */

.app-shell {
  display: flex;
  height: 100vh;
  position: relative;
  z-index: 1;
}

/* ════════════════════════════════════════════════════════════ */
/* SIDEBAR */
/* ════════════════════════════════════════════════════════════ */

.sidebar {
  width: 228px;
  background: linear-gradient(180deg, #1A2E1A 0%, #2D5A2D 100%);
  border-right: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 2px 0 20px rgba(26,46,26,0.15);
  /* Garantisce che la sidebar sia sempre sopra le views e clickabile */
  position: relative;
  z-index: 200;
  pointer-events: auto;
  /* Override all text/border tokens inside sidebar */
  --text:               rgba(255,255,255,0.95);
  --text2:              rgba(255,255,255,0.65);
  --text3:              rgba(255,255,255,0.40);
  --accent:             #A5D6A7;
  --accent-dim:         rgba(165,214,167,0.18);
  --glass-bg:           rgba(255,255,255,0.06);
  --glass-bg-hover:     rgba(255,255,255,0.10);
  --glass-border:       rgba(255,255,255,0.10);
  --glass-border-strong: rgba(255,255,255,0.18);
  transition: width .22s ease, padding .22s ease;
}

.sidebar-logo-tagline {
  display: block;
}

body.sidebar-collapsed .sidebar {
  width: 0;
  min-width: 0;
  max-width: 0;
  padding: 0;
  border-right: 0;
  box-shadow: none;
  overflow-x: hidden;
}

body.sidebar-collapsed .sidebar .sidebar-logo {
  visibility: hidden;
}

body.sidebar-collapsed .sidebar .sidebar-logo-tagline,
body.sidebar-collapsed .sidebar .sidebar-user-card,
body.sidebar-collapsed .sidebar .nav-label,
body.sidebar-collapsed .sidebar .nav-item span:not(.nav-item-icon),
body.sidebar-collapsed .sidebar .nav-item-admin span:not(.nav-item-icon),
body.sidebar-collapsed .sidebar a[href="/logout.php"] span:last-child {
  display: none !important;
}

body.sidebar-collapsed .sidebar .nav-item {
  visibility: hidden;
}

body.sidebar-collapsed .sidebar .nav-item::before {
  display: none;
}

body.sidebar-collapsed .sidebar a[href="/logout.php"] {
  visibility: hidden;
}

.sidebar-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(26,46,26,0.12);
  background: #ffffff;
  color: #1A2E1A;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transition: background .15s, border-color .15s, color .15s;
}

.sidebar-toggle-btn:hover {
  background: #F2FAF2;
  border-color: rgba(56,142,60,0.35);
  color: #2E7D32;
}

.sidebar-logo {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 2px;
  text-align: center;
}

.sidebar-tagline {
  font-size: 9px;
  color: var(--text3);
  text-align: center;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

/* Plan Badge */
.plan-badge {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
  margin-bottom: 12px;
}

.plan-badge-label {
  font-size: 9px;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 2px;
}

.plan-badge-value {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #A5D6A7;
  margin-bottom: 6px;
}

.plan-badge-cta {
  width: 100%;
  padding: 7px 12px;
  background: #388E3C;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.plan-badge-cta:hover {
  background: #4CAF50;
}

/* Nav Section */
.nav-section {
  margin-bottom: 0;
  padding: 0;
}

.nav-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.40);
  margin: 4px 0 0;
  padding: 8px 20px 6px;
  border-bottom: none;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  margin-bottom: 0;
  border-radius: 0;
  cursor: pointer;
  transition: color .15s, background .15s;
  color: rgba(255,255,255,0.65);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  border: none;
  position: relative;
}

.nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.95);
}

.nav-item.active {
  background: rgba(165,214,167,0.12);
  color: #A5D6A7;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  background: #A5D6A7;
  border-radius: 0 3px 3px 0;
}

.nav-item.locked {
  opacity: 0.4;
  cursor: not-allowed;
}

.nav-item-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-item-icon svg {
  width: 18px;
  height: 18px;
  opacity: .85;
}

.nav-item.active .nav-item-icon svg {
  opacity: 1;
}

/* Sidebar Bottom */
.sidebar-bottom {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
}

.plan-badge .theme-toggle {
  padding: 8px 0;
}

.toggle-switch {
  width: 44px;
  height: 24px;
  background: var(--glass-border);
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
}

.toggle-switch.active {
  background: var(--accent);
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: var(--text);
  border-radius: 10px;
  transition: left 0.2s;
}

.toggle-switch.active::after {
  left: 22px;
}

.user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.user-row:hover {
  background: rgba(76,175,80,0.04);
}

.plan-badge .user-row {
  padding: 8px 0;
  cursor: default;
}

.plan-badge .user-row:hover {
  background: none;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--green));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #000;
  flex-shrink: 0;
}

.user-info {
  flex: 1;
  text-align: left;
}

.user-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.user-email {
  font-size: 11px;
  color: var(--text3);
}

/* ════════════════════════════════════════════════════════════ */
/* MAIN AREA */
/* ════════════════════════════════════════════════════════════ */

.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ════════════════════════════════════════════════════════════ */
/* TOPBAR */
/* ════════════════════════════════════════════════════════════ */

.topbar {
  height: 58px;
  background: #ffffff;
  border-bottom: 1.5px solid #D8EDD8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 26px;
  flex-shrink: 0;
  box-shadow: 0 1px 6px rgba(26,46,26,0.06);
  position: relative;
  z-index: 50;
}

.topbar-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

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

.btn-ghost {
  padding: 10px 18px;
  background: transparent;
  border: 1.5px solid #D8EDD8;
  border-radius: var(--radius-sm);
  color: #4A6B4A;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-ghost:hover {
  border-color: #388E3C;
  color: #388E3C;
  background: rgba(76,175,80,0.07);
}

.btn-primary {
  padding: 10px 18px;
  background: #388E3C;
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  font-family: 'Plus Jakarta Sans', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-primary:hover {
  background: #2D7A2D;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(56, 142, 60, 0.30);
}

body.light .btn-primary {
  background: #388E3C;
  color: #fff;
}

body.light .btn-primary:hover {
  background: #2D7A2D;
  box-shadow: 0 8px 20px rgba(56, 142, 60, 0.30);
}

/* ════════════════════════════════════════════════════════════ */
/* VIEW PANELS */
/* ════════════════════════════════════════════════════════════ */

.views-container {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.view {
  position: absolute;
  inset: 0;
  display: none;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 26px;
  animation: fadeIn 0.15s ease-out;
}

.view.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ════════════════════════════════════════════════════════════ */
/* DESK WELCOME HEADER (Desktop only)                          */
/* ════════════════════════════════════════════════════════════ */

.desk-home {
  display: block; /* shown on desktop */
}

.desk-welcome {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.desk-welcome-greeting {
  font-size: 13px;
  color: #9AB89A;
  font-weight: 500;
  letter-spacing: 0.3px;
  margin-bottom: 2px;
}

.desk-welcome-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 26px;
  font-weight: 800;
  color: #1A2E1A;
  line-height: 1.2;
  margin-bottom: 6px;
}

.desk-welcome-sub {
  font-size: 13px;
  color: #4A6B4A;
  font-weight: 500;
}

.desk-welcome-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.desk-qa {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  white-space: nowrap;
  border: none;
  font-family: 'DM Sans', sans-serif;
}

.desk-qa-primary {
  background: #388E3C;
  color: #ffffff;
}
.desk-qa-primary:hover {
  background: #2D7A2D;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(56,142,60,0.25);
}

.desk-qa-secondary {
  background: #E8F5E9;
  color: #1A2E1A;
  border: 1.5px solid #D8EDD8;
}
.desk-qa-secondary:hover {
  background: #D8EDD8;
  border-color: #9AB89A;
}

.desk-qa-ghost {
  background: transparent;
  color: #4A6B4A;
  border: 1.5px solid #D8EDD8;
}
.desk-qa-ghost:hover {
  border-color: #9AB89A;
  color: #1A2E1A;
}

/* ════════════════════════════════════════════════════════════ */
/* KPI CARD (Dashboard) */
/* ════════════════════════════════════════════════════════════ */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 32px;
}

.kpi-card {
  background: #ffffff;
  border: 1.5px solid #D8EDD8;
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: all 0.25s;
  box-shadow: 0 2px 8px rgba(26,46,26,0.05);
}

.kpi-card::after {
  content: '';
  position: absolute;
  top: -40%;
  right: -40%;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(76,175,80,0.07), transparent 70%);
  pointer-events: none;
}

.kpi-card:hover {
  border-color: #4CAF50;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(76,175,80,0.12);
}

.kpi-label {
  font-size: 12px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.kpi-value {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}

.kpi-delta {
  font-size: 12px;
  color: var(--green);
  font-weight: 600;
}

.kpi-delta.negative {
  color: var(--red);
}

/* ════════════════════════════════════════════════════════════ */
/* QR BANNER */
/* ════════════════════════════════════════════════════════════ */

.qr-banner {
  background: rgba(76,175,80,0.07);
  border: 1.5px solid #D8EDD8;
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 32px;
  cursor: pointer;
  transition: all 0.2s;
}

.qr-banner:hover {
  border-color: #4CAF50;
  background: rgba(76,175,80,0.12);
  box-shadow: 0 6px 20px rgba(76,175,80,0.12);
}

.qr-banner-text {
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 4px;
}

.qr-banner-url {
  font-size: 12px;
  color: var(--text2);
}

/* ════════════════════════════════════════════════════════════ */
/* PAGE CARDS */
/* ════════════════════════════════════════════════════════════ */

.pages-section {
  margin-bottom: 32px;
}

.section-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.pages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.page-card {
  background: #ffffff;
  border: 1.5px solid #D8EDD8;
  border-radius: var(--radius);
  padding: 16px;
  transition: all 0.2s;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(26,46,26,0.04);
}

.page-card:hover {
  border-color: #4CAF50;
  box-shadow: 0 4px 16px rgba(76,175,80,0.10);
}

.page-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.page-card-emoji {
  font-size: 32px;
}

.page-card-info {
  flex: 1;
  min-width: 0;
}

.page-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.page-card-url {
  font-size: 11px;
  color: var(--text3);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-card-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s infinite;
}

.page-card-status.draft {
  background: var(--text3);
  animation: none;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.page-card-views {
  font-size: 12px;
  color: var(--text2);
  padding-top: 12px;
  border-top: 1px solid var(--glass-border);
}

/* ════════════════════════════════════════════════════════════ */
/* TABLE (CRM) */
/* ════════════════════════════════════════════════════════════ */

.crm-progress {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 24px;
}

.progress-text {
  font-size: 12px;
  color: var(--text2);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--glass-border);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--orange));
  transition: width 0.3s;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--glass-bg);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--glass-border);
}

.table thead {
  background: var(--glass-bg-hover);
  border-bottom: 1px solid var(--glass-border);
}

.table th {
  padding: 12px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text3);
}

.table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--glass-border);
  font-size: 13px;
  color: var(--text2);
}

.table tr:hover {
  background: rgba(76,175,80,0.05);
}

.table tr:last-child td {
  border-bottom: none;
}

.contact-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--green));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #000;
  flex-shrink: 0;
}

.tag {
  display: inline-block;
  padding: 4px 10px;
  background: var(--accent-dim);
  border-radius: 12px;
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
}

/* ════════════════════════════════════════════════════════════ */
/* CHART BAR */
/* ════════════════════════════════════════════════════════════ */

.chart-container {
  background: #ffffff;
  border: 1.5px solid #D8EDD8;
  border-radius: var(--radius);
  padding: 20px 16px;
  box-shadow: 0 2px 8px rgba(26,46,26,0.05);
}

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

.chart-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.chart-action {
  font-size: 12px;
  color: var(--text3);
  cursor: pointer;
}

.chart-bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  gap: 8px;
  height: 120px;
}

.chart-bar {
  flex: 1;
  background: linear-gradient(180deg, #4CAF50, #A5D6A7);
  border-radius: 4px;
  min-height: 8px;
  position: relative;
  transition: all 0.2s;
}

.chart-bar:hover {
  background: linear-gradient(180deg, #388E3C, #4CAF50);
}

.chart-bar-label {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--text3);
  white-space: nowrap;
}

/* ════════════════════════════════════════════════════════════ */
/* EDITOR SHELL */
/* ════════════════════════════════════════════════════════════ */

.editor-shell {
  display: grid;
  grid-template-columns: 255px 1fr 272px;
  height: calc(100vh - 58px);
  gap: 0;
}

.editor-panel {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.editor-panel-header {
  padding: 16px;
  border-bottom: 1px solid var(--glass-border);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ════════════════════════════════════════════════════════════ */
/* WIDGET PANEL */
/* ════════════════════════════════════════════════════════════ */

.widget-grid {
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.w-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 8px;
  background: var(--glass-bg-hover);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  cursor: grab;
  transition: all 0.2s;
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
}

.w-chip:hover:not(.locked) {
  border-color: var(--accent);
  background: rgba(76,175,80,0.08);
  color: var(--accent);
}

.w-chip.locked {
  opacity: 0.35;
  cursor: not-allowed;
}

.w-chip-icon {
  font-size: 18px;
}

/* ════════════════════════════════════════════════════════════ */
/* EDITOR CANVAS */
/* ════════════════════════════════════════════════════════════ */

.editor-canvas {
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--glass-border);
  border-right: 1px solid var(--glass-border);
}

.canvas-toolbar {
  padding: 12px 16px;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.canvas-url-input {
  flex: 1;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  color: var(--text);
  font-size: 12px;
  font-family: monospace;
}

.canvas-url-input::placeholder {
  color: var(--text3);
}

.canvas-url-input:focus {
  outline: none;
  border-color: var(--accent);
}

.device-toggle {
  display: flex;
  gap: 6px;
  background: var(--glass-border);
  border-radius: 6px;
  padding: 2px;
}

.device-btn {
  padding: 4px 8px;
  background: transparent;
  border: none;
  color: var(--text3);
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
  border-radius: 4px;
}

.device-btn.active {
  background: var(--accent);
  color: #000;
}

.canvas-inner {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

/* Phone Mockup */
.phone-mockup {
  width: 375px;
  height: 812px;
  border: 8px solid rgba(76,175,80,0.06);
  border-radius: 44px;
  overflow: hidden;
  position: relative;
  background: #F4FAF4;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

.phone-notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 180px;
  height: 28px;
  background: #F4FAF4;
  border-radius: 0 0 20px 20px;
  z-index: 10;
}

.phone-content {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  background: var(--glass-bg);
  padding-top: 8px;
}

.prev-widget {
  min-height: 60px;
  padding: 12px;
  margin: 8px;
  background: rgba(76,175,80,0.06);
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: move;
  transition: all 0.2s;
  position: relative;
}

.prev-widget:hover {
  border-color: var(--accent);
  background: rgba(76,175,80,0.08);
}

.prev-widget.selected {
  border-color: var(--accent);
  background: rgba(76,175,80,0.15);
  box-shadow: 0 0 0 2px rgba(76,175,80,0.25);
}

.prev-widget-label {
  font-size: 11px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.prev-widget-content {
  font-size: 13px;
  color: var(--text);
  word-break: break-word;
}

/* ════════════════════════════════════════════════════════════ */
/* PROPERTIES PANEL */
/* ════════════════════════════════════════════════════════════ */

.props-panel {
  padding: 16px;
}

.props-empty {
  color: var(--text3);
  font-size: 12px;
  text-align: center;
  padding: 40px 16px;
}

.prop-group {
  margin-bottom: 18px;
}

.prop-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text3);
  margin-bottom: 6px;
  display: block;
}

.prop-input {
  width: 100%;
  padding: 8px 10px;
  background: var(--glass-bg-hover);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  color: var(--text);
  font-size: 12px;
  font-family: 'DM Sans', sans-serif;
  transition: border-color 0.2s;
}

.prop-input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(76,175,80,0.08);
}

.prop-input::placeholder {
  color: var(--text3);
}

.color-swatch {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.swatch {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}

.swatch:hover {
  transform: scale(1.1);
}

.swatch.active {
  border-color: var(--text);
  box-shadow: 0 0 0 1px var(--accent);
}

.accent-colors {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.accent-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}

.accent-dot:hover {
  transform: scale(1.15);
}

.accent-dot.active {
  border-color: var(--text);
  box-shadow: 0 0 0 2px var(--text);
}

.prop-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.toggle {
  width: 40px;
  height: 22px;
  background: var(--glass-border);
  border-radius: 11px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
  border: none;
}

.toggle.active {
  background: var(--accent);
}

.toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: var(--text);
  border-radius: 9px;
  transition: left 0.2s;
}

.toggle.active::after {
  left: 20px;
}

.pub-buttons {
  display: flex;
  gap: 10px;
  padding-top: 18px;
  margin-top: 18px;
  border-top: 1px solid var(--glass-border);
}

.pub-buttons button {
  flex: 1;
  padding: 10px 12px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s;
}

.pub-buttons .btn-draft {
  background: var(--glass-bg-hover);
  border: 1px solid var(--glass-border);
  color: var(--text2);
}

.pub-buttons .btn-draft:hover {
  border-color: var(--accent);
}

.pub-buttons .btn-publish {
  background: #388E3C;
  color: #fff;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.pub-buttons .btn-publish:hover {
  background: #2D7A2D;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(109, 40, 217, 0.35);
}

body.light .pub-buttons .btn-publish {
  background: #4335c4;
  color: #fff;
}

body.light .pub-buttons .btn-publish:hover {
  background: #3730a3;
}

/* ════════════════════════════════════════════════════════════ */
/* RESPONSIVE */
/* ════════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .editor-shell {
    grid-template-columns: 1fr;
  }

  .editor-panel, .phone-mockup {
    display: none;
  }

  /* Sidebar compatta su tablet (769-1024px) */
  .sidebar {
    width: 72px;
    overflow: hidden;
  }
  .sidebar .plan-badge,
  .sidebar .nav-label,
  .sidebar .nav-item-icon + *,
  .sidebar .user-name,
  .sidebar .user-email,
  .sidebar .plan-badge-label,
  .sidebar .plan-badge-value,
  .sidebar .plan-badge-cta,
  .sidebar a[href="/logout.php"] {
    display: none;
  }
  .sidebar .nav-item {
    justify-content: center;
    padding: 12px 0;
  }
  .sidebar .nav-item-icon {
    font-size: 20px;
    margin: 0;
  }
  .sidebar .user-avatar {
    width: 36px !important;
    height: 36px !important;
    margin: 12px auto !important;
  }
  .sidebar .nav-section {
    padding: 0;
  }

  /* Dashboard content grid: comprimi sidebar destra */
  .dashboard-content-grid {
    grid-template-columns: 1fr 280px !important;
  }
}

@media (max-width: 900px) {
  .sidebar {
    display: none;
  }
  .app-shell {
    flex-direction: column;
  }
  .main-area {
    width: 100%;
  }
  .topbar {
    padding: 0 16px;
  }
  .topbar-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
  }
  .topbar-mobile-logo,
  .hamburger-btn {
    display: flex;
  }
  .mob-page-tabs {
    display: flex;
  }
  .dashboard-content-grid,
  .pages-cards-grid,
  .kpi-grid,
  .crm-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  .view {
    position: relative;
    inset: auto;
    padding: 20px 16px 24px;
  }
}

/* ════════════════════════════════════════════════════════════ */
/* MOBILE BOTTOM NAV (hidden on desktop)                       */
/* ════════════════════════════════════════════════════════════ */

.mobile-nav {
  display: none;
}

.mobile-topbar-logo {
  display: none;
}

.mobile-menu-btn {
  display: none;
}

.mobile-user-drawer {
  display: none;
}

.mobile-drawer-overlay {
  display: none;
}

.hamburger-btn {
  display: none;
}

.mobile-extra-drawer {
  display: none;
}

.mobile-extra-overlay {
  display: none;
}

/* Force-hide mobile elements on desktop regardless of zoom/DPR */
@media (min-width: 901px) {
  .mobile-nav,
  .mobile-menu-btn,
  .topbar-mobile-logo,
  .mobile-user-drawer,
  .mobile-drawer-overlay,
  .hamburger-btn,
  .mobile-extra-drawer,
  .mobile-extra-overlay {
    display: none !important;
  }
}

/* ── Pages hero card (verde su desktop e mobile) ── */
.pages-hero-card {
  background: linear-gradient(135deg, #1A2E1A 0%, #2E5430 60%, #3D7040 100%);
  border: none;
  border-radius: 20px;
  padding: 22px 28px;
  margin-bottom: 24px;
  box-shadow: 0 4px 24px rgba(26,46,26,0.25);
  position: relative;
  overflow: hidden;
}
.pages-hero-card::before {
  content: '';
  position: absolute;
  width: 220px; height: 220px;
  border-radius: 50%;
  background: rgba(76,175,80,0.12);
  top: -80px; right: -60px;
  pointer-events: none;
}
.pages-hero-label { font-size: 11px; color: rgba(255,255,255,.55); font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; margin-bottom: 4px; }
.pages-hero-count { color: #fff; }
.pages-hero-pub   { color: rgba(255,255,255,.55); }
.pages-hero-plan  { color: rgba(255,255,255,.6); }

/* ════════════════════════════════════════════════════════════ */
/* MOBILE — ≤900px                                             */
/* ════════════════════════════════════════════════════════════ */

@media (max-width: 900px) {
  /* Sidebar → hidden, replaced by bottom nav */
  .sidebar {
    display: none;
  }

  /* Layout */
  .app-shell {
    flex-direction: column;
  }

  .main-area {
    flex-direction: column;
    overflow: hidden;
  }

  /* Topbar */
  .topbar {
    padding: 0 16px;
    z-index: 200;
    flex-shrink: 0;
  }

  .topbar-title {
    display: none;
  }

  .sidebar-toggle-btn {
    display: none !important;
  }

  .topbar-mobile-logo {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 18px;
    font-weight: 800;
    color: var(--accent);
  }

  .topbar-actions .btn-primary {
    padding: 8px 14px;
    font-size: 13px;
    white-space: nowrap;
  }

  /* Mobile menu avatar button */
  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent);
    color: #000;
    font-weight: 700;
    font-size: 14px;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    margin-left: 8px;
  }

  /* Hamburger button — extra menu left of logo */
  .hamburger-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text2);
    font-size: 18px;
    cursor: pointer;
    flex-shrink: 0;
    margin-right: 8px;
    transition: background 0.2s, color 0.2s;
  }

  .hamburger-btn:active {
    background: rgba(76,175,80,0.12);
    color: var(--accent);
  }

  /* Extra menu drawer — slides from left */
  .mobile-extra-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 997;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  .mobile-extra-overlay.open {
    opacity: 1;
    pointer-events: all;
  }

  .mobile-extra-drawer {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 300px;
    background: var(--glass-bg);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-right: 1px solid var(--glass-border);
    z-index: 998;
    padding: 0;
    transform: translateX(-110%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 8px 0 40px rgba(0,0,0,0.4);
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
  }

  .mobile-extra-drawer.open {
    transform: translateX(0);
  }

  /* Brand header */
  .mob-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
  }
  .mob-drawer-brand {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 22px;
    font-weight: 800;
    color: #4CAF50;
    letter-spacing: -0.5px;
  }
  .mob-drawer-close {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--glass-border);
    border: none;
    color: var(--text2);
    font-size: 14px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
  }

  /* User card */
  .mob-drawer-user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px 12px;
  }
  .mob-drawer-avatar {
    width: 48px; height: 48px;
    border-radius: 50%;
    background: #4CAF50;
    color: #fff;
    font-weight: 800;
    font-size: 20px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
    overflow: hidden;
  }
  .mob-drawer-user-name  { font-size: 14px; font-weight: 700; color: var(--text); line-height: 1.2; }
  .mob-drawer-user-email { font-size: 11px; color: var(--text3); margin: 2px 0 6px; word-break: break-all; }
  .mob-drawer-plan-badge {
    display: inline-block;
    font-size: 10px; font-weight: 800;
    padding: 2px 10px;
    border-radius: 20px;
    background: rgba(76,175,80,.15);
    border: 1px solid rgba(76,175,80,.3);
    color: #388E3C;
    letter-spacing: .04em;
    text-transform: uppercase;
  }
  .mob-drawer-upgrade-btn {
    margin: 0 20px 8px;
    padding: 11px;
    background: linear-gradient(135deg, #4CAF50, #388E3C);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    width: calc(100% - 40px);
    text-align: center;
    box-shadow: 0 4px 12px rgba(76,175,80,.3);
  }
  .mob-drawer-profile-link {
    display: block;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #4CAF50;
    text-decoration: none;
    padding: 4px 20px 14px;
    border-bottom: 1px solid var(--glass-border);
  }

  /* Section label */
  .mob-drawer-section-lbl {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text3);
    padding: 14px 20px 6px;
  }

  /* Items */
  .mob-drawer-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 20px;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s;
    border-radius: 0;
  }
  .mob-drawer-item:active { background: rgba(76,175,80,.08); }
  .mob-drawer-item.active {
    background: rgba(76,175,80,.12);
  }
  .mob-drawer-item.active .mob-drawer-item-title {
    color: #2E7D32;
    font-weight: 800;
  }
  .mob-drawer-item.active .mob-drawer-item-sub {
    color: #4CAF50;
  }
  .mob-drawer-item.active .mob-drawer-arrow {
    color: #2E7D32;
  }
  .mob-drawer-item.active .mob-drawer-icon {
    box-shadow: inset 0 0 0 1px rgba(76,175,80,.28);
  }
  .mob-drawer-item-soon   { cursor: default; }
  .mob-drawer-icon {
    width: 40px; height: 40px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
  }
  .mob-drawer-icon svg {
    width: 19px;
    height: 19px;
    color: #2E7D32;
  }
  .mob-drawer-item-text   { flex: 1; min-width: 0; }
  .mob-drawer-item-title  { font-size: 14px; font-weight: 700; color: var(--text); line-height: 1.2; }
  .mob-drawer-item-sub    { font-size: 11px; color: var(--text3); margin-top: 1px; line-height: 1.3; }
  .mob-drawer-arrow       { font-size: 20px; color: var(--text3); font-weight: 300; flex-shrink: 0; }
  .mob-drawer-soon-badge  {
    font-size: 10px; font-weight: 700;
    padding: 3px 8px;
    border-radius: 8px;
    background: rgba(76,175,80,.12);
    color: #388E3C;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .mob-drawer-logout-wrap { margin-top: auto; border-top: 1px solid var(--glass-border); padding-top: 4px; }
  .mob-drawer-item-logout { }

  /* Legacy — kept for any remaining refs */
  .extra-drawer-section-label { display: none; }
  .extra-drawer-item { display: none; }
  .extra-drawer-item-icon { display: none; }

  /* Views */
  .views-container {
    flex: 1;
    overflow: hidden;
    position: relative;
  }

  .view {
    padding: 16px;
    padding-bottom: 160px; /* space above bottom nav */
  }

  /* KPI grid */
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .kpi-card {
    padding: 14px;
  }

  .kpi-value {
    font-size: 26px;
  }

  /* Chart */
  .chart-bars {
    height: 80px;
  }

  /* Dashboard content grid → 1 colonna su mobile */
  .dashboard-content-grid {
    grid-template-columns: 1fr !important;
  }

  /* Pages */
  .pages-grid {
    grid-template-columns: 1fr;
  }

  /* Dashboard content grid */
  .dashboard-content-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  /* CRM 3-column → stacked */
  .crm-grid {
    grid-template-columns: 1fr !important;
    height: auto !important;
    gap: 16px !important;
  }

  /* Delete buttons: always visible on touch */
  .delete-page-btn {
    opacity: 1 !important;
  }

  /* Give room so the button doesn't overlap page title */
  .page-card-header {
    padding-right: 80px;
  }

  /* QR banner */
  .qr-banner {
    padding: 12px 16px;
    text-align: center;
    margin-bottom: 16px;
  }

  /* Bottom navigation */
  .mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid var(--glass-border);
    z-index: 1000;
    align-items: stretch;
  }

  .mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    text-decoration: none;
    color: var(--text3);
    cursor: pointer;
    transition: color 0.2s;
    padding: 6px 4px;
    background: none;
    border: none;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-nav-item.active {
    color: var(--accent);
  }

  .mobile-nav-icon {
    font-size: 20px;
    line-height: 1.2;
  }

  .mobile-nav-label {
    font-size: 10px;
    font-weight: 500;
  }

  /* Mobile user drawer */
  .mobile-user-drawer {
    display: block;
    position: fixed;
    bottom: 64px;
    left: 0;
    right: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-top: 1px solid var(--glass-border);
    border-radius: 20px 20px 0 0;
    z-index: 998;
    padding: 20px 20px 24px;
    transform: translateY(110%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 -8px 40px rgba(0,0,0,0.4);
  }

  .mobile-user-drawer.open {
    transform: translateY(0);
  }

  /* Legacy drawer dismesso: nascosto su mobile */
  .mobile-user-drawer,
  .mobile-user-drawer.open {
    display: none !important;
    transform: translateY(110%) !important;
    pointer-events: none !important;
  }

  .mobile-drawer-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 997;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  .mobile-drawer-overlay.open {
    opacity: 1;
    pointer-events: all;
  }

  .mobile-drawer-overlay,
  .mobile-drawer-overlay.open {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }
}

/* Light mode mobile adjustments */
body.light .mobile-nav {
  background: rgba(255,255,255,0.9);
}

body.light .mobile-user-drawer {
  background: rgba(255,255,255,0.95);
}

.extra-drawer-profile-btn {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 10px 0;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  border-radius: 10px;
  background: rgba(76,175,80,0.12);
  border: 1px solid rgba(76,175,80,0.30);
  box-shadow: inset 0 1px 0 rgba(76,175,80,0.2);
  transition: background 0.2s, border-color 0.2s;
  cursor: pointer;
  box-sizing: border-box;
}

.extra-drawer-profile-btn:hover,
.extra-drawer-profile-btn:active {
  background: rgba(76,175,80,0.20);
  border-color: rgba(76,175,80,0.45);
}

body.light .extra-drawer-profile-btn {
  background: rgba(76,175,80,0.08);
  border-color: rgba(76,175,80,0.25);
  color: #5b21b6;
}

body.light .extra-drawer-profile-btn:hover {
  background: rgba(76,175,80,0.14);
}

body.light .mobile-extra-drawer {
  background: rgba(255,255,255,0.95);
}

/* Analytics page selector — contrasto garantito in dark e light */
.analytics-page-select {
  background: #1e1e2e;
  color: #ffffff;
  border: 1px solid rgba(255,255,255,0.2);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  max-width: 300px;
  color-scheme: dark;
}

body.light .analytics-page-select {
  background: #ffffff;
  color: #0a0a14;
  border: 1px solid rgba(0,0,0,0.2);
  color-scheme: light;
}

/* ════════════════════════════════════════════════════════════ */
/* PAGE PREVIEW CARD                                            */
/* ════════════════════════════════════════════════════════════ */

.page-preview-card {
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.page-preview-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 36px rgba(0,0,0,0.25);
}

body.light .page-preview-card:hover {
  box-shadow: 0 12px 36px rgba(0,0,0,0.12);
}

/* ════════════════════════════════════════════════════════════ */
/* LIGHT THEME — COMPREHENSIVE OVERRIDES                        */
/* ════════════════════════════════════════════════════════════ */

/* Glass tokens ridefiniti per light */
body.light {
  --glass-bg:             rgba(255,255,255,0.72);
  --glass-bg-hover:       rgba(255,255,255,0.88);
  --glass-border:         rgba(0,0,0,0.10);
  --glass-border-strong:  rgba(0,0,0,0.18);
  --glass-shadow:         0 4px 24px rgba(0,0,0,0.10), inset 0 1px 0 rgba(255,255,255,0.9);
}

body.light html,
body.light body {
  background: #f0f2f7;
}

/* body.light overrides (not used actively but kept for consistency) */
body.light .bg-scene { display: none; }
body.light .bg-orb    { display: none; }
body.light .view { background: transparent; }
body.light .table tr:hover { background: rgba(76,175,80,0.04); }
body.light .mobile-nav {
  background: rgba(255,255,255,0.92);
  border-top-color: #D8EDD8;
}

/* Editor canvas light */
body.light .editor-canvas { background: #e8eaf0; }

/* ════════════════════════════════════════════════════════════ */
/* LIGHT THEME — FORM FIELDS (Liquid Glass Effect)             */
/* ════════════════════════════════════════════════════════════ */

body.light input[type="text"],
body.light input[type="email"],
body.light input[type="password"],
body.light input[type="tel"],
body.light input[type="url"],
body.light input[type="number"],
body.light input[type="search"],
body.light select,
body.light textarea {
  background: #f9fafb !important;
  border: 1px solid rgba(0,0,0,0.15) !important;
  color: #111827 !important;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
}
body.light input:focus,
body.light select:focus,
body.light textarea:focus {
  background: rgba(255,255,255,0.9);
  border-color: var(--accent);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.04), 0 0 0 3px rgba(80,64,216,0.12);
  outline: none;
}
body.light input::placeholder,
body.light textarea::placeholder {
  color: rgba(10,10,20,0.38);
}
body.light select option {
  background: #ffffff;
  color: #0a0a14;
}

/* Hard-coded rgba(255,255,255,0.05) cells → light override */
body.light [style*="rgba(255, 255, 255, 0.05)"],
body.light [style*="rgba(255,255,255,0.05)"] {
  background: rgba(0,0,0,0.04) !important;
}
body.light [style*="rgba(255, 255, 255, 0.03)"],
body.light [style*="rgba(255,255,255,0.03)"] {
  background: rgba(0,0,0,0.025) !important;
}

/* ════════════════════════════════════════════════════════════ */
/* SOCIAL ICON BADGES (Explore)                                 */
/* ════════════════════════════════════════════════════════════ */

.pc-social-icon { color: inherit; }
.pc-social-instagram { background: linear-gradient(135deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888) !important; }
.pc-social-facebook  { background: #1877F2 !important; }
.pc-social-tiktok    { background: #010101 !important; }
.pc-social-linkedin  { background: #0A66C2 !important; }
.pc-social-youtube   { background: #FF0000 !important; }
.pc-social-instagram svg,
.pc-social-facebook svg,
.pc-social-tiktok svg,
.pc-social-linkedin svg,
.pc-social-youtube svg { color: #fff; }

/* ════════════════════════════════════════════════════════════
   MOBILE GREEN REDESIGN v2 — ≤900px
   Applica il tema verde chiaro del nuovo design system MyTap
   ════════════════════════════════════════════════════════════ */

/* Tokens verde da usare solo mobile */
@media (max-width: 900px) {

  /* -- Background e layout scroll -- */
  html, body {
    background: #F4FAF4 !important;
    color: #1A2E1A !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    height: auto !important;
  }
  .app-shell { height: auto !important; min-height: 100vh; overflow: visible !important; }
  .main-area {
    background: #F4FAF4 !important;
    overflow: visible !important;
    height: auto !important;
    min-height: 100vh;
    flex-direction: column;
  }
  .views-container {
    background: #F4FAF4 !important;
    overflow: visible !important;
    height: auto !important;
    padding-bottom: 140px;
  }
  .view { overflow: visible !important; height: auto !important; }

  /* -- Topbar: fisso in cima su mobile -- */
  .topbar {
    background: #fff !important;
    border-bottom: 1px solid #C8E6C9 !important;
    box-shadow: 0 2px 12px rgba(26,46,26,.08) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 300 !important;
  }
  /* Spazio compensativo per il topbar fixed */
  .main-area {
    padding-top: 58px !important;
  }
  .topbar-mobile-logo img {
    display: block !important;
    height: 32px !important;
    width: auto !important;
    object-fit: contain;
  }
  .topbar-mobile-logo::after { content: none !important; }
  .hamburger-btn {
    background: #F4FAF4 !important;
    border: 1px solid #C8E6C9 !important;
    color: #1A2E1A !important;
  }
  .hamburger-btn:active { background: #E8F5E9 !important; }
  .btn-primary {
    background: linear-gradient(135deg, #388E3C, #4CAF50) !important;
    box-shadow: 0 3px 12px rgba(56,142,60,0.35) !important;
    border-radius: 12px !important;
  }

  /* -- Page tabs (mobile only) -- */
  .mob-page-tabs {
    display: flex;
    background: #fff;
    border-bottom: 1px solid #C8E6C9;
    position: sticky;
    top: 58px;
    z-index: 199;
    flex-shrink: 0;
  }
  .mob-page-tab {
    flex: 1;
    padding: 12px 4px;
    text-align: center;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    background: transparent;
    color: #8BAE8B;
    border-bottom: 3px solid transparent;
    transition: color .2s, border-color .2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .mob-page-tab.active { color: #388E3C; border-bottom-color: #4CAF50; }

  /* -- Mobile home block -- */
  .mob-home { display: block; }

  /* -- Hero card -- */
  .mob-hero {
    margin: 16px 16px 0;
    background: linear-gradient(135deg, #1A2E1A 0%, #2E5430 60%, #3D7040 100%);
    border-radius: 20px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    animation: mobFadeUp .35s ease both;
  }
  .mob-hero::before {
    content: '';
    position: absolute;
    width: 180px; height: 180px;
    border-radius: 50%;
    background: rgba(76,175,80,0.15);
    top: -70px; right: -50px;
  }
  .mob-hero-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
  }
  .mob-hero-label { font-size: 11px; color: rgba(255,255,255,.5); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
  .mob-hero-name { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 20px; font-weight: 800; color: #fff; }
  .mob-hero-sub { font-size: 12px; color: rgba(255,255,255,.55); margin-top: 2px; }
  .mob-hero-status {
    background: rgba(76,175,80,.25);
    border: 1px solid rgba(76,175,80,.4);
    border-radius: 10px;
    padding: 6px 10px;
    text-align: center;
    flex-shrink: 0;
  }
  .mob-hero-status-dot { width: 8px; height: 8px; border-radius: 50%; background: #69F0AE; box-shadow: 0 0 8px #69F0AE; margin: 0 auto 3px; }
  .mob-hero-status-lbl { font-size: 9px; color: rgba(255,255,255,.6); text-transform: uppercase; letter-spacing: .5px; }
  .mob-hero-stats {
    display: flex;
    gap: 8px;
    position: relative;
    z-index: 1;
  }
  .mob-hs {
    background: rgba(26,46,26,0.10);
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 12px;
    padding: 10px 6px;
    flex: 1;
    text-align: center;
  }
  .mob-hs-val { font-family: 'Georgia', serif; font-size: 20px; font-weight: 700; font-style: italic; color: #fff; line-height: 1; }
  .mob-hs-lbl { font-size: 9px; color: rgba(255,255,255,.45); text-transform: uppercase; letter-spacing: .3px; margin-top: 3px; }

  /* -- Section header -- */
  .mob-sh { display: flex; align-items: center; justify-content: space-between; padding: 18px 16px 8px; }
  .mob-sh-title { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: #4A6B4A; }
  .mob-sh-link { font-size: 12px; color: #388E3C; font-weight: 700; cursor: pointer; }

  /* ── Nosu AI card (blurred / In arrivo) ── */
  .mob-nosu-wrap { margin: 0 16px 4px; position: relative; border-radius: 20px; overflow: hidden; border: 1.5px solid #C8E6C9; }
  .mob-nosu-content { filter: blur(2px); pointer-events: none; user-select: none; }
  /* Hero verde */
  .mob-nosu-hero { background: linear-gradient(135deg, #1A2E1A 0%, #2E5430 60%, #3D7040 100%); padding: 10px 14px; position: relative; overflow: hidden; }
  .mob-nosu-hero::before { content: ''; position: absolute; width: 80px; height: 80px; border-radius: 50%; background: rgba(76,175,80,.18); top: -28px; right: -20px; }
  .mob-nosu-hero-meta { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
  .mob-nosu-avatar-sm { font-size: 14px; flex-shrink: 0; }
  .mob-nosu-hero-date { font-size: 9px; font-weight: 700; color: rgba(255,255,255,.6); text-transform: uppercase; letter-spacing: .5px; }
  .mob-nosu-hero-title { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 14px; font-weight: 800; color: #fff; line-height: 1.2; }
  /* Card bianca */
  .mob-nosu-body { background: #fff; padding: 8px 14px 8px; }
  .mob-nosu-action-row { display: flex; align-items: center; gap: 10px; padding: 0; }
  .mob-nosu-action-icon { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
  .mob-nosu-action-info { flex: 1; min-width: 0; }
  .mob-nosu-action-title { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 11px; font-weight: 700; color: #1A2E1A; }
  .mob-nosu-action-btn { flex-shrink: 0; padding: 5px 10px; background: #388E3C; color: #fff; border: none; border-radius: 7px; font-family: 'Plus Jakarta Sans', sans-serif; font-size: 10px; font-weight: 700; }
  /* Overlay */
  .mob-nosu-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(244,250,244,.25); }
  .mob-soon-green { display: inline-block; padding: 7px 18px; background: #1A2E1A; color: #fff; border-radius: 20px; font-family: 'Plus Jakarta Sans', sans-serif; font-size: 12px; font-weight: 800; letter-spacing: .5px; box-shadow: 0 4px 16px rgba(26,46,26,.35); }
  .mob-nosu-badge { display: flex; align-items: center; gap: 12px; background: #fff; border: 1.5px solid #C8E6C9; border-radius: 16px; padding: 12px 18px; box-shadow: 0 6px 24px rgba(56,142,60,.18); }
  .mob-nosu-badge-title { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 14px; font-weight: 800; color: #1A2E1A; }
  .mob-nosu-badge-sub { font-size: 11px; color: #4CAF50; font-weight: 700; margin-top: 2px; }

  /* ── MOBILE CRM ──────────────────────────────────────── */
  #view-crm .crm-topnav,
  #view-crm .crm-section { display: none !important; }
  .mob-crm-wrap { display: block; padding-bottom: 32px; }

  /* Hero */
  .mob-crm-hero { margin: 16px 16px 0; background: linear-gradient(135deg,#1A2E1A 0%,#2D5A2D 55%,#1E4020 100%); border-radius: 20px; padding: 22px 22px 20px; position: relative; overflow: hidden; }
  .mob-crm-hero::before { content: ''; position: absolute; width: 180px; height: 180px; border-radius: 50%; background: rgba(76,175,80,.18); top: -60px; right: -50px; }
  .mob-crm-hero::after  { content: ''; position: absolute; width: 70px; height: 70px; border-radius: 50%; background: rgba(139,195,74,.12); bottom: -20px; left: 24px; }
  .mob-crm-hero-label { font-size: 11px; color: rgba(255,255,255,.5); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 5px; position: relative; z-index: 1; }
  .mob-crm-hero-title { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 24px; font-weight: 800; color: #fff; margin-bottom: 8px; position: relative; z-index: 1; }
  .mob-crm-hero-hint  { font-size: 13px; color: rgba(255,255,255,.65); line-height: 1.5; margin-bottom: 18px; position: relative; z-index: 1; }
  .mob-crm-hero-hint strong { color: #8BC34A; }
  .mob-crm-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; position: relative; z-index: 1; }
  .mob-crm-stat { background: rgba(255,255,255,.08); border: 1px solid rgba(26,46,26,0.15); border-radius: 14px; padding: 12px 8px; text-align: center; }
  .mob-crm-stat-val { font-size: 22px; font-weight: 800; color: #fff; line-height: 1; font-family: 'Plus Jakarta Sans', sans-serif; }
  .mob-crm-stat-lbl { font-size: 10px; color: rgba(255,255,255,.5); margin-top: 3px; }
  .mob-crm-stat-hl .mob-crm-stat-val { color: #8BC34A; }

  /* Filter tabs */
  .mob-crm-tabs { display: flex; gap: 8px; padding: 16px 16px 0; overflow-x: auto; scrollbar-width: none; }
  .mob-crm-tabs::-webkit-scrollbar { display: none; }
  .mob-crm-tab { padding: 8px 16px; border-radius: 12px; font-size: 13px; font-weight: 700; cursor: pointer; border: none; white-space: nowrap; font-family: 'Plus Jakarta Sans', sans-serif; transition: .15s; background: #fff; color: #5A7A5A; border: 1px solid #D8EDD8; flex-shrink: 0; }
  .mob-crm-tab.active { background: linear-gradient(135deg, #4CAF50, #66BB6A); color: #fff; border-color: transparent; box-shadow: 0 4px 12px rgba(76,175,80,.35); }

  /* Search */
  .mob-crm-search-wrap { margin: 14px 16px 0; position: relative; }
  .mob-crm-search-inp { width: 100%; background: #fff; border: 1.5px solid #D8EDD8; border-radius: 14px; padding: 12px 16px 12px 42px; font-size: 16px; color: #1A2E1A; outline: none; transition: border-color .2s; box-shadow: 0 4px 16px rgba(76,175,80,.08); }
  .mob-crm-search-inp:focus { border-color: #4CAF50; }
  .mob-crm-search-inp::placeholder { color: #9AB89A; }
  .mob-crm-search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 16px; pointer-events: none; }

  /* Count row */
  .mob-crm-count-row { display: flex; align-items: center; justify-content: space-between; padding: 18px 16px 8px; }
  .mob-crm-count-lbl { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 12px; font-weight: 700; letter-spacing: 1.2px; color: #5A7A5A; text-transform: uppercase; }
  .mob-crm-sel-all { font-size: 12px; color: #4CAF50; font-weight: 700; background: #E8F5E9; border: none; padding: 5px 10px; border-radius: 8px; cursor: pointer; font-family: 'Plus Jakarta Sans', sans-serif; }

  /* Contact card */
  .mob-cc { margin: 0 16px 10px; background: #fff; border-radius: 20px; border: 1px solid #D8EDD8; box-shadow: 0 4px 16px rgba(76,175,80,.08); overflow: visible; transition: box-shadow .2s; }
  .mob-cc.open { box-shadow: 0 8px 28px rgba(76,175,80,.18); border-color: rgba(76,175,80,.35); }
  .mob-cc-row { display: flex; align-items: center; gap: 14px; padding: 16px; cursor: pointer; user-select: none; }
  .mob-cc-avatar { width: 48px; height: 48px; border-radius: 16px; background: linear-gradient(135deg, #4CAF50, #8BC34A); display: flex; align-items: center; justify-content: center; font-family: 'Plus Jakarta Sans', sans-serif; font-size: 18px; font-weight: 800; color: #fff; flex-shrink: 0; }
  .mob-cc-info { flex: 1; min-width: 0; }
  .mob-cc-name  { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 15px; font-weight: 700; color: #1A2E1A; margin-bottom: 2px; }
  .mob-cc-email { font-size: 12px; color: #9AB89A; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mob-cc-badges { display: flex; gap: 5px; margin-top: 5px; flex-wrap: wrap; }
  .mob-cc-badge { font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 7px; text-transform: uppercase; letter-spacing: .3px; }
  .mob-cc-badge-new  { background: #F1F8E9; color: #388E3C; }
  .mob-cc-badge-rep  { background: #FFF3DC; color: #C07800; }
  .mob-cc-badge-nfc  { background: #E3F2FD; color: #1565C0; }
  .mob-cc-badge-mod  { background: #F3E8FF; color: #7E22CE; text-transform: none; }
  .mob-cc-chev { font-size: 22px; color: #9AB89A; flex-shrink: 0; transition: transform .25s; font-weight: 300; }
  .mob-cc.open .mob-cc-chev { transform: rotate(90deg); color: #4CAF50; }
  .mob-cc-acc { display: none; background: #fff; transition: opacity 0.35s ease; opacity: 0; }
  .mob-cc.open .mob-cc-acc { display: block; opacity: 1; }

  /* Empty state */
  .mob-crm-empty { margin: 0 16px; background: #fff; border-radius: 20px; border: 2px dashed #D8EDD8; padding: 28px 20px; text-align: center; }
  .mob-crm-empty-title { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 15px; font-weight: 700; color: #1A2E1A; margin-bottom: 8px; }
  .mob-crm-empty-sub   { font-size: 13px; color: #9AB89A; line-height: 1.6; max-width: 260px; margin: 0 auto 14px; }
  .mob-crm-empty-cta   { background: linear-gradient(135deg, #4CAF50, #66BB6A); color: #fff; border: none; padding: 12px 24px; border-radius: 14px; font-family: 'Plus Jakarta Sans', sans-serif; font-size: 14px; font-weight: 800; cursor: pointer; box-shadow: 0 4px 14px rgba(76,175,80,.35); }

  /* Strumenti avanzati */
  .mob-crm-adv-toggle { margin: 0 16px; display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; background: #fff; border-radius: 20px; border: 1px solid #D8EDD8; cursor: pointer; }
  .mob-crm-adv-lbl    { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 13px; font-weight: 700; color: #5A7A5A; }
  .mob-crm-adv-chev   { font-size: 14px; color: #9AB89A; transition: transform .25s; }
  .mob-crm-adv-body   { max-height: 0; overflow: hidden; transition: max-height .35s cubic-bezier(.4,0,.2,1); padding: 0 16px; }
  .mob-crm-adv-body.open { max-height: 800px; }
  /* ──────────────────────────────────────────────────────── */

  /* -- Quick actions grid -- */
  .mob-quick-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 0 16px;
    margin-bottom: 4px;
  }
  .mob-qa {
    background: #fff;
    border: 1px solid #C8E6C9;
    border-radius: 20px;
    padding: 16px 14px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 7px;
    box-shadow: 0 4px 24px rgba(56,142,60,.1);
    animation: mobFadeUp .4s ease both;
  }
  .mob-qa:active { transform: scale(.97); }
  .mob-qa-icon { font-size: 26px; line-height: 1; }
  .mob-qa-title { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 13px; font-weight: 700; color: #1A2E1A; }
  .mob-qa-sub { font-size: 11px; color: #8BAE8B; line-height: 1.4; }

  /* -- Clients card -- */
  .mob-clients-card {
    background: #fff;
    border-radius: 20px;
    border: 1px solid #C8E6C9;
    box-shadow: 0 4px 24px rgba(56,142,60,.1);
    margin: 0 16px;
    overflow: hidden;
    animation: mobFadeUp .4s .3s ease both;
    margin-bottom: 16px;
  }
  .mob-client-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    border-bottom: 1px solid #C8E6C9;
    cursor: pointer;
  }
  .mob-client-row:last-child { border-bottom: none; }
  .mob-client-av {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #388E3C, #4CAF50);
    display: flex; align-items: center; justify-content: center;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 14px; font-weight: 800; color: #fff;
    flex-shrink: 0;
  }
  .mob-client-info { flex: 1; min-width: 0; }
  .mob-client-name { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 13px; font-weight: 700; color: #1A2E1A; }
  .mob-client-detail { font-size: 11px; color: #8BAE8B; margin-top: 2px; }
  .mob-client-pts { text-align: right; flex-shrink: 0; }
  .mob-client-pts-val { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 14px; font-weight: 800; color: #388E3C; }
  .mob-client-pts-lbl { font-size: 9px; color: #8BAE8B; text-transform: uppercase; letter-spacing: .3px; }

  /* -- Pages hero card (mobile: margini specifici) -- */
  .pages-hero-card {
    padding: 20px;
    margin: 16px 16px 16px;
  }

  /* -- Pagine card -- */
  .mob-pages-card {
    background: #fff;
    border-radius: 20px;
    border: 1px solid #C8E6C9;
    box-shadow: 0 4px 24px rgba(56,142,60,.08);
    margin: 0 16px 16px;
    overflow: hidden;
  }
  .mob-page-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    border-bottom: 1px solid #E8F5E9;
    cursor: pointer;
    transition: background .15s;
  }
  .mob-page-row:last-child { border-bottom: none; }
  .mob-page-row:active { background: #F4FAF4; }
  .mob-page-row-icon {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: #E8F5E9;
    display: flex; align-items: center; justify-content: center;
    color: #388E3C;
    flex-shrink: 0;
  }
  .mob-page-row-info { flex: 1; min-width: 0; }
  .mob-page-row-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 13px; font-weight: 700; color: #1A2E1A;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .mob-page-row-slug { font-size: 11px; color: #8BAE8B; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mob-page-row-status {
    font-size: 10px; font-weight: 700;
    padding: 3px 9px;
    border-radius: 20px;
    flex-shrink: 0;
  }
  .mob-page-row-status.pub { background: #E8F5E9; color: #388E3C; }
  .mob-page-row-status.draft { background: #FFF8E1; color: #F57F17; }

  /* -- Bottom nav verde -- */
  .mob-bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: rgba(255,255,255,.94);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid #C8E6C9;
    display: flex;
    align-items: flex-end;
    padding: 8px 4px 18px;
    z-index: 200;
  }
  .mob-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    padding: 4px 2px;
  }
  .mob-nav-icon {
    width: 44px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 12px;
    font-size: 20px;
    transition: background .15s;
  }
  .mob-nav-item.active .mob-nav-icon { background: #E8F5E9; }
  .mob-nav-lbl { font-size: 10px; font-weight: 500; color: #8BAE8B; transition: color .15s; }
  .mob-nav-item.active .mob-nav-lbl { color: #388E3C; font-weight: 700; }

  /* FAB centrale */
  .mob-nav-fab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    padding: 0 2px;
    position: relative;
    margin-top: -22px;
  }
  .mob-fab-btn {
    width: 56px; height: 56px;
    border-radius: 18px;
    background: linear-gradient(135deg, #388E3C, #4CAF50);
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
    box-shadow: 0 6px 20px rgba(56,142,60,.5);
    border: 3px solid #fff;
  }
  .mob-fab-lbl { font-size: 10px; font-weight: 700; color: #388E3C; margin-top: 2px; }

  /* -- Nascondi tutto il contenuto desktop -- */
  .desk-home { display: none !important; }
  .desk-crm-header { display: none !important; }
  #dCrm-wrap { display: none !important; }
  #dAn-wrap { display: none !important; }
  .desk-nfc-hero { display: none !important; }

  /* -- Tab mobile nascosti (navigazione affidata al bottom nav) -- */
  .mob-page-tabs { display: none !important; }

  /* -- Views container scrollable -- */
  .views-container { padding-bottom: 0; }
  .view {
    position: static !important;   /* annulla position:absolute che blocca lo scroll */
    height: auto !important;
    overflow: visible !important;
    overflow-x: hidden !important; /* previeni scroll orizzontale */
    padding: 16px 16px 160px;      /* spazio laterale + sopra la bottom nav fissa */
    display: none;
  }
  body { overflow-x: hidden; }
  /* Previeni auto-zoom iOS su focus input (richiede font-size >= 16px) */
  input, select, textarea { font-size: 16px !important; }
  .view.active { display: block; }

  /* -- Animation -- */
  @keyframes mobFadeUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* ═══════════════════════════════════════════════
     MOBILE ANALYTICS
     ═══════════════════════════════════════════════ */
  .mob-analytics-empty.desktop-only { display: none !important; }

  /* Hero */
  .mob-an-hero {
    margin: 16px 16px 0;
    background: linear-gradient(135deg, #1A2E1A 0%, #2D5A2D 55%, #1E4020 100%);
    border-radius: 20px; padding: 22px 20px 20px;
    position: relative; overflow: hidden;
  }
  .mob-an-hero::before { content:''; position:absolute; width:200px; height:200px; border-radius:50%; background:rgba(76,175,80,.16); top:-70px; right:-60px; }
  .mob-an-hero-top { display:flex; align-items:flex-start; justify-content:space-between; margin-bottom:18px; position:relative; z-index:1; }
  .mob-an-hero-label { font-size:11px; color:rgba(255,255,255,.5); text-transform:uppercase; letter-spacing:1px; margin-bottom:5px; }
  .mob-an-hero-title { font-family:'Plus Jakarta Sans',sans-serif; font-size:22px; font-weight:800; color:#fff; }
  .mob-an-score-wrap { display:flex; flex-direction:column; align-items:center; gap:3px; position:relative; z-index:1; }
  .mob-an-score-circle { position:relative; width:64px; height:64px; }
  .mob-an-score-val { position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); font-family:'Georgia',serif; font-size:20px; font-weight:700; font-style:italic; color:#fff; line-height:1; }
  .mob-an-score-lbl { font-size:10px; color:#8BC34A; font-weight:700; text-transform:uppercase; letter-spacing:.5px; }
  /* Page selector dropdown */
  .mob-an-page-drop {
    display: none;
    position: relative;
    z-index: 10;
    background: rgba(26,46,26,.98);
    border: 1px solid rgba(26,46,26,0.20);
    border-radius: 12px;
    margin-top: 6px;
    overflow: hidden;
    max-height: 200px;
    overflow-y: auto;
  }
  .mob-an-page-drop-item {
    padding: 12px 14px;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255,255,255,.75);
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,.07);
    transition: background .12s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }
  .mob-an-page-drop-item:last-child { border-bottom: none; }
  .mob-an-page-drop-item:active,
  .mob-an-page-drop-item:hover { background: rgba(76,175,80,.18); color: #fff; }
  .mob-an-page-drop-item.active { color: #8BC34A; font-weight: 700; }
  .mob-an-drop-views {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255,255,255,.4);
    white-space: nowrap;
    flex-shrink: 0;
  }
  .mob-an-page-drop-item.active .mob-an-drop-views { color: rgba(139,195,74,.7); }

  .mob-an-period-tabs { display:flex; gap:6px; margin-bottom:14px; position:relative; z-index:1; }
  .mob-an-ptab { padding:7px 14px; border-radius:10px; font-size:12px; font-weight:600; cursor:pointer; border:none; font-family:'Plus Jakarta Sans',sans-serif; background:rgba(26,46,26,0.10); color:rgba(255,255,255,.6); border:1px solid rgba(26,46,26,0.15); }
  .mob-an-ptab.active { background:#8BC34A; color:#1A2E1A; border-color:#8BC34A; box-shadow:0 3px 10px rgba(139,195,74,.4); }
  .mob-an-page-sel { background:rgba(26,46,26,0.10); border:1px solid rgba(26,46,26,0.20); border-radius:12px; padding:10px 14px; display:flex; align-items:center; justify-content:space-between; position:relative; z-index:1; }
  .mob-an-page-sel-lbl { font-size:11px; color:rgba(255,255,255,.5); margin-bottom:2px; }
  .mob-an-page-sel-val { font-size:14px; font-weight:600; color:#fff; }

  /* Section header */
  .mob-an-sh { font-family:'Plus Jakarta Sans',sans-serif; font-size:13px; font-weight:700; text-transform:uppercase; letter-spacing:1.2px; color:#5A7A5A; padding:22px 20px 10px; }

  /* KPI grid */
  .mob-an-kpi-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; padding:0 16px; }
  .mob-an-kpi-card { background:#fff; border-radius:20px; padding:16px; border:1px solid #C8E6C9; box-shadow:0 4px 24px rgba(56,142,60,.08); position:relative; overflow:hidden; }
  .mob-an-kpi-icon { width:32px; height:32px; border-radius:9px; display:flex; align-items:center; justify-content:center; font-size:15px; margin-bottom:10px; }
  .mob-an-kpi-val { font-family:'Georgia','Times New Roman',serif; font-size:28px; font-weight:700; font-style:italic; color:#1A2E1A; line-height:1; margin-bottom:4px; letter-spacing:-1px; }
  .mob-an-kpi-lbl { font-size:11px; font-weight:500; color:#5A7A5A; margin-bottom:6px; line-height:1.3; }
  .mob-an-kpi-trend { font-size:10px; font-weight:700; display:inline-flex; align-items:center; padding:3px 8px; border-radius:7px; }
  .mob-an-kpi-trend.up      { background:#F1F8E9; color:#388E3C; }
  .mob-an-kpi-trend.down    { background:#FFE9E9; color:#d32f2f; }
  .mob-an-kpi-trend.neutral { background:#FFF3DC; color:#C07800; }

  /* Top page */
  .mob-an-top-page { margin:0 16px; background:#fff; border-radius:20px; padding:16px; border:1px solid #C8E6C9; box-shadow:0 4px 24px rgba(56,142,60,.08); display:flex; align-items:center; gap:14px; cursor:pointer; }
  .mob-an-top-rank { width:42px; height:42px; border-radius:12px; background:linear-gradient(135deg,#F5A623,#FFB740); display:flex; align-items:center; justify-content:center; font-size:20px; flex-shrink:0; }
  .mob-an-top-info { flex:1; min-width:0; }
  .mob-an-top-badge { font-size:9px; font-weight:700; text-transform:uppercase; letter-spacing:.6px; color:#C07800; background:#FFF3DC; padding:2px 7px; border-radius:6px; display:inline-block; margin-bottom:4px; }
  .mob-an-top-name { font-family:'Plus Jakarta Sans',sans-serif; font-size:14px; font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; color:#1A2E1A; }
  .mob-an-top-url  { font-size:11px; color:#9AB89A; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .mob-an-top-views { font-family:'Georgia',serif; font-style:italic; font-size:24px; font-weight:700; color:#4CAF50; flex-shrink:0; display:flex; flex-direction:column; align-items:flex-end; line-height:1.1; }
  .mob-an-top-views span { font-family:'DM Sans',sans-serif; font-style:normal; font-size:10px; color:#9AB89A; font-weight:400; }

  /* Contatti */
  .mob-an-contacts-card { margin:0 16px; background:linear-gradient(135deg,#F1F8E9,#DCEDC8); border:1.5px solid rgba(139,195,74,.35); border-radius:20px; padding:18px; display:flex; align-items:center; gap:16px; }
  .mob-an-contacts-icon { width:52px; height:52px; border-radius:16px; background:#4CAF50; display:flex; align-items:center; justify-content:center; font-size:24px; flex-shrink:0; }
  .mob-an-contacts-val  { font-family:'Georgia',serif; font-size:36px; font-weight:700; font-style:italic; color:#1A2E1A; line-height:1; letter-spacing:-2px; }
  .mob-an-contacts-lbl  { font-size:13px; font-weight:500; color:#5A7A5A; margin-top:2px; }
  .mob-an-contacts-trend { font-size:11px; font-weight:700; color:#388E3C; background:rgba(76,175,80,.2); padding:3px 9px; border-radius:8px; margin-top:6px; display:inline-block; }

  /* Chart */
  .mob-an-chart-card { margin:0 16px; background:#fff; border-radius:20px; padding:18px; border:1px solid #C8E6C9; box-shadow:0 4px 24px rgba(56,142,60,.08); }
  .mob-an-chart-legend { display:flex; gap:14px; margin-bottom:14px; }
  .mob-an-legend-item { display:flex; align-items:center; gap:5px; font-size:11px; color:#5A7A5A; font-weight:500; }
  .mob-an-legend-dot  { width:8px; height:8px; border-radius:50%; }

  /* NFC grid dark */
  .mob-an-nfc-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; padding:0 16px; }
  .mob-an-nfc-card { background:linear-gradient(135deg,#1A2E1A,#2D5A2D); border-radius:20px; padding:16px; }
  .mob-an-nfc-icon { font-size:20px; margin-bottom:8px; }
  .mob-an-nfc-val  { font-family:'Georgia',serif; font-size:28px; font-weight:700; font-style:italic; color:#fff; line-height:1; margin-bottom:3px; letter-spacing:-1px; }
  .mob-an-nfc-lbl  { font-size:10px; color:rgba(255,255,255,.5); text-transform:uppercase; letter-spacing:.5px; margin-bottom:3px; }
  .mob-an-nfc-sub  { font-size:11px; color:rgba(255,255,255,.3); }

  /* Pixel card */
  .mob-an-pixel-card { margin:0 16px; background:#fff; border-radius:20px; padding:18px; border:1px solid #C8E6C9; box-shadow:0 4px 24px rgba(56,142,60,.08); }
  .mob-an-pixel-hdr  { display:flex; align-items:center; gap:8px; font-family:'Plus Jakarta Sans',sans-serif; font-size:15px; font-weight:700; color:#1A2E1A; margin-bottom:8px; }
  .mob-an-pixel-sub  { font-size:12px; color:#5A7A5A; margin-bottom:16px; line-height:1.5; }
  .mob-an-pixel-field { margin-bottom:12px; }
  .mob-an-pixel-field-lbl { font-size:11px; font-weight:600; color:#5A7A5A; text-transform:uppercase; letter-spacing:.4px; margin-bottom:6px; display:flex; align-items:center; justify-content:space-between; }
  .mob-an-pixel-input { width:100%; background:#F6FAF6; border:1.5px solid #C8E6C9; border-radius:12px; padding:11px 14px; font-size:13px; color:#1A2E1A; outline:none; }
  .mob-an-pixel-input:focus { border-color:#4CAF50; }
  .mob-an-info-link { font-size:11px; font-weight:600; color:#4CAF50; cursor:pointer; text-transform:none; letter-spacing:0; }
  .mob-an-pixel-save { background:linear-gradient(135deg,#388E3C,#4CAF50); color:#fff; border:none; padding:12px 22px; border-radius:12px; font-family:'Plus Jakarta Sans',sans-serif; font-size:13px; font-weight:700; cursor:pointer; box-shadow:0 4px 14px rgba(76,175,80,.3); width:100%; margin-top:4px; }

  /* Geo section */
  .mob-an-geo-card { margin:0 16px; background:#fff; border-radius:20px; padding:18px; border:1px solid #C8E6C9; box-shadow:0 4px 24px rgba(56,142,60,.08); }
  .mob-an-geo-top   { display:flex; align-items:center; gap:16px; margin-bottom:16px; }
  .mob-an-donut     { flex-shrink:0; }
  .mob-an-geo-city  { font-family:'Plus Jakarta Sans',sans-serif; font-size:15px; font-weight:700; color:#1A2E1A; margin-bottom:2px; }
  .mob-an-geo-pct   { font-family:'Georgia',serif; font-size:24px; font-style:italic; font-weight:700; color:#4CAF50; letter-spacing:-1px; }
  .mob-an-geo-sub   { font-size:11px; color:#9AB89A; }
  .mob-an-geo-list  { display:flex; flex-direction:column; gap:10px; }
  .mob-an-geo-item  { display:flex; flex-direction:column; gap:4px; }
  .mob-an-geo-row   { display:flex; align-items:center; justify-content:space-between; }
  .mob-an-geo-city-row { font-size:13px; font-weight:500; color:#1A2E1A; display:flex; align-items:center; gap:7px; }
  .mob-an-geo-dot   { width:8px; height:8px; border-radius:50%; flex-shrink:0; }
  .mob-an-geo-pct-sm { font-size:12px; color:#5A7A5A; font-weight:600; }
  .mob-an-geo-bar-bg { height:4px; background:#D8EDD8; border-radius:4px; overflow:hidden; }
  .mob-an-geo-bar-fill { height:100%; border-radius:4px; }

  /* Info modals */
  .mob-an-modal-overlay { position:fixed; inset:0; background:rgba(0,0,0,.55); z-index:2000; display:none; align-items:flex-end; justify-content:center; padding:16px; }
  .mob-an-modal { background:#fff; border-radius:24px 24px 20px 20px; padding:24px 22px 28px; width:100%; max-width:420px; position:relative; max-height:90vh; overflow-y:auto; }
  .mob-an-modal h3 { font-family:'Plus Jakarta Sans',sans-serif; font-size:17px; font-weight:800; color:#1A2E1A; margin-bottom:0; }
  .mob-an-modal code { background:#F4FAF4; border:1px solid #C8E6C9; padding:2px 8px; border-radius:6px; color:#388E3C; font-size:12px; }
  .mob-an-modal-close { position:absolute; top:18px; right:18px; background:#F4FAF4; border:1px solid #C8E6C9; width:32px; height:32px; border-radius:50%; font-size:14px; cursor:pointer; display:flex; align-items:center; justify-content:center; color:#1A2E1A; }
  .mob-an-modal-step { display:flex; align-items:flex-start; gap:12px; margin-bottom:14px; font-size:13px; color:#5A7A5A; line-height:1.5; }
  .mob-an-step-num { width:26px; height:26px; border-radius:50%; background:linear-gradient(135deg,#388E3C,#4CAF50); color:#fff; font-family:'Plus Jakarta Sans',sans-serif; font-size:12px; font-weight:800; display:flex; align-items:center; justify-content:center; flex-shrink:0; }

  /* ─── MOBILE NFC ─── */

  /* Hide desktop NFC chrome on mobile */
  .mob-nfc-desktop-hdr { display: none !important; }
  .nfc-main-tabs       { display: none !important; }
  #nfc-panel-nfc > *:not(.mob-nfc):not(#nfcQRModal):not(#mobNfcStatsOverlay) { display: none !important; }
  #nfc-panel-nfc .mob-nfc { display: block; }

  /* Wrapper — no horizontal padding, each child manages its own margin */
  .mob-nfc { display: flex; flex-direction: column; gap: 0; padding-bottom: 20px; }

  /* Hero — matches .mob-hero style */
  .mob-nfc-hero {
    margin: 16px 16px 0;
    background: linear-gradient(135deg, #1A2E1A 0%, #2E5430 60%, #3D7040 100%);
    border-radius: 20px; padding: 20px; position: relative; overflow: hidden;
  }
  .mob-nfc-hero::before {
    content: ''; position: absolute; width: 180px; height: 180px; border-radius: 50%;
    background: rgba(76,175,80,0.15); top: -70px; right: -50px;
  }
  .mob-nfc-hero-label {
    font-size: 11px; color: rgba(255,255,255,.5); text-transform: uppercase;
    letter-spacing: 1px; margin-bottom: 4px; position: relative; z-index: 1;
  }
  .mob-nfc-hero-title {
    font-family: 'Plus Jakarta Sans', sans-serif; font-size: 22px; font-weight: 800;
    color: #fff; letter-spacing: -0.5px; margin-bottom: 16px; line-height: 1.15;
    position: relative; z-index: 1;
  }
  .mob-nfc-hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; position: relative; z-index: 1; }
  .mob-nfc-hero-stat { background: rgba(255,255,255,.07); border-radius: 14px; padding: 12px 14px; border: 1px solid rgba(26,46,26,0.10); }
  .mob-nfc-hero-val { font-family: 'Georgia', serif; font-size: 28px; font-style: italic; font-weight: 700; color: #fff; line-height: 1; letter-spacing: -1px; margin-bottom: 4px; }
  .mob-nfc-hero-lbl { font-size: 10px; color: rgba(255,255,255,.45); text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }

  /* Section title — matches analytics style */
  .mob-nfc-section-title {
    font-size: 11px; font-weight: 700; color: #9AB89A; text-transform: uppercase;
    letter-spacing: 1px; padding: 20px 16px 8px;
  }

  /* ── QR card ── */
  .mob-nfc-qr-card {
    margin: 0 16px; background: #fff; border-radius: 20px;
    border: 1.5px solid #C8E6C9; box-shadow: 0 4px 20px rgba(56,142,60,.07); padding: 16px;
  }
  .mob-nfc-qr-hdr { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
  .mob-nfc-qr-title { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 15px; font-weight: 800; color: #1A2E1A; }
  .mob-nfc-qr-badge { font-size: 11px; font-weight: 700; color: #388E3C; background: rgba(76,175,80,.12); border: 1px solid rgba(76,175,80,.3); border-radius: 20px; padding: 3px 10px; }
  .mob-nfc-qr-badge-off { font-size: 11px; font-weight: 700; color: #9AB89A; background: #F4FAF4; border: 1px solid #C8E6C9; border-radius: 20px; padding: 3px 10px; }
  .mob-nfc-qr-body { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
  .mob-nfc-qr-thumb-wrap { width: 80px; height: 80px; flex-shrink: 0; background: #F4FAF4; border-radius: 10px; display: flex; align-items: center; justify-content: center; overflow: hidden; cursor: pointer; }
  .mob-nfc-qr-right { flex: 1; min-width: 0; }
  .mob-nfc-qr-dest-lbl { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .7px; color: #9AB89A; margin-bottom: 3px; }
  .mob-nfc-qr-dest-url { font-size: 12px; color: #388E3C; font-weight: 600; word-break: break-all; margin-bottom: 10px; line-height: 1.35; }
  .mob-nfc-qr-toggle { display: flex; border-radius: 10px; overflow: hidden; border: 1.5px solid #C8E6C9; }
  .mob-nfc-qr-mode {
    flex: 1; padding: 8px 6px; background: #fff; border: none; cursor: pointer;
    font-size: 11px; font-weight: 700; color: #9AB89A; transition: all .15s;
  }
  .mob-nfc-qr-mode.active { background: #388E3C; color: #fff; }
  .nfc-chip-mode-btn {
    flex: 1; padding: 8px 6px; background: #fff; border: none; cursor: pointer;
    font-size: 11px; font-weight: 700; color: #9AB89A; transition: all .15s;
    font-family: inherit;
  }
  .nfc-chip-mode-btn.active { background: #388E3C; color: #fff; }
  .mob-nfc-qr-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
  .mob-nfc-qr-select {
    flex: 1; padding: 10px 12px; background: #F4FAF4; border: 1.5px solid #C8E6C9;
    border-radius: 12px; font-size: 13px; color: #1A2E1A; outline: none; min-width: 0;
  }
  .mob-nfc-qr-url-input {
    flex: 1; padding: 10px 12px; background: #F4FAF4; border: 1.5px solid #C8E6C9;
    border-radius: 12px; font-size: 13px; color: #1A2E1A; outline: none; min-width: 0;
  }
  .mob-nfc-qr-url-input:focus, .mob-nfc-qr-select:focus { border-color: #4CAF50; }
  .mob-nfc-qr-save-btn {
    background: linear-gradient(135deg, #388E3C, #4CAF50); color: #fff; border: none;
    padding: 10px 16px; border-radius: 12px; font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap;
    box-shadow: 0 3px 10px rgba(76,175,80,.3);
  }
  .mob-nfc-qr-no-pages { font-size: 12px; color: #9AB89A; flex: 1; }

  /* ── Cosa sta succedendo — 3 tiles ── */
  .mob-nfc-stats-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin: 0 16px; }
  .mob-nfc-stat-tile {
    background: #fff; border-radius: 16px; border: 1.5px solid #C8E6C9;
    padding: 14px 10px; text-align: center; box-shadow: 0 2px 12px rgba(56,142,60,.06);
  }
  .mob-nfc-stat-val { font-family: 'Georgia', serif; font-size: 28px; font-style: italic; font-weight: 700; color: #1A2E1A; letter-spacing: -1px; line-height: 1; margin-bottom: 4px; }
  .mob-nfc-stat-day { font-size: 22px; }
  .mob-nfc-stat-lbl { font-size: 10px; color: #9AB89A; font-weight: 500; margin-bottom: 5px; line-height: 1.3; }
  .mob-nfc-stat-delta { font-size: 10px; font-weight: 700; line-height: 1.2; }
  .mob-nfc-stat-delta.up { color: #388E3C; }
  .mob-nfc-stat-delta.down { color: #e53935; }
  .mob-nfc-stat-delta.neutral { color: #9AB89A; }

  /* ── Gadget list ── */
  .mob-nfc-empty-state {
    margin: 0 16px; background: #fff; border-radius: 20px; border: 1.5px solid #C8E6C9;
    padding: 28px 20px; text-align: center;
  }
  .mob-nfc-empty-icon { font-size: 32px; margin-bottom: 10px; }
  .mob-nfc-empty-title { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 16px; font-weight: 800; color: #1A2E1A; margin-bottom: 6px; }
  .mob-nfc-empty-sub { font-size: 13px; color: #9AB89A; margin-bottom: 16px; }
  .mob-nfc-empty-btn {
    display: inline-block; background: linear-gradient(135deg,#388E3C,#4CAF50); color: #fff;
    padding: 10px 22px; border-radius: 12px; font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 13px; font-weight: 700; text-decoration: none;
  }

  /* ── Gadget batch cards ── */
  .mob-nfc-batch-list { display: flex; flex-direction: column; gap: 12px; margin: 0 16px; padding-bottom: 8px; }
  .mob-nfc-batch-row { border-radius: 20px; overflow: hidden; box-shadow: 0 2px 14px rgba(56,142,60,.07); }
  .mob-nfc-batch-row.mob-nfc-batch-open .mob-nfc-batch-card { border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-bottom-color: transparent; }

  /* Card (always visible) */
  .mob-nfc-batch-card { background: #fff; border: 1.5px solid #C8E6C9; border-radius: 20px; padding: 16px; }
  .mob-nfc-batch-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 10px; }
  .mob-nfc-batch-main { flex: 1; min-width: 0; }
  .mob-nfc-batch-name { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 16px; font-weight: 800; color: #1A2E1A; margin-bottom: 3px; }
  .mob-nfc-batch-url  { font-size: 12px; color: #9AB89A; word-break: break-all; line-height: 1.4; }
  .mob-nfc-batch-icon { font-size: 22px; margin-left: 8px; flex-shrink: 0; }

  /* Pills */
  .mob-nfc-batch-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
  .mob-nfc-pill       { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 20px; }
  .mob-nfc-pill-chip  { background: rgba(76,175,80,.1);  border: 1.5px solid rgba(76,175,80,.35); color: #2E7D32; }
  .mob-nfc-pill-id    { background: #388E3C;             border: 1.5px solid #388E3C;             color: #fff; }
  .mob-nfc-pill-free  { background: #F4FAF4;             border: 1.5px solid #C8E6C9;             color: #5A7A5A; }
  .mob-nfc-pill-scan  { background: rgba(255,160,0,.12); border: 1.5px solid rgba(255,160,0,.4);  color: #E65100; }

  /* Action buttons */
  .mob-nfc-batch-btns { display: flex; gap: 10px; }
  .mob-nfc-batch-btn  {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 8px; background: #fff; border: 1.5px solid #C8E6C9; border-radius: 14px;
    font-family: 'Plus Jakarta Sans', sans-serif; font-size: 12px; font-weight: 700; color: #1A2E1A;
    cursor: pointer; transition: background .15s, border-color .15s;
  }
  .mob-nfc-batch-btn:active { background: #F4FAF4; }
  .mob-nfc-batch-btn-stat { color: #388E3C; border-color: rgba(76,175,80,.4); }

  /* Expanded body */
  .mob-nfc-batch-body { border: 1.5px solid #C8E6C9; border-top: none; border-radius: 0 0 20px 20px; padding: 14px 16px; background: #FAFDF9; display: flex; flex-direction: column; gap: 12px; }
  .mob-nfc-batch-loading { font-size: 12px; color: #9AB89A; text-align: center; padding: 12px 0; }
  .mob-nfc-chip-list { display: flex; flex-direction: column; gap: 10px; }
  .mob-nfc-chip-empty { font-size: 12px; color: #9AB89A; text-align: center; padding: 10px 0; }

  .mob-nfc-chip-group { background: #F4FAF4; border-radius: 12px; padding: 12px; border: 1px solid #C8E6C9; }
  .mob-nfc-chip-group-title { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 12px; font-weight: 800; color: #1A2E1A; margin-bottom: 3px; }
  .mob-nfc-chip-meta { font-size: 11px; color: #9AB89A; margin-bottom: 10px; }
  .mob-nfc-chip-url-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: #9AB89A; margin-bottom: 5px; }
  .mob-nfc-chip-url-edit { margin-top: 8px; }
  .mob-nfc-chip-url-input { flex: 1; background: #fff; border: 1.5px solid #C8E6C9; border-radius: 10px; padding: 8px 10px; font-size: 12px; color: #1A2E1A; outline: none; min-width: 0; }
  .mob-nfc-chip-url-input:focus { border-color: #4CAF50; }
  .mob-nfc-chip-save-btn { background: #388E3C; color: #fff; border: none; padding: 8px 14px; border-radius: 10px; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; }

  .mob-nfc-chip-row { background: #fff; border-radius: 12px; padding: 12px; border: 1px solid #C8E6C9; }
  .mob-nfc-chip-row-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
  .mob-nfc-chip-serial { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 12px; font-weight: 700; color: #1A2E1A; }
  .mob-nfc-chip-badge { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 20px; }
  .mob-nfc-chip-badge.active { background: rgba(76,175,80,.15); color: #388E3C; border: 1px solid rgba(76,175,80,.3); }
  .mob-nfc-chip-badge.off    { background: rgba(156,163,175,.15); color: #9ca3af; border: 1px solid rgba(156,163,175,.3); }
  .mob-nfc-chip-contact { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
  .mob-nfc-chip-contact-name { font-size: 12px; font-weight: 600; color: #388E3C; }
  .mob-nfc-chip-contact-detail { font-size: 11px; color: #9AB89A; }

  /* Toggle switch */
  .mob-nfc-toggle-wrap { display: flex; align-items: center; gap: 8px; }
  .mob-nfc-toggle-lbl  { font-size: 11px; font-weight: 600; color: #5A7A5A; }
  .mob-nfc-toggle { position: relative; width: 40px; height: 22px; flex-shrink: 0; }
  .mob-nfc-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
  .mob-nfc-toggle-slider {
    position: absolute; inset: 0; background: #C8E6C9; border-radius: 22px;
    cursor: pointer; transition: background .2s;
  }
  .mob-nfc-toggle-slider::before {
    content: ''; position: absolute; width: 16px; height: 16px; border-radius: 50%;
    background: #fff; left: 3px; top: 3px; transition: transform .2s;
    box-shadow: 0 1px 4px rgba(0,0,0,.2);
  }
  .mob-nfc-toggle input:checked + .mob-nfc-toggle-slider { background: #4CAF50; }
  .mob-nfc-toggle input:checked + .mob-nfc-toggle-slider::before { transform: translateX(18px); }

  /* Chip rows inside batch body */
  .mob-nfc-chip-item {
    background: #fff; border-radius: 14px; border: 1.5px solid #C8E6C9; padding: 12px 14px;
  }
  .mob-nfc-chip-item-top {
    display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px;
  }
  .mob-nfc-chip-item-left { flex: 1; min-width: 0; }
  .mob-nfc-chip-top-right {
    display: inline-flex; align-items: center; gap: 10px; margin-left: 12px;
    flex: 0 0 auto; flex-wrap: nowrap; white-space: nowrap; width: max-content;
  }
  .mob-nfc-chip-mode-toggle { min-width: 260px; max-width: 520px; flex: 0 0 auto; }
  .mob-nfc-chip-input-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: nowrap; width: 100%; }
  .mob-nfc-chip-name { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 13px; font-weight: 800; color: #1A2E1A; margin-bottom: 2px; }
  .mob-nfc-chip-sub  { font-size: 11px; color: #9AB89A; }

  /* Unidentified group header */
  .mob-nfc-unid-group { background: #F4FAF4; border-radius: 14px; border: 1.5px solid #C8E6C9; padding: 12px 14px; }
  .mob-nfc-unid-top  { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
  .mob-nfc-unid-title { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 13px; font-weight: 800; color: #1A2E1A; }
  .mob-nfc-unid-sub   { font-size: 11px; color: #9AB89A; margin-top: 1px; }

  /* ── NFC Stats Modal (bottom sheet) ── */
  .mob-nfc-stats-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 3000;
    display: none; align-items: flex-end; justify-content: center;
    backdrop-filter: blur(2px);
  }
  .mob-nfc-stats-modal {
    background: #fff; border-radius: 28px 28px 0 0; width: 100%; max-width: 480px;
    padding: 12px 20px 32px; max-height: 80vh; overflow-y: auto;
    animation: mobSlideUp .25s ease;
  }
  @keyframes mobSlideUp {
    from { transform: translateY(40px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
  }
  .mob-nfc-stats-modal-handle {
    width: 36px; height: 4px; background: #C8E6C9; border-radius: 4px;
    margin: 0 auto 18px;
  }
  .mob-nfc-stats-modal-hdr { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 6px; }
  .mob-nfc-stats-modal-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: #9AB89A; margin-bottom: 3px; }
  .mob-nfc-stats-modal-title { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 20px; font-weight: 800; color: #1A2E1A; line-height: 1.2; }
  .mob-nfc-stats-modal-close {
    width: 32px; height: 32px; border-radius: 50%; background: #F4FAF4;
    border: 1.5px solid #C8E6C9; font-size: 13px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; color: #5A7A5A;
    flex-shrink: 0; margin-left: 12px; margin-top: 2px;
  }
  .mob-nfc-stats-url {
    font-size: 12px; color: #9AB89A; margin-bottom: 20px; word-break: break-all; line-height: 1.4;
  }
  .mob-nfc-stats-kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
  .mob-nfc-stats-kpi {
    background: #F4FAF4; border-radius: 18px; padding: 18px 14px;
    border: 1.5px solid #C8E6C9; text-align: center;
  }
  .mob-nfc-stats-kpi-id   { background: rgba(56,142,60,.06); border-color: rgba(76,175,80,.3); }
  .mob-nfc-stats-kpi-scan { background: rgba(255,160,0,.06); border-color: rgba(255,160,0,.3); }
  .mob-nfc-stats-kpi-val {
    font-family: 'Georgia', serif; font-size: 38px; font-style: italic; font-weight: 700;
    color: #1A2E1A; letter-spacing: -1.5px; line-height: 1; margin-bottom: 6px;
  }
  .mob-nfc-stats-kpi-id   .mob-nfc-stats-kpi-val { color: #388E3C; }
  .mob-nfc-stats-kpi-scan .mob-nfc-stats-kpi-val { color: #E65100; }
  .mob-nfc-stats-kpi-lbl { font-size: 11px; color: #9AB89A; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
  .mob-nfc-stats-manage-btn {
    width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 14px; background: linear-gradient(135deg, #1A2E1A, #2D5A2D);
    color: #fff; border: none; border-radius: 16px; font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 14px; font-weight: 700; cursor: pointer;
    box-shadow: 0 4px 16px rgba(26,46,26,.25);
  }

  /* ── FIDELITY MOBILE ── */
  #nfc-panel-fidelity > *:not(.mob-fid):not(#mobFidAssignOverlay) { display: none !important; }

  .mob-fid { display: flex; flex-direction: column; gap: 0; padding-bottom: 32px; }

  /* Upsell */
  .mob-fid-upsell { margin: 16px 16px 0; background: #fff; border-radius: 20px; border: 1.5px solid #F5E6C8; padding: 28px 20px; text-align: center; }
  .mob-fid-upsell-icon { font-size: 40px; margin-bottom: 12px; }
  .mob-fid-upsell-title { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 18px; font-weight: 800; color: #1A2E1A; margin-bottom: 8px; }
  .mob-fid-upsell-sub { font-size: 13px; color: #7A7A7A; line-height: 1.5; margin-bottom: 20px; }
  .mob-fid-upsell-btn { display: inline-block; padding: 12px 24px; background: linear-gradient(135deg, #F5A623, #E8920A); color: #fff; border-radius: 14px; font-family: 'Plus Jakarta Sans', sans-serif; font-size: 14px; font-weight: 700; text-decoration: none; }

  /* Setup card */
  .mob-fid-setup-card { margin: 0 16px; background: #fff; border-radius: 20px; border: 1.5px solid #F5E6C8; padding: 20px; }
  .mob-fid-setup-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 20px; }
  .mob-fid-setup-icon { font-size: 36px; flex-shrink: 0; }
  .mob-fid-setup-title { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 16px; font-weight: 800; color: #1A2E1A; margin-bottom: 4px; }
  .mob-fid-setup-sub { font-size: 12px; color: #9AB89A; line-height: 1.5; }

  /* Euro inline row */
  .mob-fid-euro-row { display: flex; align-items: center; gap: 10px; }
  .mob-fid-euro-inp { flex: 1; }
  .mob-fid-euro-lbl { font-size: 13px; font-weight: 700; color: #B8862A; white-space: nowrap; }

  /* Blurred preview (no-program state) */
  .mob-fid-preview-blur { position: relative; display: flex; flex-direction: column; gap: 0; }
  .mob-fid-preview-blur > * { pointer-events: none; }
  .mob-fid-preview-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 5; background: rgba(255,253,247,.55); backdrop-filter: blur(1px); }
  .mob-fid-preview-msg { background: #fff; border-radius: 20px; border: 1.5px solid #F5E6C8; padding: 24px 20px; text-align: center; box-shadow: 0 8px 32px rgba(245,166,35,.18); max-width: 260px; }

  /* Type toggle (points/stamps) */
  .mob-fid-type-toggle { display: flex; border-radius: 12px; overflow: hidden; border: 1.5px solid #F5E6C8; margin-bottom: 16px; }
  .mob-fid-type-btn { flex: 1; padding: 10px 6px; background: #fff; border: none; cursor: pointer; font-size: 12px; font-weight: 700; color: #B8862A; font-family: 'Plus Jakarta Sans', sans-serif; }
  .mob-fid-type-btn.active { background: linear-gradient(135deg, #F5A623, #E8920A); color: #fff; }

  /* Form elements */
  .mob-fid-lbl { display: block; font-size: 11px; font-weight: 700; color: #9AB89A; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; margin-top: 14px; }
  .mob-fid-inp { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1.5px solid #E8D5A8; font-size: 14px; color: #1A2E1A; background: #FFFDF7; box-sizing: border-box; outline: none; }
  .mob-fid-inp:focus { border-color: #F5A623; }
  .mob-fid-continua { width: 100%; margin-top: 20px; padding: 14px; background: linear-gradient(135deg, #F5A623, #E8920A); color: #fff; border: none; border-radius: 14px; font-family: 'Plus Jakarta Sans', sans-serif; font-size: 15px; font-weight: 800; cursor: pointer; box-shadow: 0 4px 16px rgba(245,166,35,.35); }
  .mob-fid-save-btn { width: 100%; margin-top: 16px; padding: 12px; background: #fff; border: 1.5px solid #E8D5A8; color: #B8862A; border-radius: 12px; font-family: 'Plus Jakarta Sans', sans-serif; font-size: 13px; font-weight: 700; cursor: pointer; }
  .mob-fid-save-btn:active { background: #FFFDF7; }

  /* Hero — gold gradient */
  .mob-fid-hero { margin: 16px 16px 0; background: linear-gradient(135deg, #F5A623 0%, #E8920A 100%); border-radius: 20px; padding: 20px; position: relative; overflow: hidden; }
  .mob-fid-hero::before { content: ''; position: absolute; width: 180px; height: 180px; border-radius: 50%; background: rgba(26,46,26,0.20); top: -70px; right: -50px; }
  .mob-fid-hero-lbl { font-size: 10px; font-weight: 700; color: rgba(255,255,255,.7); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
  .mob-fid-hero-top { margin-bottom: 20px; }
  .mob-fid-hero-title { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 22px; font-weight: 800; color: #fff; margin-bottom: 4px; line-height: 1.2; }
  .mob-fid-hero-prog { font-size: 12px; color: rgba(255,255,255,.8); }
  .mob-fid-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
  .mob-fid-stat { background: rgba(255,255,255,.2); border-radius: 14px; padding: 10px 8px; text-align: center; }
  .mob-fid-stat-val { font-family: 'Georgia', serif; font-size: 26px; font-style: italic; font-weight: 700; color: #fff; line-height: 1; margin-bottom: 3px; }
  .mob-fid-stat-lbl { font-size: 10px; color: rgba(255,255,255,.75); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }

  /* Assegna punti */
  .mob-fid-assign-card { margin: 0 16px; background: #fff; border-radius: 20px; border: 1.5px solid #F5E6C8; padding: 16px; }
  .mob-fid-assign-title { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 15px; font-weight: 800; color: #1A2E1A; margin-bottom: 4px; }
  .mob-fid-assign-sub { font-size: 12px; color: #9AB89A; margin-bottom: 14px; line-height: 1.5; }
  .mob-fid-assign-row { display: flex; gap: 8px; }
  .mob-fid-scan-btn { flex-shrink: 0; padding: 10px 14px; background: linear-gradient(135deg, #388E3C, #2E7D32); color: #fff; border: none; border-radius: 12px; font-family: 'Plus Jakarta Sans', sans-serif; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; }
  .mob-fid-scan-btn-full { width: 100%; justify-content: center; }
  .mob-fid-search-inp { flex: 1; min-width: 0; padding: 10px 14px; border-radius: 12px; border: 1.5px solid #E8D5A8; font-size: 13px; color: #1A2E1A; background: #FFFDF7; outline: none; box-sizing: border-box; }
  .mob-fid-search-inp:focus { border-color: #F5A623; }

  /* Blurred "In arrivo" wrapper — temporaneamente nascosto */
  .mob-fid-blurred-wrap { display: none; }
  /* .mob-fid-blurred-wrap { margin: 0 16px; position: relative; border-radius: 20px; overflow: hidden; } */
  .mob-fid-blurred-content { filter: blur(4px); pointer-events: none; user-select: none; }
  .mob-fid-voucher-card { background: #fff; border-radius: 20px; border: 1.5px solid #F5E6C8; padding: 16px; }
  .mob-fid-voucher-title { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 15px; font-weight: 800; color: #1A2E1A; margin-bottom: 12px; }
  .mob-fid-voucher-row { display: flex; gap: 8px; }
  .mob-fid-voucher-inp { flex: 1; padding: 10px 14px; border-radius: 12px; border: 1.5px solid #E8D5A8; font-size: 13px; color: #9AB89A; background: #FFFDF7; }
  .mob-fid-voucher-btn { padding: 10px 14px; background: #4CAF50; color: #fff; border: none; border-radius: 12px; font-size: 12px; font-weight: 700; }
  .mob-fid-blur-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 2; background: rgba(255,253,247,.25); }
  .mob-fid-soon { display: inline-block; padding: 7px 16px; background: linear-gradient(135deg, #F5A623, #E8920A); color: #fff; border-radius: 20px; font-family: 'Plus Jakarta Sans', sans-serif; font-size: 12px; font-weight: 800; letter-spacing: .5px; box-shadow: 0 4px 16px rgba(245,166,35,.4); }

  /* Section header with link */
  .mob-fid-sh { display: flex; align-items: center; justify-content: space-between; padding: 20px 16px 8px; }
  .mob-fid-sh-link { font-size: 12px; font-weight: 700; color: #B8862A; cursor: pointer; }

  /* Clients card */
  .mob-fid-clients-card { margin: 0 16px; background: #fff; border-radius: 20px; border: 1.5px solid #F5E6C8; padding: 14px 16px; }
  .mob-fid-client-search-row { display: flex; gap: 8px; margin-bottom: 14px; }
  .mob-fid-client-search { flex: 1; padding: 10px 14px; border-radius: 12px; border: 1.5px solid #E8D5A8; font-size: 13px; color: #1A2E1A; background: #FFFDF7; outline: none; }
  .mob-fid-client-search:focus { border-color: #F5A623; }
  .mob-fid-client-filter { padding: 10px 10px; border-radius: 12px; border: 1.5px solid #E8D5A8; font-size: 12px; color: #B8862A; background: #FFFDF7; outline: none; font-weight: 700; }

  /* Empty state */
  .mob-fid-empty { text-align: center; padding: 24px 0; }
  .mob-fid-empty-icon { font-size: 36px; margin-bottom: 10px; }
  .mob-fid-empty-title { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 14px; font-weight: 800; color: #1A2E1A; margin-bottom: 4px; }
  .mob-fid-empty-sub { font-size: 12px; color: #9AB89A; line-height: 1.5; }

  /* Pulsante assegna rapido su ogni riga */
  .mob-fid-assign-quick { width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, #F5A623, #E8920A); color: #fff; border: none; font-size: 18px; font-weight: 300; line-height: 1; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; box-shadow: 0 2px 8px rgba(245,166,35,.4); }

  /* Modal assegna punti (bottom sheet) */
  .mob-fid-assign-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 3000; display: flex; align-items: flex-end; justify-content: center; backdrop-filter: blur(2px); }
  .mob-fid-assign-modal { background: #fff; border-radius: 28px 28px 0 0; width: 100%; max-width: 480px; padding: 12px 20px 40px; animation: mobSlideUp .22s ease-out; }
  .mob-fid-assign-modal-hdr { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 16px; }
  .mob-fid-assign-modal-name { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 18px; font-weight: 800; color: #1A2E1A; }
  .mob-fid-assign-modal-pts { font-size: 12px; color: #9AB89A; margin-top: 2px; }

  /* Member list */
  .mob-fid-member-list { display: flex; flex-direction: column; gap: 2px; }
  .mob-fid-member-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #F5E6C8; }
  .mob-fid-member-row:last-child { border-bottom: none; }
  .mob-fid-member-avatar { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, #F5A623, #E8920A); display: flex; align-items: center; justify-content: center; font-family: 'Plus Jakarta Sans', sans-serif; font-size: 16px; font-weight: 800; color: #fff; flex-shrink: 0; }
  .mob-fid-notify-bell { width: 38px; height: 38px; border-radius: 10px; background: #FFFDF7; border: 1.5px solid #E8D5A8; color: #B8862A; font-size: 17px; line-height: 1; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; padding: 0; }
  .mob-fid-member-info { flex: 1; min-width: 0; }
  .mob-fid-member-name { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 13px; font-weight: 700; color: #1A2E1A; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mob-fid-member-sub { font-size: 11px; color: #9AB89A; margin-top: 1px; }
  .mob-fid-member-pts { font-family: 'Georgia', serif; font-size: 16px; font-style: italic; font-weight: 700; color: #E8920A; white-space: nowrap; }

  /* Gestisci accordion */
  .mob-fid-manage-card { margin: 0 16px; background: #fff; border-radius: 20px; border: 1.5px solid #F5E6C8; overflow: hidden; }
  .mob-fid-acc-item { border-bottom: 1px solid #F5E6C8; }
  .mob-fid-acc-item:last-child { border-bottom: none; }
  .mob-fid-acc-hdr { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; cursor: pointer; }
  .mob-fid-acc-hdr:active { background: #FFFDF7; }
  .mob-fid-acc-hl { display: flex; align-items: center; gap: 12px; }
  .mob-fid-acc-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
  .mob-fid-acc-title { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 13px; font-weight: 800; color: #1A2E1A; margin-bottom: 1px; }
  .mob-fid-acc-sub { font-size: 11px; color: #9AB89A; }
  .mob-fid-acc-chev { font-size: 14px; color: #B8862A; transition: transform .2s; flex-shrink: 0; }
  .mob-fid-acc-item.open .mob-fid-acc-chev { transform: rotate(180deg); }
  .mob-fid-acc-body { display: none; }
  .mob-fid-acc-item.open .mob-fid-acc-body { display: block; }
  .mob-fid-acc-inner { padding: 0 16px 16px; }

  /* Wallet card preview */
  .mob-fid-card-preview { margin: 4px 0 20px; border-radius: 18px; overflow: hidden; box-shadow: 0 8px 28px rgba(0,0,0,.18); }
  .mob-fid-card-inner { border-radius: 18px; padding: 18px 20px 16px; display: flex; flex-direction: column; gap: 10px; position: relative; overflow: hidden; transition: background .3s; }
  /* Header: logo box + name + sub */
  .mob-fid-card-header { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
  .mob-fid-card-logo-box { width: 44px; height: 44px; border-radius: 10px; background: rgba(255,255,255,.2); display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; }
  .mob-fid-card-logo-img { width: 44px; height: 44px; object-fit: contain; border-radius: 10px; }
  .mob-fid-card-logo-placeholder { font-size: 24px; line-height: 1; }
  .mob-fid-card-name { font-size: 15px; font-weight: 800; color: #fff; font-family: 'Plus Jakarta Sans', sans-serif; line-height: 1.2; }
  .mob-fid-card-sub  { font-size: 12px; color: rgba(255,255,255,.75); font-weight: 400; margin-top: 2px; }
  /* Balance */
  .mob-fid-card-bal-lbl { font-size: 11px; font-weight: 700; color: rgba(255,255,255,.75); letter-spacing: .8px; text-transform: uppercase; position: relative; z-index: 1; }
  .mob-fid-card-bal-val { font-size: 30px; font-weight: 800; color: #fff; font-family: 'Plus Jakarta Sans', sans-serif; line-height: 1; position: relative; z-index: 1; }
  /* Premi */
  .mob-fid-card-rewards-row { position: relative; z-index: 1; }
  .mob-fid-card-rewards-lbl { font-size: 11px; color: rgba(255,255,255,.7); font-weight: 600; }
  .mob-fid-card-rewards-val { font-size: 13px; color: #fff; font-weight: 600; }

  /* Blurred accordion item */
  .mob-fid-blurred-acc { opacity: .65; }
  .mob-fid-soon-inline { display: inline-block; padding: 3px 10px; background: linear-gradient(135deg, #F5A623, #E8920A); color: #fff; border-radius: 10px; font-size: 10px; font-weight: 800; letter-spacing: .3px; white-space: nowrap; flex-shrink: 0; }

  /* Premi (rewards) */
  .mob-fid-premio-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #F5E6C8; }
  .mob-fid-premio-row:last-of-type { border-bottom: none; }
  .mob-fid-premio-e { font-size: 22px; flex-shrink: 0; }
  .mob-fid-premio-name { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 13px; font-weight: 700; color: #1A2E1A; }
  .mob-fid-premio-pts { font-size: 11px; color: #B8862A; font-weight: 600; margin-top: 1px; }
  .mob-fid-add-btn { width: 100%; margin-top: 12px; padding: 11px; border: 1.5px dashed #E8D5A8; background: #FFFDF7; color: #B8862A; border-radius: 12px; font-family: 'Plus Jakarta Sans', sans-serif; font-size: 13px; font-weight: 700; cursor: pointer; }

  /* Strumenti avanzati — spaziatura e lista */
  .mob-fid-adv-wrap { margin-top: 20px !important; }
  .mob-fid-adv-list { padding: 0 0 4px; }
  .mob-fid-adv-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid #F5E6C8; opacity: .6; }
  .mob-fid-adv-item:first-child { border-top: none; }
  .mob-fid-adv-icon { font-size: 22px; flex-shrink: 0; width: 36px; text-align: center; }
  .mob-fid-adv-info { flex: 1; min-width: 0; }
  .mob-fid-adv-title { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 13px; font-weight: 700; color: #1A2E1A; margin-bottom: 2px; }
  .mob-fid-adv-sub { font-size: 11px; color: #9AB89A; }
  .mob-fid-new-badge { display: inline-block; padding: 1px 6px; background: #4CAF50; color: #fff; border-radius: 6px; font-size: 9px; font-weight: 800; vertical-align: middle; margin-left: 3px; }

  /* ── SEZIONE PAGINE (mobile) ───────────────────────────────── */
  #view-pages {
    padding: 0 0 32px;
  }
  /* Header */
  #view-pages > div:first-child {
    background: linear-gradient(135deg, #1A2E1A 0%, #2D5A2D 55%, #1E4020 100%);
    border-radius: 0 0 28px 28px;
    padding: 20px 20px 24px;
    margin-bottom: 20px !important;
  }
  #view-pages h2 {
    color: #fff !important;
    font-size: 20px !important;
  }
  #view-pages .mob-pages-count {
    color: rgba(255,255,255,.65) !important;
    font-size: 12px !important;
  }
  /* Collega pagina esterna button */
  .mob-ext-page-btn {
    background: rgba(26,46,26,0.15) !important;
    border: 1px solid rgba(255,255,255,.25) !important;
    box-shadow: none !important;
    border-radius: 12px !important;
    font-size: 12px !important;
    padding: 9px 16px !important;
  }
  /* Card grid: single column on mobile */
  #view-pages .pages-cards-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
    padding: 0 16px !important;
  }
  /* Card */
  #view-pages .page-preview-card {
    border-radius: 20px !important;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(26,46,26,.08);
  }
  #view-pages .ppc-preview-wrap {
    border-color: #D8EDD8 !important;
    background: #F4FAF4 !important;
  }
  /* Footer */
  #view-pages .ppc-footer {
    background: #fff !important;
    border-color: #D8EDD8 !important;
    border-top: 1px solid #D8EDD8 !important;
    border-radius: 0 0 20px 20px !important;
  }
  #view-pages .ppc-footer > div:first-child {
    color: #1A2E1A !important;
  }
  #view-pages .ppc-footer > div:nth-child(2) {
    color: #9AB89A !important;
  }
  /* Modifica button → green */
  #view-pages .ppc-edit-link {
    background: #4CAF50 !important;
    border-radius: 12px !important;
  }
  /* Rename button (purple → green outline) */
  #view-pages .ppc-footer button[title="Rinomina pagina e URL"] {
    background: rgba(76,175,80,.08) !important;
    border-color: rgba(76,175,80,.3) !important;
    color: #388E3C !important;
    border-radius: 12px !important;
  }
  /* Copy button (purple → green outline) */
  #view-pages .ppc-footer button[title="Copia link tracciato"] {
    background: rgba(76,175,80,.08) !important;
    border-color: rgba(76,175,80,.3) !important;
    color: #388E3C !important;
    border-radius: 12px !important;
  }
  /* Delete button stays red, but round */
  #view-pages .ppc-footer button[title="Elimina pagina"] {
    border-radius: 12px !important;
  }
  /* Visit link → green outline */
  #view-pages .ppc-footer a[target="_blank"] {
    background: rgba(76,175,80,.08) !important;
    border-color: rgba(76,175,80,.3) !important;
    color: #388E3C !important;
    border-radius: 12px !important;
  }
  /* Empty state */
  #view-pages .pages-cards-grid ~ div,
  #view-pages > div:last-child {
    color: #5A7A5A;
  }

} /* end @media ≤768px */

/* Desktop: nascondi elementi mobile-only */
@media (min-width: 901px) {
  .mob-page-tabs  { display: none !important; }
  .mob-bottom-nav { display: none !important; }
  .mob-home       { display: none !important; }
  .mob-analytics  { display: none !important; }
  .mob-nfc               { display: none !important; }
  .mob-nfc-stats-overlay { display: none !important; }
  .mob-fid               { display: none !important; }
  .mob-crm-wrap          { display: none !important; }
}

/* Override: popup stats NFC visibile su desktop quando aperto via JS */
#mobNfcStatsOverlay.stats-open { display: flex !important; }

/* Override: modal assegna punti visibile su desktop */
@media (min-width: 901px) {
  #mobFidAssignOverlay[style*="flex"] {
    position: fixed !important;
    inset: 0 !important;
    background: rgba(0,0,0,.5) !important;
    z-index: 3000 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    backdrop-filter: blur(2px) !important;
  }
  #mobFidAssignOverlay .mob-fid-assign-modal {
    background: #fff !important;
    border-radius: 20px !important;
    width: 100% !important;
    max-width: 440px !important;
    padding: 24px !important;
    animation: none !important;
  }
}

/* Modal notifica singolo membro — fuori da @media ≤900px (altrimenti su desktop manca display:none → sempre visibile) */
#fidMemberNotifyModal.fid-member-notify-overlay {
  position: fixed;
  inset: 0;
  z-index: 9200;
  background: rgba(26, 46, 26, 0.42);
  backdrop-filter: blur(6px);
  display: none !important;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}
#fidMemberNotifyModal.fid-member-notify-overlay.is-open {
  display: flex !important;
}
.fid-member-notify-card {
  background: #fff;
  border: 1.5px solid #C8E6C9;
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(26, 46, 26, 0.14);
  padding: 22px 24px 26px;
  max-width: 420px;
  width: 100%;
  max-height: min(92vh, 640px);
  overflow-y: auto;
  box-sizing: border-box;
}
.fid-member-notify-hdr {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid #E8F5E9;
}
.fid-member-notify-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #388E3C;
  margin-bottom: 4px;
}
.fid-member-notify-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: #1A2E1A;
  line-height: 1.25;
}
.fid-member-notify-close {
  background: #F4FAF4;
  border: 1.5px solid #C8E6C9;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  color: #5A7A5A;
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.fid-member-notify-close:hover {
  background: #E8F5E9;
  border-color: #A5D6A7;
  color: #2E7D32;
}
.fid-member-notify-lbl {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #5A7A5A;
  margin-bottom: 6px;
}
.fid-member-notify-inp {
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1.5px solid #C8E6C9;
  font-size: 14px;
  color: #1A2E1A;
  background: #FAFDF9;
  outline: none;
  box-sizing: border-box;
  font-family: 'DM Sans', sans-serif;
}
.fid-member-notify-inp:focus {
  border-color: #4CAF50;
  background: #fff;
}
.fid-member-notify-ch-wrap { display: flex; gap: 16px; flex-wrap: wrap; margin: 14px 0 18px; }
.fid-member-notify-ch-wrap label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #1A2E1A; cursor: pointer; }
.fid-member-notify-submit {
  width: 100%;
  margin-top: 4px;
  padding: 14px;
  background: linear-gradient(135deg, #388E3C, #2E7D32);
  color: #fff;
  border: none;
  border-radius: 14px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(56, 142, 60, 0.28);
}
.fid-member-notify-submit:hover:not(:disabled) {
  filter: brightness(1.03);
}
.fid-member-notify-submit:disabled { opacity: 0.55; cursor: not-allowed; }
.fid-member-notify-result { margin-top: 12px; font-size: 13px; text-align: center; line-height: 1.45; }

/* ── MOBILE SCAN MODAL — NFC animation ──────────────────── */
.mob-scan-anim-wrap {
  position: relative;
  width: 100px;
  height: 100px;
  margin: 0 auto;
}
.mob-scan-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2.5px solid #4CAF50;
  animation: mobScanPulse 2s ease-out infinite;
  opacity: 0;
}
.mob-scan-ring.r1 { animation-delay: 0s; }
.mob-scan-ring.r2 { inset: -14px; animation-delay: 0.55s; }
.mob-scan-ring.r3 { inset: -28px; animation-delay: 1.1s; }
.mob-scan-icon-box {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
}
@keyframes mobScanPulse {
  0%   { opacity: 0.9; transform: scale(0.75); }
  100% { opacity: 0;   transform: scale(1.5); }
}

/* ═══════════════════════════════════════════════════════════
   MOBILE POPUP REDESIGN — bottom sheet + green theme
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* ── Overlay: bottom-align ──────────────────────────────── */
  #renameModal,
  #fidRewardModal,
  #fidAssignOverlay,
  #fidHistoryModal,
  #nfcQRModal,
  #modalExternalPage,
  #modalEditExternalPage,
  #dash-fb-modal,
  .qr-modal-overlay {
    align-items: flex-end !important;
    padding: 0 !important;
  }

  /* ── Inner box: bottom sheet ───────────────────────────── */
  #renameModal > div,
  #fidRewardModal > div,
  #fidAssignOverlay > div[onclick],
  #fidHistoryModal > div,
  #nfcQRModal > div,
  #modalExternalPage > div,
  #modalEditExternalPage > div,
  #dash-fb-modal > div,
  .qr-modal {
    border-radius: 24px 24px 0 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    max-height: 88vh;
    overflow-y: auto;
    padding-top: 6px !important;
    box-shadow: 0 -6px 32px rgba(0,0,0,.15) !important;
  }

  /* ── Handle pill ──────────────────────────────────────────*/
  #renameModal > div::before,
  #fidRewardModal > div::before,
  #fidAssignOverlay > div[onclick]::before,
  #fidHistoryModal > div::before,
  #nfcQRModal > div::before,
  #modalExternalPage > div::before,
  #modalEditExternalPage > div::before,
  #dash-fb-modal > div::before,
  .qr-modal::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    background: #D8EDD8;
    border-radius: 2px;
    margin: 12px auto 8px;
  }

  /* ── Padding within boxes ────────────────────────────────── */
  #renameModal > div,
  #fidRewardModal > div {
    padding: 6px 22px 32px !important;
  }
  #modalExternalPage > div,
  #modalEditExternalPage > div {
    padding: 6px 22px 32px !important;
  }
  #dash-fb-modal > div {
    padding: 6px 20px 32px !important;
  }
  .qr-modal {
    padding: 6px 24px 32px !important;
  }

  /* ── Primary buttons → green ─────────────────────────────── */
  #renameSaveBtn {
    background: linear-gradient(135deg, #388E3C, #4CAF50) !important;
    border-radius: 14px !important;
    padding: 13px !important;
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 14px !important;
  }
  #fidRewardModal button[onclick*="fidAddReward"] {
    background: linear-gradient(135deg, #388E3C, #4CAF50) !important;
    border-radius: 14px !important;
  }
  #modalExternalPage button[onclick*="createExternalPage"] {
    background: linear-gradient(135deg, #388E3C, #4CAF50) !important;
    border-radius: 14px !important;
    padding: 14px !important;
  }
  #modalEditExternalPage button[onclick*="saveEditExternalPage"] {
    background: linear-gradient(135deg, #388E3C, #4CAF50) !important;
    border-radius: 14px !important;
    padding: 14px !important;
  }
  #dash-fb-modal button[onclick*="dashFbSave"] {
    background: linear-gradient(135deg, #388E3C, #4CAF50) !important;
    border-radius: 14px !important;
  }
  .qr-action-save {
    background: linear-gradient(135deg, #388E3C, #4CAF50) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 14px !important;
    padding: 11px 20px !important;
  }
  .qr-action-share {
    border-radius: 14px !important;
    border-color: #D8EDD8 !important;
    color: #388E3C !important;
    padding: 11px 20px !important;
  }
  #nfcQRModal button {
    border-radius: 12px !important;
    border-color: #D8EDD8 !important;
    color: #5A7A5A !important;
    font-size: 12px !important;
  }

  /* ── Cancel buttons ─────────────────────────────────────── */
  #renameModal button[onclick*="closeRename"],
  #fidRewardModal button[onclick*="fidCloseReward"],
  #modalExternalPage button[onclick*="display='none'"],
  #modalEditExternalPage button[onclick*="display='none'"],
  #dash-fb-modal button[onclick*="dashFbClose"],
  #fidHistoryModal button[onclick*="fidCloseHistory"] {
    border-radius: 14px !important;
    border: 1.5px solid #D8EDD8 !important;
    color: #5A7A5A !important;
    padding: 13px !important;
  }
  /* Close ✕ buttons */
  #renameModal button[onclick*="closeRename"]:not([style*="flex:1"]),
  .qr-modal-close {
    background: #F4FAF4 !important;
    border: 1px solid #D8EDD8 !important;
    border-radius: 50% !important;
    color: #5A7A5A !important;
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 14px !important;
    padding: 0 !important;
  }

  /* ── Input focus → green ────────────────────────────────── */
  #renameModal input:focus,
  #renameModal textarea:focus,
  #fidRewardModal input:focus,
  #fidRewardModal textarea:focus,
  #modalExternalPage input:focus,
  #modalEditExternalPage input:focus,
  #dash-fb-modal input:focus,
  #dash-fb-modal textarea:focus {
    border-color: #4CAF50 !important;
    box-shadow: 0 0 0 3px rgba(76,175,80,.1) !important;
  }

  /* ── Modal header text → dark green ─────────────────────── */
  #renameModal > div > div:first-child > div:first-child,
  #fidRewardModal > div > div:first-child > div:first-child,
  #nfcQRModal > div > div:first-child,
  #modalExternalPage > div > div:first-child,
  #modalEditExternalPage > div > div:first-child,
  #dash-fb-modal > div > div:first-child,
  #fid-history-member-name {
    color: #1A2E1A !important;
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 16px !important;
    font-weight: 800 !important;
  }

  /* ── Storico: sezioni colore ─────────────────────────────── */
  #fid-history-redemptions-wrap > div:first-child {
    color: #388E3C !important;
  }
  #fid-history-body > div:nth-child(3) {
    color: #5A7A5A !important;
  }

}

/* ── TOAST NOTIFICATION ─────────────────────────────────────*/
#mobToastContainer {
  position: fixed;
  bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: min(92%, 380px);
}
.mob-toast {
  background: #1A2E1A;
  color: #fff;
  padding: 13px 18px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  box-shadow: 0 4px 20px rgba(0,0,0,.3);
  animation: mobToastIn .25s cubic-bezier(.34,1.56,.64,1);
  pointer-events: auto;
  max-width: 100%;
  text-align: center;
  line-height: 1.4;
  cursor: pointer;
}
.mob-toast.success { background: linear-gradient(135deg, #388E3C, #4CAF50); }
.mob-toast.error   { background: #C62828; }
.mob-toast.warning { background: #E65100; }
.mob-toast.out     { animation: mobToastOut .2s ease forwards; }
@keyframes mobToastIn  { from { opacity:0; transform:translateY(14px) scale(.96); } to { opacity:1; transform:translateY(0) scale(1); } }
@keyframes mobToastOut { from { opacity:1; transform:translateY(0); } to { opacity:0; transform:translateY(10px); } }

/* ── CONFIRM MODAL ──────────────────────────────────────────*/
#mobConfirmModal {
  position: fixed;
  inset: 0;
  z-index: 99990;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: flex-end;
  justify-content: center;
}
#mobConfirmSheet {
  width: 100%;
  max-width: 520px;
  background: #fff;
  border-radius: 24px 24px 0 0;
  padding: 0 20px calc(28px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -6px 32px rgba(0,0,0,.15);
}
#mobConfirmSheet::before {
  content: '';
  display: block;
  width: 36px;
  height: 4px;
  background: #D8EDD8;
  border-radius: 2px;
  margin: 14px auto 20px;
}
#mobConfirmMsg {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #1A2E1A;
  text-align: center;
  padding: 0 8px 20px;
  line-height: 1.4;
}
.mob-confirm-btn-ok {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 16px;
  background: #C62828;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  font-family: 'Plus Jakarta Sans', sans-serif;
  margin-bottom: 10px;
}
.mob-confirm-btn-ok.green { background: linear-gradient(135deg, #388E3C, #4CAF50); }
.mob-confirm-btn-cancel {
  width: 100%;
  padding: 14px;
  border: 1.5px solid #D8EDD8;
  border-radius: 16px;
  background: #fff;
  color: #5A7A5A;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
