:root {
  --bg-root: #060a12;
  --bg-surface: rgba(15, 23, 42, 0.68);
  --bg-elevated: rgba(19, 28, 46, 0.72);
  --bg-hover: rgba(24, 35, 56, 0.85);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-blue: #38bdf8;
  --accent-indigo: #6366f1;

  /* Sistema Colori Unificato per Campionato (Tinte Intense & Eleganti) */
  --accent-sa: #38bdf8;
  --tint-sa: rgba(56, 189, 248, 0.16);
  --tint-sa-hover: rgba(56, 189, 248, 0.24);
  --border-sa: #38bdf8;
  --glow-sa: rgba(56, 189, 248, 0.24);

  --accent-pl: #a855f7;
  --tint-pl: rgba(168, 85, 247, 0.16);
  --tint-pl-hover: rgba(168, 85, 247, 0.24);
  --border-pl: #a855f7;
  --glow-pl: rgba(168, 85, 247, 0.24);

  --accent-bl: #4ade80;
  --tint-bl: rgba(74, 222, 128, 0.15);
  --tint-bl-hover: rgba(74, 222, 128, 0.24);
  --border-bl: #4ade80;
  --glow-bl: rgba(74, 222, 128, 0.22);

  --accent-ll: #fb923c;
  --tint-ll: rgba(251, 146, 60, 0.16);
  --tint-ll-hover: rgba(251, 146, 60, 0.24);
  --border-ll: #fb923c;
  --glow-ll: rgba(251, 146, 60, 0.24);

  --accent-altro: #94a3b8;
  --tint-altro: rgba(148, 163, 184, 0.04);
  --tint-altro-hover: rgba(148, 163, 184, 0.09);
  --border-altro: rgba(148, 163, 184, 0.35);

  --green: #10b981;
  --green-soft: rgba(16, 185, 129, 0.14);
  --red: #ef4444;
  --red-soft: rgba(239, 68, 68, 0.14);
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.14);
  --slate-soft: rgba(148, 163, 184, 0.14);

  --radius-md: 12px;
  --radius-sm: 8px;
  --glass-bg: rgba(7, 12, 10, 0.84);
  --glass-border: 1px solid rgba(16, 185, 129, 0.18);
  --glass-blur: blur(10px);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-card: inset 0 1px 0 rgba(255, 255, 255, 0.05), inset 0 1px 0 rgba(52, 211, 153, 0.10), 0 12px 32px rgba(0, 0, 0, 0.62);
}

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

html, body {
  min-height: 100%;
  color: var(--text-primary);
  font-family: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

html {
  background-color: #030706;
}

body {
  position: relative;
  background-color: #030706;
  background-image:
    radial-gradient(ellipse 68% 42% at 22% 82%, rgba(16, 185, 129, 0.34) 0%, transparent 65%),
    radial-gradient(ellipse 62% 38% at 78% 20%, rgba(5, 150, 105, 0.26) 0%, transparent 62%),
    radial-gradient(ellipse 48% 28% at 54% 48%, rgba(52, 211, 153, 0.18) 0%, transparent 60%),
    linear-gradient(135deg, #030706 0%, #062016 52%, #030706 100%);
  background-attachment: fixed;
}

.bg-waves {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-waves::before {
  content: "";
  position: absolute;
  inset: -18%;
  background:
    radial-gradient(ellipse 46% 36% at 24% 76%, rgba(16, 185, 129, 0.30) 0%, transparent 66%),
    radial-gradient(ellipse 44% 34% at 76% 24%, rgba(52, 211, 153, 0.24) 0%, transparent 64%),
    radial-gradient(ellipse 36% 26% at 52% 52%, rgba(5, 150, 105, 0.22) 0%, transparent 62%);
  will-change: transform, opacity;
  transform: translate3d(0, 0, 0);
  animation: emeraldAurora 16s ease-in-out infinite alternate;
}

.bg-waves svg {
  position: absolute;
  inset: -8%;
  width: 116%;
  height: 116%;
  display: block;
  filter: blur(20px);
  will-change: transform;
  transform: translate3d(0, 0, 0);
  animation: emeraldWavesDrift 16s ease-in-out infinite alternate;
}

@keyframes emeraldAurora {
  0% {
    transform: translate3d(-3%, 2.5%, 0) scale(1);
  }
  50% {
    transform: translate3d(2.5%, -2%, 0) scale(1.06);
  }
  100% {
    transform: translate3d(-1.5%, -3%, 0) scale(1.03);
  }
}

@keyframes emeraldWavesDrift {
  0% {
    transform: translate3d(-2%, 1.5%, 0) scale(1.02) rotate(-0.6deg);
  }
  50% {
    transform: translate3d(2%, -1.5%, 0) scale(1.06) rotate(0.8deg);
  }
  100% {
    transform: translate3d(1%, 2%, 0) scale(1.03) rotate(-0.3deg);
  }
}

.mono {
  font-family: "JetBrains Mono", "Cascadia Mono", Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

.hidden {
  display: none !important;
}

.full-width {
  width: 100%;
}

/* Layout */
.app-shell {
  position: relative;
  z-index: 1;
  background: transparent;
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: rgba(5, 9, 8, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid rgba(16, 185, 129, 0.16);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 6px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.brand-logo {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 4px 12px rgba(16, 185, 129, 0.28));
}

.brand-title {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-secondary);
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 18px;
  flex: 1;
}

.nav-item {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.nav-item:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.nav-item.active {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.55);
  color: #34d399;
  font-weight: 600;
}

.nav-icon {
  font-size: 15px;
  width: 20px;
  text-align: center;
}

.nav-badge {
  margin-left: auto;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
}

.sidebar-footer {
  border-top: 1px solid var(--border-subtle);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--green);
  background: var(--green-soft);
  padding: 6px 10px;
  border-radius: 999px;
}

.status-pill .dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: onlinePulse 2.1s ease-in-out infinite;
}

.status-pill .dot::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1.5px solid rgba(52, 211, 153, 0.72);
  animation: statusRadarRing 2.1s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

@keyframes statusRadarRing {
  0% {
    transform: scale(0.8);
    opacity: 0.85;
  }
  75%, 100% {
    transform: scale(2.35);
    opacity: 0;
  }
}

@keyframes onlinePulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.65), 0 0 8px var(--green);
  }
  50% {
    transform: scale(1.18);
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0), 0 0 14px #34d399;
  }
}

.status-pill.offline {
  color: var(--red);
  background: var(--red-soft);
}

.status-pill.offline .dot {
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
  animation: none;
}

.status-pill.offline .dot::after {
  display: none;
  animation: none;
}

.cassa-mini {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
}

.cassa-mini-row {
  display: flex;
  justify-content: space-between;
  color: var(--text-secondary);
}

.cassa-mini-row strong {
  color: var(--text-primary);
  font-family: "JetBrains Mono", Consolas, monospace;
}

/* Main */
.main-content {
  min-width: 0;
  padding: 24px 28px 40px;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 22px;
}

.topbar h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 13px;
  margin-top: 2px;
}

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

.timestamp {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
  padding: 5px 10px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}

.view {
  display: none;
  flex-direction: column;
  gap: 18px;
}

.view.active {
  display: flex;
  animation: viewEnter 260ms var(--ease-out-expo) both;
}

/* Toolbar & Pills */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.pill-group {
  display: inline-flex;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 4px;
}

.pill {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pill.active {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.55);
}

.league-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-movimenti {
  border-color: rgba(56, 189, 248, 0.35);
  color: var(--accent-blue);
}

.kpi-extra {
  font-size: 11.5px;
  margin-top: 4px;
  font-family: "JetBrains Mono", Consolas, monospace;
}

.chip {
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-secondary);
}

/* KPI Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.card,
.kpi-card {
  position: relative;
  overflow: hidden;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-card);
  transition: transform 240ms var(--ease-out-expo), border-color 220ms var(--ease-out-expo), box-shadow 240ms var(--ease-out-expo), background 220ms var(--ease-out-expo);
}

.kpi-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.72), transparent);
  opacity: 0.8;
}

.card:hover,
.kpi-card:hover {
  transform: translateY(-4px);
  border-color: rgba(52, 211, 153, 0.74);
  box-shadow: inset 0 1px 0 rgba(52, 211, 153, 0.26), 0 0 24px rgba(16, 185, 129, 0.24), 0 18px 40px rgba(0, 0, 0, 0.76);
}

.kpi-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  font-weight: 600;
}

.kpi-value {
  font-size: 26px;
  font-weight: 700;
  margin: 6px 0 4px;
  letter-spacing: -0.02em;
}

.kpi-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.pos { color: var(--green) !important; }
.neg { color: var(--red) !important; }
.warn { color: var(--amber) !important; }

/* Panels & Grids */
.grid-2-col {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 16px;
}

.panel {
  position: relative;
  min-width: 0;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-card);
  transition: transform 240ms var(--ease-out-expo), border-color 220ms var(--ease-out-expo), box-shadow 240ms var(--ease-out-expo);
}

.panel:hover {
  border-color: rgba(52, 211, 153, 0.30);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-header h2 {
  font-size: 15.5px;
  font-weight: 600;
}

.panel-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Equity SVG */
.chart-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.eq-period-pills {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: rgba(8, 14, 12, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 999px;
  padding: 2px;
}

.eq-pill {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.eq-pill:hover {
  color: var(--text-primary);
}

.eq-pill.active {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.chart-wrap {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 250px;
  background: rgba(5, 9, 8, 0.95);
  border: 1px solid rgba(16, 185, 129, 0.16);
  border-radius: var(--radius-sm);
  padding: 10px;
  overflow: hidden;
}

.equity-svg {
  width: 100%;
  height: 245px;
  display: block;
  cursor: crosshair;
  user-select: none;
}

.eq-dot-halo {
  animation: eqPulse 1.4s ease-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

@keyframes eqPulse {
  0% { opacity: 0.75; transform: scale(0.85); }
  70% { opacity: 0.12; transform: scale(1.55); }
  100% { opacity: 0; transform: scale(1.7); }
}

.chart-tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(7, 13, 22, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 9px;
  padding: 9px 11px;
  font-size: 12px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.65);
  z-index: 20;
  min-width: 190px;
  max-width: 260px;
  transition: left 0.06s ease-out, top 0.06s ease-out;
}

.eq-tip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.eq-tip-league {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  color: var(--text-primary);
}

.eq-tip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.eq-tip-match {
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  word-break: break-word;
}

.eq-tip-mkt {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.eq-tip-vals {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.league-breakdown {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.league-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.league-box-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.league-box-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  font-size: 12px;
}

.league-box-stats span {
  color: var(--text-muted);
  display: block;
}

.league-box-stats strong {
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 13.5px;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  background: rgba(5, 9, 8, 0.95);
  border: 1px solid rgba(16, 185, 129, 0.14);
  border-radius: var(--radius-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  text-align: left;
  padding: 10px 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-strong);
  white-space: nowrap;
}

.data-table td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.data-table.compact th,
.data-table.compact td {
  padding: 7px 8px;
  font-size: 12.5px;
}

.data-table tbody tr {
  transition: background 180ms var(--ease-out-expo), box-shadow 180ms var(--ease-out-expo);
}

.data-table tbody tr:hover {
  background: rgba(52, 211, 153, 0.08);
  box-shadow: inset 3px 0 0 rgba(52, 211, 153, 0.55);
}

.data-table tr.clickable-row {
  cursor: pointer;
}

.num {
  text-align: right !important;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

.actions-col {
  text-align: right !important;
  white-space: nowrap;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge-sa {
  background: rgba(56, 189, 248, 0.14);
  color: var(--accent-sa);
}

.badge-pl {
  background: rgba(168, 85, 247, 0.15);
  color: var(--accent-pl);
}

.badge-bl {
  background: rgba(74, 222, 128, 0.15);
  color: var(--accent-bl);
}

.badge-ll {
  background: rgba(251, 146, 60, 0.15);
  color: var(--accent-ll);
}

.badge-altro {
  background: rgba(148, 163, 184, 0.14);
  color: var(--accent-altro);
}

.badge-open {
  background: var(--amber-soft);
  color: var(--amber);
}

.badge-v {
  background: var(--green-soft);
  color: var(--green);
}

.badge-p {
  background: var(--red-soft);
  color: var(--red);
}

.badge-void {
  background: var(--slate-soft);
  color: var(--text-secondary);
}

/* Controls & Buttons */
.filters-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.input-ctrl {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  font-size: 13px;
  outline: none;
}

.input-ctrl:focus {
  border-color: var(--accent-blue);
}

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, #0ea5e9, #3b82f6);
  color: #fff;
  box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.35), 0 6px 18px rgba(14, 165, 233, 0.25);
  animation: btnPrimaryPulse 2.8s ease-in-out infinite;
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.12);
  transform: translateY(-1px);
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.45), 0 8px 22px rgba(14, 165, 233, 0.35);
  animation: none;
}

.btn-primary:disabled {
  animation: none;
}

@keyframes btnPrimaryPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.36), 0 6px 18px rgba(14, 165, 233, 0.24);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(56, 189, 248, 0), 0 6px 22px rgba(56, 189, 248, 0.36);
  }
}

.btn-success {
  background: var(--green);
  color: #042f2e;
}

.btn-ghost {
  background: var(--bg-elevated);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-hover);
}

.btn-sm {
  padding: 6px 11px;
  font-size: 12px;
}

.btn-xs {
  padding: 4px 8px;
  font-size: 11.5px;
  border-radius: 6px;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-v {
  background: var(--green-soft);
  color: var(--green);
  border-color: rgba(16, 185, 129, 0.35);
}

.btn-v:hover:not(:disabled) { background: var(--green); color: #052e16; }

.btn-p {
  background: var(--red-soft);
  color: var(--red);
  border-color: rgba(239, 68, 68, 0.35);
}

.btn-p:hover:not(:disabled) { background: var(--red); color: #fff; }

.btn-void {
  background: var(--slate-soft);
  color: var(--text-secondary);
  border-color: rgba(148, 163, 184, 0.3);
}

.btn-void:hover:not(:disabled) { background: #475569; color: #fff; }

.action-btn-group {
  display: inline-flex;
  gap: 5px;
}

/* Scanner */
.form-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field label {
  font-size: 11.5px;
  color: var(--text-secondary);
  font-weight: 600;
}

.field-btn {
  justify-content: flex-end;
}

.scanner-actions-bar {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.hint-text {
  font-size: 12px;
  color: var(--text-secondary);
}

.scanner-results {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.xg-banner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.xg-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  text-align: center;
}

.xg-box span {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
}

.xg-box strong {
  font-size: 20px;
  font-family: "JetBrains Mono", Consolas, monospace;
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.calc-output {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 12px;
}

.calc-metric span {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
}

.calc-metric strong {
  font-size: 17px;
  font-family: "JetBrains Mono", Consolas, monospace;
}

.calc-save-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.verdict-pill {
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--slate-soft);
  color: var(--text-secondary);
}

.verdict-pill.value {
  background: var(--green-soft);
  color: var(--green);
}

.verdict-pill.novalue {
  background: var(--red-soft);
  color: var(--red);
}

/* Database / Chrome flow */
.chrome-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.flow-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.flow-step {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.flow-step strong {
  color: var(--text-primary);
}

.flow-step code {
  background: rgba(56, 189, 248, 0.1);
  color: var(--accent-blue);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 11.5px;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 10, 0.76);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-card {
  position: relative;
  width: min(540px, 92vw);
  background: rgba(7, 13, 11, 0.92);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(16, 185, 129, 0.22);
  border-radius: var(--radius-md);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 24px 64px rgba(0, 0, 0, 0.72);
  overflow: hidden;
  animation: modalIn 220ms var(--ease-out-expo) both;
}

.modal-card-lg {
  width: min(680px, 94vw);
}

.mov-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-note {
  font-size: 11.5px;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}

.mov-nota-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.mov-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.mov-table-wrap {
  max-height: 230px;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
}

.modal-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

/* Toast */
.toast-container {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  position: relative;
  overflow: hidden;
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 280px;
  max-width: 390px;
  background: rgba(7, 13, 12, 0.90);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-left: 3px solid var(--accent-blue);
  padding: 11px 13px 13px;
  border-radius: 10px;
  font-size: 12.8px;
  line-height: 1.4;
  color: var(--text-primary);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 14px 34px rgba(0, 0, 0, 0.68);
  animation: toastIn 240ms var(--ease-out-expo) both;
}

.toast.toast-exit {
  animation: toastOut 200ms var(--ease-out-expo) forwards;
}

.toast-icon {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 1px;
  background: rgba(56, 189, 248, 0.14);
  color: var(--accent-blue);
}

.toast-body {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.toast-close {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color 150ms ease, background 150ms ease;
}

.toast-close:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.07);
}

.toast-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--accent-blue);
  opacity: 0.65;
  transform-origin: left center;
  animation: toastProgress 4200ms linear forwards;
}

.toast.ok { border-left-color: var(--green); }
.toast.ok .toast-icon { background: var(--green-soft); color: var(--green); }
.toast.ok .toast-progress { background: var(--green); }

.toast.err { border-left-color: var(--red); }
.toast.err .toast-icon { background: var(--red-soft); color: var(--red); }
.toast.err .toast-progress { background: var(--red); }

.toast.warn { border-left-color: var(--amber); }
.toast.warn .toast-icon { background: var(--amber-soft); color: var(--amber); }
.toast.warn .toast-progress { background: var(--amber); }

.empty-state {
  text-align: center;
  padding: 30px 16px;
  color: var(--text-muted);
  font-size: 13px;
}

@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2-col, .grid-2-col.anl-equal-grid { grid-template-columns: 1fr; }
  .form-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .flow-steps { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .calc-grid { grid-template-columns: 1fr; }
}

/* ==================== STORICO SNAI & BADGE ORIGINE ==================== */
.kpi-card-accent {
  background: linear-gradient(145deg, rgba(16, 185, 129, 0.08), rgba(56, 189, 248, 0.05));
  border-color: rgba(16, 185, 129, 0.28);
}

.badge-storico {
  background: rgba(148, 163, 184, 0.16);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.25);
  font-size: 10px;
}

.badge-app {
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
  font-size: 10px;
}

/* ==================== ANALISI MODELLO (FINTECH DIAGNOSTICA) ==================== */
.anl-toolbar {
  align-items: center;
}

.anl-tech-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  padding: 6px 11px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  font-size: 12px;
  color: var(--text-secondary);
  transition: border-color 0.15s ease, color 0.15s ease;
}

.anl-tech-toggle:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.anl-tech-toggle input {
  display: none;
}

.anl-switch-track {
  width: 30px;
  height: 17px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.25);
  position: relative;
  transition: background 0.18s ease;
}

.anl-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #e2e8f0;
  transition: transform 0.18s ease;
}

.anl-tech-toggle input:checked + .anl-switch-track {
  background: var(--accent-blue);
}

.anl-tech-toggle input:checked + .anl-switch-track .anl-switch-thumb {
  transform: translateX(13px);
  background: #070b12;
}

#sec-analisi .anl-tech-only {
  display: none;
}

#sec-analisi.show-tech .anl-tech-only {
  display: table-cell;
}

/* Hero Strip */
.anl-hero-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 12px;
}

.anl-hero-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  padding: 16px 18px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  transition: transform 240ms var(--ease-out-expo), border-color 220ms var(--ease-out-expo), box-shadow 240ms var(--ease-out-expo);
}

.anl-hero-card:hover {
  transform: translateY(-4px);
  border-color: rgba(52, 211, 153, 0.68);
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.22), 0 18px 38px rgba(0, 0, 0, 0.74);
}

.anl-hero-card.tone-green:hover {
  border-color: rgba(52, 211, 153, 0.75);
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.26), 0 16px 36px rgba(0, 0, 0, 0.72);
}

.anl-hero-card.tone-red:hover {
  border-color: rgba(248, 113, 113, 0.75);
  box-shadow: 0 0 24px rgba(239, 68, 68, 0.24), 0 16px 36px rgba(0, 0, 0, 0.72);
}

.anl-hero-card.tone-blue:hover {
  border-color: rgba(56, 189, 248, 0.75);
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.24), 0 16px 36px rgba(0, 0, 0, 0.72);
}

.anl-hero-card.tone-amber:hover {
  border-color: rgba(251, 191, 36, 0.75);
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.24), 0 16px 36px rgba(0, 0, 0, 0.72);
}

.anl-hero-card.tone-green {
  border-color: rgba(16, 185, 129, 0.35);
  background: linear-gradient(155deg, rgba(16, 185, 129, 0.11), rgba(11, 17, 30, 0.98) 62%);
}

.anl-hero-card.tone-red {
  border-color: rgba(239, 68, 68, 0.35);
  background: linear-gradient(155deg, rgba(239, 68, 68, 0.10), rgba(11, 17, 30, 0.98) 62%);
}

.anl-hero-card.tone-blue {
  border-color: rgba(56, 189, 248, 0.35);
  background: linear-gradient(155deg, rgba(56, 189, 248, 0.10), rgba(11, 17, 30, 0.98) 62%);
}

.anl-hero-card.tone-amber {
  border-color: rgba(245, 158, 11, 0.35);
  background: linear-gradient(155deg, rgba(245, 158, 11, 0.10), rgba(11, 17, 30, 0.98) 62%);
}

.anl-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.anl-hero-label {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  font-weight: 600;
}

.anl-hero-val {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.anl-hero-sub {
  font-size: 12px;
  color: var(--text-secondary);
}

.anl-split-bar {
  height: 7px;
  border-radius: 999px;
  overflow: hidden;
  display: flex;
  background: rgba(239, 68, 68, 0.35);
}

.anl-split-win {
  background: var(--green);
  height: 100%;
}

/* Sintesi rapida richiudibile */
.anl-synthesis {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  margin-bottom: 20px;
}

.anl-synthesis summary {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  list-style: none;
  font-size: 12.5px;
}

.anl-synthesis summary::-webkit-details-marker {
  display: none;
}

.anl-synthesis-title {
  color: var(--accent-blue);
  font-weight: 700;
  white-space: nowrap;
}

.anl-synthesis-preview {
  color: var(--text-secondary);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.anl-synthesis-caret {
  color: var(--text-muted);
  font-size: 11.5px;
  white-space: nowrap;
}

.anl-insights-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

.anl-insight-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.55);
  font-size: 12.5px;
}

.anl-insight-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}

.anl-insight-dot.ok { background: var(--green); box-shadow: 0 0 8px rgba(16, 185, 129, 0.5); }
.anl-insight-dot.warn { background: var(--amber); box-shadow: 0 0 8px rgba(245, 158, 11, 0.5); }
.anl-insight-dot.info { background: var(--accent-blue); box-shadow: 0 0 8px rgba(56, 189, 248, 0.4); }

/* Header Sezioni 01 -> 04 */
.anl-sec-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 12px;
}

.anl-sec-num {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: var(--accent-blue);
  font-weight: 800;
  font-size: 13px;
  flex-shrink: 0;
}

.anl-sec-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.anl-sec-sub {
  font-size: 12px;
  color: var(--text-secondary);
}

.anl-equal-grid {
  align-items: stretch;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
}

.anl-equal-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.anl-chart-wrap {
  position: relative;
  min-height: 210px;
}

.anl-svg {
  width: 100%;
  height: auto;
  display: block;
}

.anl-bar-hit {
  cursor: pointer;
}

.anl-bar-hit .anl-row-bg {
  fill: transparent;
  transition: fill 0.15s ease;
}

.anl-bar-hit:hover .anl-row-bg {
  fill: rgba(52, 211, 153, 0.10);
}

.anl-bar-rect {
  transition: filter 160ms ease, opacity 160ms ease;
}

.anl-bar-hit:hover .anl-bar-rect {
  filter: brightness(1.18) drop-shadow(0 0 8px rgba(52, 211, 153, 0.35));
}

/* Barra Vinte vs Pareggio in Tabella Mercati */
.anl-wr-cell {
  min-width: 145px;
}

.anl-wr-nums {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  margin-bottom: 4px;
}

.anl-wr-track {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
  overflow: visible;
}

.anl-wr-fill {
  height: 100%;
  border-radius: 999px;
}

.anl-wr-be-marker {
  position: absolute;
  top: -3px;
  width: 2px;
  height: 12px;
  background: #f8fafc;
  border-radius: 1px;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.7);
}

.badge-aff-insufficiente {
  background: var(--slate-soft);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.badge-aff-iniziale {
  background: var(--amber-soft);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.badge-aff-affidabile {
  background: var(--green-soft);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.aff-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 5px;
}

.aff-dot.INSUFFICIENTE { background: #94a3b8; }
.aff-dot.INIZIALE { background: #f59e0b; }
.aff-dot.AFFIDABILE { background: #10b981; }

.anl-info-icon {
  display: inline-grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.18);
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 700;
  margin-left: 5px;
  cursor: help;
}

/* Sezione 02: Tipologia & Lato Match */
.anl-ou-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.anl-mini-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.anl-mini-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.anl-mini-val {
  font-size: 19px;
  font-weight: 800;
}

.anl-mini-meta {
  font-size: 11.5px;
  color: var(--text-muted);
}

.anl-mini-bar {
  height: 4px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
  overflow: hidden;
  margin-top: 4px;
}

.anl-mini-bar-fill {
  height: 100%;
  border-radius: 999px;
}

.anl-sub-details {
  margin-top: 14px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 10px;
}

.anl-sub-details summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-blue);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.anl-sub-details summary::-webkit-details-marker { display: none; }

.anl-ou-markets {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.anl-ou-row {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 11.5px;
}

.anl-ou-row-head {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  margin-bottom: 5px;
}

.anl-ou-chips {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.anl-ou-chip {
  display: flex;
  justify-content: space-between;
  color: var(--text-secondary);
}

.anl-lato-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  justify-content: space-between;
}

.anl-lato-row {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
}

.anl-lato-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}

.anl-lato-track {
  height: 7px;
  background: rgba(148, 163, 184, 0.14);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 5px;
}

.anl-lato-fill {
  height: 100%;
  border-radius: 999px;
}

.anl-edge-warn {
  padding: 8px 11px;
  border-radius: var(--radius-sm);
  background: var(--amber-soft);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fde68a;
  font-size: 12px;
  margin-bottom: 10px;
}

.anl-edge-bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

.anl-edge-mini-bar {
  width: 44px;
  height: 5px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
  overflow: hidden;
}

.anl-edge-mini-fill {
  height: 100%;
  border-radius: 999px;
}

/* Sezione 04: Leaderboard Squadre */
.anl-leaderboard {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.anl-lb-row {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

.anl-lb-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.anl-lb-bg {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 0;
}

.anl-lb-row > * {
  position: relative;
  z-index: 1;
}

.anl-lb-rank {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 800;
  background: rgba(148, 163, 184, 0.14);
  color: var(--text-primary);
  flex-shrink: 0;
}

.anl-lb-rank.top { background: rgba(16, 185, 129, 0.18); color: #34d399; }
.anl-lb-rank.flop { background: rgba(239, 68, 68, 0.18); color: #f87171; }

.anl-lb-name {
  font-weight: 700;
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.anl-lb-rec {
  font-size: 11.5px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.anl-lb-nums {
  text-align: right;
  white-space: nowrap;
  flex-shrink: 0;
}

.trk-cat-select {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 11px;
  cursor: pointer;
  max-width: 136px;
}

.trk-cat-select:hover,
.trk-cat-select:focus {
  border-color: var(--accent-blue);
  color: var(--text-primary);
  outline: none;
}

.anl-footnote {
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--text-muted);
  text-align: right;
}


/* ======================================================== */
/* SNAI LIVE SCANNER — Stili (v5)                           */
/* ======================================================== */

/* Sub-tab bar */
.scanner-subtab-bar {
  display: flex;
  gap: 4px;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 18px;
}
.scanner-subtab {
  appearance: none;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.scanner-subtab:hover {
  background: rgba(16,185,129,0.08);
  border-color: rgba(16,185,129,0.3);
  color: var(--green);
}
.scanner-subtab.active {
  background: rgba(16,185,129,0.18);
  border-color: rgba(16,185,129,0.55);
  color: #34d399;
}
.scanner-subpane { width: 100%; }

/* Barra comando SNAI */
.snai-cmd-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.snai-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.snai-toggle input[type="checkbox"] {
  accent-color: var(--green);
  width: 14px;
  height: 14px;
}
.snai-sort-sel {
  font-size: 12px;
  padding: 5px 8px;
}

/* Barra avanzamento */
.snai-progress-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0 6px;
  font-size: 12px;
  color: var(--text-secondary);
}
.snai-progress-track {
  flex: 1;
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 999px;
  overflow: hidden;
  min-width: 120px;
}
.snai-progress-fill {
  height: 100%;
  background: var(--green);
  border-radius: 999px;
  transition: width 0.4s ease;
}

/* KPI Row */
.snai-kpi-row {
  display: flex;
  gap: 12px;
  margin: 10px 0 18px;
  flex-wrap: wrap;
}
.snai-kpi {
  position: relative;
  overflow: hidden;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: var(--shadow-card);
  min-width: 110px;
  transition: transform 220ms var(--ease-out-expo), border-color 220ms var(--ease-out-expo);
}
.snai-kpi span {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.snai-kpi strong {
  font-size: 22px;
  font-family: "JetBrains Mono", Consolas, monospace;
  color: var(--green);
  line-height: 1.1;
}
.snai-kpi-ts span:last-child {
  font-size: 12px;
  color: var(--text-muted);
  font-family: "JetBrains Mono", Consolas, monospace;
}

/* Scheda Value Bet */
.snai-vb-card {
  position: relative;
  overflow: hidden;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-card);
  transition: transform 220ms var(--ease-out-expo), border-color 220ms var(--ease-out-expo), box-shadow 220ms var(--ease-out-expo);
}
.snai-vb-card:hover {
  border-color: rgba(52, 211, 153, 0.72);
  transform: translateY(-4px);
  box-shadow: 0 0 26px rgba(16, 185, 129, 0.24), 0 18px 38px rgba(0, 0, 0, 0.74);
}
.snai-vb-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.snai-vb-partita { font-size: 14px; font-weight: 600; }
.snai-vb-ora {
  font-size: 12px;
  color: var(--text-secondary);
  margin-left: auto;
  font-family: "JetBrains Mono", Consolas, monospace;
}
.badge-lega {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  letter-spacing: 0.03em;
}
.badge-SA    { background: rgba(56, 189, 248, 0.15);  color: var(--accent-sa); }
.badge-PL    { background: rgba(168, 85, 247, 0.15);  color: var(--accent-pl); }
.badge-BL    { background: rgba(74, 222, 128, 0.15);  color: var(--accent-bl); }
.badge-LL    { background: rgba(251, 146, 60, 0.15);  color: var(--accent-ll); }
.badge-ALTRO { background: rgba(148, 163, 184, 0.14); color: var(--accent-altro); }

/* Card & Pannelli per Campionato (Tinte Intense + Bordo 4px + Glow + Intestazione Colorata) */
.league-card-sa {
  background: linear-gradient(100deg, var(--tint-sa) 0%, rgba(7, 12, 10, 0.88) 72%) !important;
  border-left: 4px solid var(--border-sa) !important;
  box-shadow: 0 0 20px var(--glow-sa), var(--shadow-card);
  transition: transform 240ms var(--ease-out-expo), background 220ms var(--ease-out-expo), border-color 220ms var(--ease-out-expo), box-shadow 240ms var(--ease-out-expo);
}
.league-card-sa:hover {
  background: linear-gradient(100deg, var(--tint-sa-hover) 0%, rgba(7, 12, 10, 0.86) 76%) !important;
  border-color: var(--accent-sa) !important;
  box-shadow: 0 0 28px rgba(56, 189, 248, 0.34), 0 16px 36px rgba(0, 0, 0, 0.72) !important;
}
.league-card-sa .panel-header { border-bottom: 1px solid rgba(56, 189, 248, 0.24); padding-bottom: 10px; }
.league-card-sa .panel-header h2,
.league-card-sa .snai-vb-partita { color: #7dd3fc; }

.league-card-pl {
  background: linear-gradient(100deg, var(--tint-pl) 0%, rgba(7, 12, 10, 0.88) 72%) !important;
  border-left: 4px solid var(--border-pl) !important;
  box-shadow: 0 0 20px var(--glow-pl), var(--shadow-card);
  transition: transform 240ms var(--ease-out-expo), background 220ms var(--ease-out-expo), border-color 220ms var(--ease-out-expo), box-shadow 240ms var(--ease-out-expo);
}
.league-card-pl:hover {
  background: linear-gradient(100deg, var(--tint-pl-hover) 0%, rgba(7, 12, 10, 0.86) 76%) !important;
  border-color: var(--accent-pl) !important;
  box-shadow: 0 0 28px rgba(168, 85, 247, 0.34), 0 16px 36px rgba(0, 0, 0, 0.72) !important;
}
.league-card-pl .panel-header { border-bottom: 1px solid rgba(168, 85, 247, 0.24); padding-bottom: 10px; }
.league-card-pl .panel-header h2,
.league-card-pl .snai-vb-partita { color: #d8b4fe; }

.league-card-bl {
  background: linear-gradient(100deg, var(--tint-bl) 0%, rgba(7, 12, 10, 0.88) 72%) !important;
  border-left: 4px solid var(--border-bl) !important;
  box-shadow: 0 0 20px var(--glow-bl), var(--shadow-card);
  transition: transform 240ms var(--ease-out-expo), background 220ms var(--ease-out-expo), border-color 220ms var(--ease-out-expo), box-shadow 240ms var(--ease-out-expo);
}
.league-card-bl:hover {
  background: linear-gradient(100deg, var(--tint-bl-hover) 0%, rgba(7, 12, 10, 0.86) 76%) !important;
  border-color: var(--accent-bl) !important;
  box-shadow: 0 0 28px rgba(74, 222, 128, 0.34), 0 16px 36px rgba(0, 0, 0, 0.72) !important;
}
.league-card-bl .panel-header { border-bottom: 1px solid rgba(74, 222, 128, 0.24); padding-bottom: 10px; }
.league-card-bl .panel-header h2,
.league-card-bl .snai-vb-partita { color: #86efac; }

.league-card-ll {
  background: linear-gradient(100deg, var(--tint-ll) 0%, rgba(7, 12, 10, 0.88) 72%) !important;
  border-left: 4px solid var(--border-ll) !important;
  box-shadow: 0 0 20px var(--glow-ll), var(--shadow-card);
  transition: transform 240ms var(--ease-out-expo), background 220ms var(--ease-out-expo), border-color 220ms var(--ease-out-expo), box-shadow 240ms var(--ease-out-expo);
}
.league-card-ll:hover {
  background: linear-gradient(100deg, var(--tint-ll-hover) 0%, rgba(7, 12, 10, 0.86) 76%) !important;
  border-color: var(--accent-ll) !important;
  box-shadow: 0 0 28px rgba(251, 146, 60, 0.34), 0 16px 36px rgba(0, 0, 0, 0.72) !important;
}
.league-card-ll .panel-header { border-bottom: 1px solid rgba(251, 146, 60, 0.24); padding-bottom: 10px; }
.league-card-ll .panel-header h2,
.league-card-ll .snai-vb-partita { color: #fdba74; }

.league-card-altro {
  background: linear-gradient(100deg, var(--tint-altro) 0%, rgba(7, 12, 10, 0.88) 72%) !important;
  border-left: 4px solid var(--border-altro) !important;
}
.league-card-altro:hover {
  background: linear-gradient(100deg, var(--tint-altro-hover) 0%, rgba(7, 12, 10, 0.86) 76%) !important;
}

/* Righe Tabella Tracker Giocate per Campionato */
.data-table tbody tr.row-league-sa { background: var(--tint-sa); }
.data-table tbody tr.row-league-sa:hover { background: var(--tint-sa-hover); box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.28); }
.data-table tbody tr.row-league-sa td:first-child { border-left: 4px solid var(--border-sa); }

.data-table tbody tr.row-league-pl { background: var(--tint-pl); }
.data-table tbody tr.row-league-pl:hover { background: var(--tint-pl-hover); box-shadow: inset 0 0 0 1px rgba(168, 85, 247, 0.28); }
.data-table tbody tr.row-league-pl td:first-child { border-left: 4px solid var(--border-pl); }

.data-table tbody tr.row-league-bl { background: var(--tint-bl); }
.data-table tbody tr.row-league-bl:hover { background: var(--tint-bl-hover); box-shadow: inset 0 0 0 1px rgba(74, 222, 128, 0.28); }
.data-table tbody tr.row-league-bl td:first-child { border-left: 4px solid var(--border-bl); }

.data-table tbody tr.row-league-ll { background: var(--tint-ll); }
.data-table tbody tr.row-league-ll:hover { background: var(--tint-ll-hover); box-shadow: inset 0 0 0 1px rgba(251, 146, 60, 0.28); }
.data-table tbody tr.row-league-ll td:first-child { border-left: 4px solid var(--border-ll); }

.data-table tbody tr.row-league-altro { background: var(--tint-altro); }
.data-table tbody tr.row-league-altro:hover { background: var(--tint-altro-hover); box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.25); }
.data-table tbody tr.row-league-altro td:first-child { border-left: 4px solid var(--border-altro); }
.badge-vb  {
  font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 999px;
  background: rgba(16,185,129,0.15); color: var(--green);
}
.badge-pulizia {
  font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 999px;
  background: rgba(245,158,11,0.15); color: #f59e0b;
}
.snai-vb-mercato {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}
.snai-vb-mercato strong { color: var(--text-primary); }
.snai-vb-numeri {
  display: flex;
  gap: 18px;
  font-size: 13px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.snai-vb-numeri span { color: var(--text-secondary); }
.snai-vb-numeri strong { color: var(--text-primary); }
.snai-vb-numeri .pos strong { color: var(--green); }
.snai-vb-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.snai-stake-input {
  width: 90px;
  padding: 6px 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  font-family: "JetBrains Mono", Consolas, monospace;
}
.snai-stake-input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(16,185,129,0.15);
}
.snai-stake-warn {
  font-size: 11px;
  color: #f59e0b;
  margin-top: 4px;
}
.btn-danger {
  background: rgba(239,68,68,0.2);
  border-color: rgba(239,68,68,0.6);
  color: #f87171;
}
.btn-danger:hover {
  background: rgba(239,68,68,0.3);
}
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
  font-size: 14px;
}

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

@media (max-width: 820px) {
  .anl-hero-grid, .anl-ou-cards, .anl-ou-markets {
    grid-template-columns: 1fr;
  }
  .snai-kpi-row { gap: 8px; }
  .snai-kpi strong { font-size: 18px; }
}

/* ==================== RITARDI STATISTICI MATCH ==================== */
.ritardi-top-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ritardo-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(7, 12, 10, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: var(--text-secondary);
}
.ritardo-pill.alto {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.55);
  color: #fbbf24;
}
.ritardo-pill.medio {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.45);
  color: #34d399;
}
.ritardi-col h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 10px 0;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(16, 185, 129, 0.18);
}
.ritardi-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 360px;
  overflow-y: auto;
}
.ritardo-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  background: rgba(5, 9, 8, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.12);
  font-size: 12px;
}
.ritardo-row.alto {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.06);
}
.ritardo-row.medio {
  border-color: rgba(16, 185, 129, 0.3);
}
.ritardo-row-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.ritardo-row-info strong { color: var(--text-primary); font-size: 12px; }
.ritardo-row-info span { color: var(--text-muted); font-size: 11px; }
.ritardi-arb-box {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: rgba(5, 9, 8, 0.9);
  border: 1px solid rgba(16, 185, 129, 0.28);
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12px;
}
.snai-ritardi-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: rgba(5, 9, 8, 0.82);
  border: 1px solid rgba(16, 185, 129, 0.16);
  font-size: 11px;
}
.snai-ritardi-drawer {
  margin-top: 10px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: rgba(5, 9, 8, 0.95);
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.badge-ritardo {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fbbf24;
}

/* ==================== FASE 2: DB UPDATER 1-CLIC ==================== */
.db-upd-cmd-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.db-upd-cmd-bar .input-ctrl {
  max-width: 210px;
}
.db-upd-console {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(3, 6, 5, 0.96);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #a7f3d0;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 11px;
  line-height: 1.5;
  max-height: 180px;
  overflow-y: auto;
  white-space: pre-wrap;
}
.db-upd-error {
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #fca5a5;
  font-size: 12px;
}

/* ==================== SEMAFORO MODELLO & SOLO TOP PICK ==================== */
.snai-toggle-top-pick {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
  font-weight: 600;
}
.snai-vb-card-top {
  border-color: rgba(16, 185, 129, 0.55);
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.18), 0 8px 20px rgba(0, 0, 0, 0.45);
}
.badge-semaforo {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.badge-top-pick {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.28), rgba(5, 150, 105, 0.35));
  border: 1px solid rgba(52, 211, 153, 0.7);
  color: #6ee7b7;
}
.badge-top-roi {
  background: rgba(250, 204, 21, 0.16);
  border: 1px solid rgba(250, 204, 21, 0.55);
  color: #fde047;
}
.badge-trappola {
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(248, 113, 113, 0.6);
  color: #fca5a5;
}
.badge-ritardo-val {
  background: rgba(249, 115, 22, 0.18);
  border: 1px solid rgba(251, 146, 60, 0.6);
  color: #fdba74;
}

/* ==================== RADAR & NOTIFICHE SNAI ==================== */
.radar-open-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  border-color: rgba(16, 185, 129, 0.35);
}
.radar-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4b5563;
  display: inline-block;
  flex-shrink: 0;
}
.radar-dot.active {
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.9);
}
.radar-modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.radar-status-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(5, 9, 8, 0.9);
  border: 1px solid rgba(16, 185, 129, 0.25);
}
.radar-status-banner > div:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
}
.radar-times {
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: var(--text-secondary);
}
.radar-times strong { color: var(--text-primary); }
.radar-form-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.radar-switch-row {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.22);
}
.radar-row-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.radar-row-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.radar-field-chk {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}
.radar-camps-row,
.radar-channels-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.radar-channels-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(5, 9, 8, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.radar-actions-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.radar-log-section {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 10px;
}
.radar-log-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.radar-log-hdr h4 {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
}
.radar-avvisi-log {
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.radar-avviso-item {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: rgba(5, 9, 8, 0.85);
  border: 1px solid rgba(16, 185, 129, 0.2);
  font-size: 12px;
}
.radar-avviso-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 3px;
}
.radar-avviso-tipo {
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.16);
  color: #6ee7b7;
}
.radar-avviso-ts {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-muted);
}
.radar-avviso-msg {
  color: var(--text-secondary);
}
@media (max-width: 720px) {
  .radar-row-3,
  .radar-row-2 {
    grid-template-columns: 1fr;
  }
}

/* ======================================================== */
/* UPGRADE FINTECH / SAAS (v14)                             */
/* ======================================================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* 1. Tabular Numbers su tutti i KPI e tabelle */
.kpi-value,
.anl-hero-val,
.anl-mini-val,
.snai-kpi strong,
.snai-vb-numeri,
.snai-vb-numeri strong,
.data-table th,
.data-table td,
.calc-metric strong,
.xg-box strong,
.cassa-mini-row strong,
.league-box-stats strong,
.chip strong,
.nav-badge,
.badge {
  font-variant-numeric: tabular-nums;
}

/* 2. Glassmorphism: bordo sottile a gradiente su pannelli & card */
.panel::before,
.anl-hero-card::before,
.snai-vb-card::before,
.modal-card::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    rgba(52, 211, 153, 0.24) 0%,
    rgba(255, 255, 255, 0.06) 46%,
    rgba(16, 185, 129, 0.14) 100%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
  z-index: 2;
}

.league-box {
  position: relative;
  overflow: hidden;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  transition: transform 240ms var(--ease-out-expo), border-color 220ms var(--ease-out-expo), box-shadow 240ms var(--ease-out-expo);
}

.league-box:hover {
  transform: translateY(-4px);
}

.league-box .league-box-head {
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.snai-kpi:hover {
  transform: translateY(-4px);
  border-color: rgba(52, 211, 153, 0.68);
  box-shadow: 0 0 22px rgba(16, 185, 129, 0.24), 0 16px 32px rgba(0, 0, 0, 0.72);
}

/* 3. Spotlight Hover radiale ben visibile su card KPI, leghe e match */
.kpi-card,
.anl-hero-card,
.snai-kpi,
.snai-vb-card,
.league-box {
  --spot-x: 50%;
  --spot-y: 50%;
  --spot-color: rgba(52, 211, 153, 0.20);
}

.league-card-sa { --spot-color: rgba(56, 189, 248, 0.22); }
.league-card-pl { --spot-color: rgba(168, 85, 247, 0.22); }
.league-card-bl { --spot-color: rgba(74, 222, 128, 0.21); }
.league-card-ll { --spot-color: rgba(251, 146, 60, 0.22); }

.kpi-card::after,
.anl-hero-card::after,
.snai-kpi::after,
.snai-vb-card::after,
.league-box::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    300px circle at var(--spot-x) var(--spot-y),
    var(--spot-color),
    transparent 68%
  );
  transition: opacity 220ms var(--ease-out-expo);
  z-index: 1;
}

.kpi-card:hover::after,
.anl-hero-card:hover::after,
.snai-kpi:hover::after,
.snai-vb-card:hover::after,
.league-box:hover::after {
  opacity: 1;
}

/* 4. Transizioni Vista & Staggered Reveal (visibili al cambio scheda) */
.view.active {
  animation: viewEnter 360ms var(--ease-out-expo) both;
}

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

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

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

.view.active .kpi-grid > .kpi-card,
.view.active .snai-kpi-row > .snai-kpi,
.view.active .grid-2-col > .panel,
.view.active .anl-hero-grid > .anl-hero-card {
  animation: cardReveal 380ms var(--ease-out-expo) both;
}

.view.active .kpi-grid > .kpi-card:nth-child(1),
.view.active .snai-kpi-row > .snai-kpi:nth-child(1),
.view.active .anl-hero-grid > .anl-hero-card:nth-child(1),
.view.active .grid-2-col > .panel:nth-child(1) { animation-delay: 30ms; }

.view.active .kpi-grid > .kpi-card:nth-child(2),
.view.active .snai-kpi-row > .snai-kpi:nth-child(2),
.view.active .anl-hero-grid > .anl-hero-card:nth-child(2),
.view.active .grid-2-col > .panel:nth-child(2) { animation-delay: 80ms; }

.view.active .kpi-grid > .kpi-card:nth-child(3),
.view.active .snai-kpi-row > .snai-kpi:nth-child(3),
.view.active .anl-hero-grid > .anl-hero-card:nth-child(3) { animation-delay: 130ms; }

.view.active .kpi-grid > .kpi-card:nth-child(4),
.view.active .snai-kpi-row > .snai-kpi:nth-child(4),
.view.active .anl-hero-grid > .anl-hero-card:nth-child(4) { animation-delay: 180ms; }

.view.active .kpi-grid > .kpi-card:nth-child(5) { animation-delay: 225ms; }
.view.active .kpi-grid > .kpi-card:nth-child(6) { animation-delay: 270ms; }

.stagger-item {
  animation: cardReveal 380ms var(--ease-out-expo) both;
  animation-delay: calc(var(--stagger-i, 0) * 48ms);
}

/* 5. Toast Keyframes */
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translate3d(16px, 8px, 0) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    opacity: 0;
    transform: translate3d(18px, 0, 0) scale(0.97);
  }
}

@keyframes toastProgress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

/* 6. Skeleton Loader con Shimmer (Scanner Live SNAI) */
.snai-skeleton-card {
  position: relative;
  overflow: hidden;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: var(--radius-md);
  padding: 15px 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.skel-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.skel-block {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.10);
}

.skel-block::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(52, 211, 153, 0.14) 50%,
    transparent 100%
  );
  animation: skelShimmer 1.25s var(--ease-out-expo) infinite;
}

.skel-badge { width: 38px; height: 18px; border-radius: 999px; }
.skel-title { width: 210px; height: 16px; }
.skel-time { width: 76px; height: 14px; margin-left: auto; }
.skel-mkt { width: 42%; height: 13px; }
.skel-pill { width: 84px; height: 18px; }
.skel-btn { width: 126px; height: 30px; border-radius: var(--radius-sm); }

@keyframes skelShimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* 7. Mini Barra Intensita Edge % nelle card Scanner Match */
.snai-edge-meter {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
}

.snai-edge-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  white-space: nowrap;
}

.snai-edge-track {
  flex: 1;
  max-width: 240px;
  height: 4px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  overflow: hidden;
}

.snai-edge-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 320ms var(--ease-out-expo);
}

.snai-edge-fill.edge-low {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.55), #10b981);
}

.snai-edge-fill.edge-mid {
  background: linear-gradient(90deg, #10b981, #34d399);
}

.snai-edge-fill.edge-high {
  background: linear-gradient(90deg, #10b981, #34d399 60%, #fbbf24);
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.45);
}

.snai-edge-fill.edge-neg {
  background: rgba(239, 68, 68, 0.55);
}

.snai-edge-pct-mini {
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* 8. Command Palette (Ctrl + K) */
.cmd-trigger {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(7, 13, 11, 0.85);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(16, 185, 129, 0.24);
  color: var(--text-secondary);
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 180ms var(--ease-out-expo), color 180ms var(--ease-out-expo), background 180ms var(--ease-out-expo);
}

.cmd-trigger:hover {
  border-color: rgba(52, 211, 153, 0.52);
  color: var(--text-primary);
  background: rgba(16, 185, 129, 0.10);
}

.cmd-trigger-icon {
  color: #34d399;
  font-size: 12px;
}

.cmd-kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 5px;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.22);
  color: var(--text-secondary);
}

.cmd-modal {
  align-items: start;
  justify-items: center;
  padding-top: min(12vh, 96px);
  z-index: 90;
}

.cmd-card {
  width: min(580px, 92vw);
  border-color: rgba(16, 185, 129, 0.30);
}

.cmd-search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cmd-search-icon {
  color: #34d399;
  font-size: 17px;
  line-height: 1;
  flex-shrink: 0;
}

.cmd-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 14.5px;
  font-family: inherit;
}

.cmd-input::placeholder {
  color: var(--text-muted);
}

.cmd-list {
  max-height: min(52vh, 380px);
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cmd-group-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 8px 10px 4px;
}

.cmd-item {
  appearance: none;
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 11px;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: background 150ms var(--ease-out-expo), border-color 150ms var(--ease-out-expo);
}

.cmd-item-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.cmd-item-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  flex-shrink: 0;
}

.cmd-item-title {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cmd-item-sub {
  font-size: 11.5px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cmd-item-tag {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(148, 163, 184, 0.10);
  border: 1px solid rgba(148, 163, 184, 0.18);
  padding: 2px 7px;
  border-radius: 999px;
  flex-shrink: 0;
}

.cmd-item.active,
.cmd-item:hover {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.34);
}

.cmd-item.active .cmd-item-tag {
  color: #6ee7b7;
  border-color: rgba(52, 211, 153, 0.4);
  background: rgba(16, 185, 129, 0.16);
}

.cmd-empty {
  padding: 26px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.cmd-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 9px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(4, 8, 7, 0.72);
  font-size: 11.5px;
  color: var(--text-muted);
}

/* 9. Toggle Animazioni Sidebar (attive di default) */
.anim-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  transition: border-color 180ms ease, color 180ms ease;
}

.anim-toggle-row:hover {
  border-color: rgba(52, 211, 153, 0.35);
  color: var(--text-primary);
}

.anim-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.anim-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.anim-switch-track {
  width: 32px;
  height: 18px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.25);
  position: relative;
  transition: background 180ms ease;
}

.anim-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #e2e8f0;
  transition: transform 180ms var(--ease-out-expo), background 180ms ease;
}

.anim-switch input:checked + .anim-switch-track {
  background: rgba(16, 185, 129, 0.85);
}

.anim-switch input:checked + .anim-switch-track .anim-switch-thumb {
  transform: translateX(14px);
  background: #042f2e;
}

/* Modalita Animazioni OFF controllata dall'utente */
body.no-animations *,
body.no-animations *::before,
body.no-animations *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
  scroll-behavior: auto !important;
}

body.no-animations .bg-waves::before,
body.no-animations .bg-waves svg,
body.no-animations .status-pill .dot,
body.no-animations .status-pill .dot::after,
body.no-animations .radar-live-ping,
body.no-animations .snai-progress-wrap.is-live .snai-progress-fill::after,
body.no-animations .btn-primary {
  animation: none !important;
}

body.no-animations .kpi-card:hover::after,
body.no-animations .anl-hero-card:hover::after,
body.no-animations .snai-kpi:hover::after,
body.no-animations .snai-vb-card:hover::after,
body.no-animations .league-box:hover::after {
  opacity: 0 !important;
}

/* ======================================================== */
/* UPGRADE FINTECH COMMERCIAL PRODUCT (v16)                 */
/* ======================================================== */

/* Press tattile su tutti i controlli interattivi */
.btn:active:not(:disabled),
.pill:active,
.eq-pill:active,
.scanner-subtab:active,
.btn-xs:active,
.cmd-trigger:active {
  transform: scale(0.97) !important;
}

/* Pillole filtro colorate per lega (Dashboard & Analisi) */
.pill[data-camp="SERIE_A"].active,
.pill[data-lega="SERIE_A"].active {
  background: rgba(56, 189, 248, 0.18);
  color: #7dd3fc;
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.65), 0 0 14px rgba(56, 189, 248, 0.22);
}

.pill[data-camp="PREMIER_LEAGUE"].active,
.pill[data-lega="PREMIER_LEAGUE"].active {
  background: rgba(168, 85, 247, 0.18);
  color: #d8b4fe;
  box-shadow: inset 0 0 0 1px rgba(168, 85, 247, 0.65), 0 0 14px rgba(168, 85, 247, 0.22);
}

.pill[data-camp="BUNDESLIGA"].active,
.pill[data-lega="BUNDESLIGA"].active {
  background: rgba(74, 222, 128, 0.18);
  color: #86efac;
  box-shadow: inset 0 0 0 1px rgba(74, 222, 128, 0.65), 0 0 14px rgba(74, 222, 128, 0.22);
}

.pill[data-camp="LA_LIGA"].active,
.pill[data-lega="LA_LIGA"].active {
  background: rgba(251, 146, 60, 0.18);
  color: #fdba74;
  box-shadow: inset 0 0 0 1px rgba(251, 146, 60, 0.65), 0 0 14px rgba(251, 146, 60, 0.22);
}

/* Chips superiori con accento lega */
.chip.chip-sa { border-color: rgba(56, 189, 248, 0.35); background: rgba(56, 189, 248, 0.08); }
.chip.chip-pl { border-color: rgba(168, 85, 247, 0.35); background: rgba(168, 85, 247, 0.08); }
.chip.chip-bl { border-color: rgba(74, 222, 128, 0.35); background: rgba(74, 222, 128, 0.08); }
.chip.chip-ll { border-color: rgba(251, 146, 60, 0.35); background: rgba(251, 146, 60, 0.08); }

/* KPI Sparkline nelle card Cassa Unica & Profitto Netto */
.kpi-card-spark {
  display: flex;
  flex-direction: column;
}

.kpi-spark-wrap {
  margin-top: auto;
  padding-top: 8px;
}

.kpi-sparkline {
  width: 100%;
  height: 44px;
  min-height: 44px;
}

/* Dimensioni ottimali contenitori Apache ECharts */
.chart-wrap-equity {
  height: 318px;
  min-height: 318px;
  padding: 6px 8px 6px;
}

.anl-chart-markets {
  height: 340px;
  min-height: 340px;
  padding: 8px 10px;
}

.anl-chart-league {
  height: 340px;
  min-height: 340px;
  padding: 8px 10px;
}

#anl-quota-chart {
  height: 276px;
  min-height: 276px;
  padding: 8px 10px;
}

/* Card Lega cliccabili in Dashboard (Base Calcolo Stake & Rendimento) */
.league-box.clickable-league-card {
  cursor: pointer;
  user-select: none;
}

.league-box.clickable-league-card:focus-visible {
  outline: 2px solid #34d399;
  outline-offset: 2px;
}

.league-box-head-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.league-active-pill {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.20);
  border: 1px solid rgba(52, 211, 153, 0.55);
  color: #6ee7b7;
}

.league-box.active.league-card-sa {
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.72), 0 0 28px rgba(56, 189, 248, 0.36), var(--shadow-card) !important;
  background: linear-gradient(100deg, rgba(56, 189, 248, 0.25) 0%, rgba(7, 12, 10, 0.88) 78%) !important;
}
.league-box.active.league-card-sa .league-active-pill {
  background: rgba(56, 189, 248, 0.22);
  border-color: rgba(56, 189, 248, 0.65);
  color: #7dd3fc;
}

.league-box.active.league-card-pl {
  box-shadow: 0 0 0 1px rgba(168, 85, 247, 0.72), 0 0 28px rgba(168, 85, 247, 0.36), var(--shadow-card) !important;
  background: linear-gradient(100deg, rgba(168, 85, 247, 0.25) 0%, rgba(7, 12, 10, 0.88) 78%) !important;
}
.league-box.active.league-card-pl .league-active-pill {
  background: rgba(168, 85, 247, 0.22);
  border-color: rgba(168, 85, 247, 0.65);
  color: #d8b4fe;
}

.league-box.active.league-card-bl {
  box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.72), 0 0 28px rgba(74, 222, 128, 0.34), var(--shadow-card) !important;
  background: linear-gradient(100deg, rgba(74, 222, 128, 0.24) 0%, rgba(7, 12, 10, 0.88) 78%) !important;
}
.league-box.active.league-card-bl .league-active-pill {
  background: rgba(74, 222, 128, 0.22);
  border-color: rgba(74, 222, 128, 0.65);
  color: #86efac;
}

.league-box.active.league-card-ll {
  box-shadow: 0 0 0 1px rgba(251, 146, 60, 0.72), 0 0 28px rgba(251, 146, 60, 0.36), var(--shadow-card) !important;
  background: linear-gradient(100deg, rgba(251, 146, 60, 0.25) 0%, rgba(7, 12, 10, 0.88) 78%) !important;
}
.league-box.active.league-card-ll .league-active-pill {
  background: rgba(251, 146, 60, 0.22);
  border-color: rgba(251, 146, 60, 0.65);
  color: #fdba74;
}

/* Righe Tracker cliccabili verso Drawer */
#tracker-tbody tr.trk-row-clickable {
  cursor: pointer;
}

/* Scanner Match: Calcolo Live Vincita Potenziale & Profitto Netto */
.snai-payout-live {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 5px 11px;
  border-radius: var(--radius-sm);
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.24);
  font-size: 12px;
  color: var(--text-secondary);
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.snai-payout-live strong {
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.snai-payout-live .pos {
  color: #34d399 !important;
}

.snai-payout-live.payout-flash {
  border-color: rgba(52, 211, 153, 0.75);
  background: rgba(16, 185, 129, 0.18);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.24);
}

/* Radar Live Indicator & Progress Shimmer (Scanner & DB Updater) */
.radar-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(52, 211, 153, 0.45);
  color: #6ee7b7;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.radar-live-pill.is-done {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.35);
  color: #7dd3fc;
}

.radar-live-ping {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.snai-progress-wrap.is-live .radar-live-ping::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1.5px solid #34d399;
  animation: statusRadarRing 1.4s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

.radar-live-pill.is-done .radar-live-ping {
  background: #38bdf8;
  box-shadow: 0 0 6px #38bdf8;
}

.snai-progress-wrap.is-live .snai-progress-track {
  border: 1px solid rgba(52, 211, 153, 0.28);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.16);
}

.snai-progress-wrap.is-live .snai-progress-fill {
  position: relative;
  overflow: hidden;
  background: linear-gradient(90deg, #059669, #10b981, #34d399);
}

.snai-progress-wrap.is-live .snai-progress-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: translateX(-100%);
  animation: radarShimmer 1.2s ease-in-out infinite;
}

@keyframes radarShimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ======================================================== */
/* SLIDE-OVER DETAIL DRAWER                                 */
/* ======================================================== */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 75;
  display: flex;
  justify-content: flex-end;
}

.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 9, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 280ms var(--ease-out-expo);
}

.drawer.is-open .drawer-backdrop {
  opacity: 1;
}

.drawer-panel {
  position: relative;
  z-index: 2;
  width: min(500px, 95vw);
  height: 100%;
  background: rgba(6, 11, 10, 0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-left: 1px solid rgba(16, 185, 129, 0.28);
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.78), inset 1px 0 0 rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 320ms var(--ease-out-expo);
  overflow: hidden;
}

.drawer.is-open .drawer-panel {
  transform: translateX(0);
}

.drawer-panel.drawer-league-sa { border-left: 4px solid var(--border-sa); }
.drawer-panel.drawer-league-pl { border-left: 4px solid var(--border-pl); }
.drawer-panel.drawer-league-bl { border-left: 4px solid var(--border-bl); }
.drawer-panel.drawer-league-ll { border-left: 4px solid var(--border-ll); }
.drawer-panel.drawer-league-altro { border-left: 4px solid var(--border-altro); }

.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), transparent 70%);
}

.drawer-panel.drawer-league-sa .drawer-header { background: linear-gradient(135deg, rgba(56, 189, 248, 0.14), transparent 75%); }
.drawer-panel.drawer-league-pl .drawer-header { background: linear-gradient(135deg, rgba(168, 85, 247, 0.14), transparent 75%); }
.drawer-panel.drawer-league-bl .drawer-header { background: linear-gradient(135deg, rgba(74, 222, 128, 0.14), transparent 75%); }
.drawer-panel.drawer-league-ll .drawer-header { background: linear-gradient(135deg, rgba(251, 146, 60, 0.14), transparent 75%); }

.drawer-header-meta {
  min-width: 0;
  flex: 1;
}

.drawer-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.drawer-header h3 {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.drawer-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.drawer-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(15, 23, 42, 0.55);
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.drawer-close-btn:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.45);
  color: #fca5a5;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.drawer-section {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.drawer-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.drawer-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.drawer-stat-box {
  background: rgba(5, 9, 8, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  padding: 9px 11px;
}

.drawer-stat-box span {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
}

.drawer-stat-box strong {
  display: block;
  margin-top: 3px;
  font-size: 16px;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

.drawer-quota-compare {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.drawer-quota-bar-track {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
  overflow: hidden;
}

.drawer-quota-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #059669, #34d399);
}

.drawer-quota-bar-fill.is-neg {
  background: linear-gradient(90deg, #f87171, #dc2626);
}

.drawer-events-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.drawer-event-item {
  padding: 8px 10px;
  border-radius: 7px;
  background: rgba(5, 9, 8, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 12px;
}

.drawer-footer {
  padding: 14px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(4, 8, 7, 0.92);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.drawer-footer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}

/* Tooltip internals per ECharts Analisi */
.anl-tip-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.anl-tip-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font-size: 12px;
  line-height: 1.5;
}
.anl-tip-row span { color: var(--text-secondary); }

/* ======================================================== */
/* PWA, MODALITÀ SOLA LETTURA, PIN & MOBILE RESPONSIVE (v17) */
/* ======================================================== */
.nav-label-short {
  display: none;
}

.mobile-sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 600;
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.34);
  padding: 5px 11px;
  border-radius: 999px;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

.mobile-sync-badge .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.85);
}

/* Modalità Cloud/Mobile Sola Lettura */
body.mobile-readonly .nav-item[data-section="scanner"],
body.mobile-readonly #sec-scanner,
body.mobile-readonly #btn-open-add-bet,
body.mobile-readonly #btn-open-movimenti,
body.mobile-readonly #btn-refresh-all,
body.mobile-readonly .db-updater-panel,
body.mobile-readonly #tracker-panel .actions-col {
  display: none !important;
}

/* Schermata Sblocco PIN 4 cifre */
.pin-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(ellipse 65% 45% at 50% 25%, rgba(16, 185, 129, 0.22) 0%, transparent 65%),
    rgba(3, 7, 6, 0.96);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.pin-card {
  width: min(350px, 100%);
  background: rgba(7, 13, 11, 0.92);
  border: 1px solid rgba(16, 185, 129, 0.32);
  border-radius: 18px;
  padding: 26px 22px 22px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.78), 0 0 32px rgba(16, 185, 129, 0.14);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.pin-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
}

.pin-brand h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.pin-sub {
  font-size: 12.5px;
  color: var(--text-secondary);
}

.pin-dots {
  display: flex;
  gap: 14px;
  padding: 6px 0;
}

.pin-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(52, 211, 153, 0.5);
  background: rgba(16, 185, 129, 0.06);
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.pin-dot.filled {
  background: #34d399;
  border-color: #6ee7b7;
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.7);
  transform: scale(1.12);
}

.pin-dots.pin-shake {
  animation: pinShake 360ms ease;
}

.pin-dots.pin-shake .pin-dot {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.45);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.6);
}

@keyframes pinShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

.pin-error {
  min-height: 16px;
  font-size: 12px;
  font-weight: 600;
  color: #f87171;
  text-align: center;
}

.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
  max-width: 260px;
}

.pin-key {
  appearance: none;
  height: 54px;
  border-radius: 12px;
  border: 1px solid rgba(16, 185, 129, 0.22);
  background: rgba(15, 23, 42, 0.65);
  color: var(--text-primary);
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, transform 100ms ease;
  touch-action: manipulation;
  user-select: none;
}

.pin-key:hover {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(52, 211, 153, 0.55);
}

.pin-key:active {
  transform: scale(0.94);
  background: rgba(16, 185, 129, 0.28);
}

.pin-key-fn {
  font-size: 16px;
  color: var(--text-secondary);
  background: rgba(7, 12, 10, 0.72);
}

/* Layout Responsive Mobile (<= 768px) */
@media (max-width: 768px) {
  html,
  body {
    overflow-x: hidden;
    max-width: 100%;
  }

  .app-shell {
    grid-template-columns: 1fr;
    max-width: 100%;
    overflow-x: clip;
  }

  .main-content {
    padding: 14px 12px calc(86px + env(safe-area-inset-bottom, 0px));
    max-width: 100%;
    overflow-x: clip;
  }

  .view,
  .panel,
  .anl-synthesis,
  .anl-synthesis summary,
  .anl-synthesis-preview,
  .anl-sec-head > div,
  .anl-hero-card {
    min-width: 0;
    max-width: 100%;
  }

  .sidebar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    z-index: 65;
    width: 100%;
    height: auto;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
    border-right: none;
    border-top: 1px solid rgba(16, 185, 129, 0.28);
    background: rgba(5, 9, 8, 0.96);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.72);
  }

  .sidebar .brand,
  .sidebar .sidebar-footer {
    display: none;
  }

  .nav-menu {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    align-items: stretch;
    gap: 4px;
    margin-top: 0;
    width: 100%;
  }

  .nav-item {
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 7px 4px;
    font-size: 10.5px;
    text-align: center;
    position: relative;
    border-radius: 10px;
  }

  .nav-icon {
    font-size: 16px;
    width: auto;
    line-height: 1.1;
  }

  .nav-label-full {
    display: none;
  }

  .nav-label-short {
    display: inline;
    line-height: 1.1;
  }

  .nav-badge {
    position: absolute;
    top: 3px;
    right: 10px;
    margin-left: 0;
    font-size: 9.5px;
    padding: 0 5px;
    line-height: 15px;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 14px;
  }

  .topbar h1 {
    font-size: 18px;
  }

  .subtitle {
    font-size: 12px;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
    gap: 8px;
  }

  body.mobile-readonly #btn-cmd-palette {
    display: none;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .pill-group {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    max-width: 100%;
  }

  .pill-group::-webkit-scrollbar,
  .league-chips::-webkit-scrollbar {
    display: none;
  }

  .pill {
    white-space: nowrap;
    flex-shrink: 0;
    padding: 6px 10px;
    font-size: 11.5px;
  }

  .toolbar-right {
    width: 100%;
  }

  .league-chips {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 6px;
    width: 100%;
    padding-bottom: 2px;
  }

  .chip {
    white-space: nowrap;
    flex-shrink: 0;
    font-size: 11px;
    padding: 4px 9px;
  }

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

  .kpi-card {
    padding: 12px 12px;
  }

  .kpi-label {
    font-size: 10.5px;
  }

  .kpi-value {
    font-size: 19px;
    margin: 4px 0 2px;
  }

  .kpi-meta {
    font-size: 11px;
    line-height: 1.3;
  }

  .kpi-sparkline {
    height: 34px;
    min-height: 34px;
  }

  .anl-hero-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .anl-hero-card {
    padding: 12px;
  }

  .anl-hero-val {
    font-size: 19px;
  }

  .anl-ou-cards,
  .anl-ou-markets {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 14px 12px;
  }

  .panel-header {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .chart-header-right {
    justify-content: space-between;
    width: 100%;
  }

  .chart-wrap-equity {
    height: 255px;
    min-height: 255px;
    padding: 4px;
  }

  .anl-chart-markets {
    height: 280px;
    min-height: 280px;
    padding: 4px;
  }

  .anl-chart-league {
    height: 270px;
    min-height: 270px;
    padding: 4px;
  }

  #anl-quota-chart {
    height: 245px;
    min-height: 245px;
    padding: 4px;
  }

  .filters-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
  }

  #trk-search {
    grid-column: 1 / -1;
  }

  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
    max-width: 100%;
  }

  .data-table th,
  .data-table td {
    white-space: nowrap;
  }

  .xg-banner,
  .calc-output {
    grid-template-columns: 1fr;
  }

  .drawer-panel {
    width: 100vw;
    max-width: 100vw;
  }

  .toast-container {
    right: 12px;
    left: 12px;
    bottom: 78px;
  }

  .toast {
    min-width: 0;
    max-width: 100%;
  }
}

