/* ==========================================================================
   HubboShip v2 - design system
   Strato sottile sopra Tabler. Regole:
   1. nessun colore scritto a mano fuori dai token qui sotto
   2. nessun selettore di elemento globale (button, input, table...)
      -> era la causa dei conflitti con Tabler nella v1
   3. nessun blocco dark: l'interfaccia e' dichiaratamente a tema chiaro
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Token
   -------------------------------------------------------------------------- */
:root {
  /* Marchio */
  --v2-primary:        #5145e5;
  --v2-primary-hover:  #4338ca;
  --v2-primary-soft:   #eef0fe;
  --v2-primary-border: #d5d8fb;

  /* Superfici */
  --v2-page:      #f6f7fb;
  --v2-surface:   #ffffff;
  --v2-subtle:    #f9fafc;
  --v2-border:    #e7e9f0;
  --v2-border-strong: #d5d9e4;

  /* Testo */
  --v2-text:      #131a2b;
  --v2-text-soft: #5a6478;   /* 5.95:1 su bianco */
  --v2-text-mute: #666f85;   /* 5.03:1 su bianco, 4.87:1 su --v2-subtle */

  /* Sidebar */
  --v2-side-bg:      #101527;
  --v2-side-bg-soft: #191f36;
  --v2-side-border:  #232a45;
  --v2-side-text:      #98a2bd;  /* 7.22:1 sul fondo sidebar */
  --v2-side-text-mute: #8791a6;  /* 5.81:1 sul fondo sidebar */
  --v2-side-text-hi:   #f4f6fc;

  /* Semantica */
  --v2-success: #0f9d6e;
  --v2-warning: #c2740a;
  --v2-danger:  #d92d3c;
  --v2-info:    #1f7ae0;

  /* Forma */
  --v2-r-sm: 7px;
  --v2-r-md: 10px;
  --v2-r-lg: 14px;
  --v2-r-pill: 999px;

  /* Elevazione: ombre basse e diffuse, niente "card che saltano" */
  --v2-shadow-xs: 0 1px 2px rgba(19, 26, 43, .05);
  --v2-shadow-sm: 0 1px 3px rgba(19, 26, 43, .06), 0 1px 2px rgba(19, 26, 43, .04);
  --v2-shadow-md: 0 4px 16px rgba(19, 26, 43, .07), 0 1px 3px rgba(19, 26, 43, .04);
  --v2-shadow-lg: 0 16px 40px rgba(19, 26, 43, .12);

  --v2-ring: 0 0 0 3px rgba(81, 69, 229, .18);
  --v2-ease: cubic-bezier(.4, 0, .2, 1);

  /* Ponte verso Tabler: da qui in poi i componenti del framework
     ereditano la nostra identita' senza bisogno di override puntuali. */
  --tblr-font-sans-serif: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --tblr-primary: var(--v2-primary);
  --tblr-primary-rgb: 81, 69, 229;
  --tblr-body-bg: var(--v2-page);
  --tblr-body-color: var(--v2-text);
  --tblr-border-color: var(--v2-border);
  --tblr-border-radius: var(--v2-r-md);
  --tblr-secondary: var(--v2-text-soft);
  --tblr-success: var(--v2-success);
  --tblr-warning: var(--v2-warning);
  --tblr-danger: var(--v2-danger);
  --tblr-info: var(--v2-info);
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */
.v2-body {
  background: var(--v2-page);
  color: var(--v2-text);
  font-family: var(--tblr-font-sans-serif);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv03", "cv04", "cv11";
}

.v2-body .page-wrapper { background: var(--v2-page); }
.v2-body .page-body { margin-top: 0; padding: 1.5rem 0 3rem; }
.v2-body .container-xl { max-width: 1440px; }

/* Anello di focus visibile e coerente: nella v1 diversi campi lo rimuovevano. */
.v2-body :focus-visible {
  outline: 2px solid var(--v2-primary);
  outline-offset: 2px;
  border-radius: var(--v2-r-sm);
}

.v2-body ::selection { background: var(--v2-primary-soft); color: var(--v2-primary-hover); }

@media (prefers-reduced-motion: reduce) {
  .v2-body *, .v2-body *::before, .v2-body *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

/* --------------------------------------------------------------------------
   3. Sidebar
   -------------------------------------------------------------------------- */
.v2-sidebar {
  background: var(--v2-side-bg);
  border-right: 1px solid var(--v2-side-border);
  box-shadow: none;
}
.v2-sidebar .container-fluid { padding-inline: 0; }

.v2-sidebar-inner {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  padding: 0 .75rem 1rem;
}

/* Marchio */
.v2-brand { margin: 0; padding: 1.15rem .75rem .9rem; }
.v2-brand a {
  display: flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  color: var(--v2-side-text-hi);
}
.v2-brand-mark {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: linear-gradient(140deg, var(--v2-primary) 0%, #7b6ef6 100%);
  color: #fff;
  font-size: 17px;
  box-shadow: 0 4px 12px rgba(81, 69, 229, .35);
}
.v2-brand-text {
  font-family: "Outfit", var(--tblr-font-sans-serif);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -.02em;
}
.v2-brand-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #a9b0ff;
  background: rgba(123, 110, 246, .16);
  border: 1px solid rgba(123, 110, 246, .3);
  border-radius: var(--v2-r-pill);
  padding: 1px 7px;
}

/* Scheda contesto */
.v2-context-card {
  background: var(--v2-side-bg-soft);
  border: 1px solid var(--v2-side-border);
  border-radius: var(--v2-r-md);
  padding: .8rem .85rem;
  margin-bottom: 1.1rem;
}
.v2-context-card-warn { border-color: rgba(194, 116, 10, .5); background: rgba(194, 116, 10, .12); }
.v2-context-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .07em;
  font-weight: 600;
  color: var(--v2-side-text-mute);
  display: flex; align-items: center; gap: .3rem;
}
.v2-context-name {
  color: var(--v2-side-text-hi);
  font-weight: 600;
  font-size: 14px;
  margin-top: .2rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.v2-context-metrics { display: flex; gap: .75rem; margin-top: .45rem; font-size: 12px; color: var(--v2-side-text); }
.v2-context-status { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .6rem; }

.v2-chip {
  display: inline-flex; align-items: center; gap: .25rem;
  font-size: 11px; font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--v2-r-pill);
  border: 1px solid transparent;
  white-space: nowrap;
}
.v2-chip i { font-size: 13px; }
.v2-chip-ok   { background: rgba(15, 157, 110, .16); color: #4ade9f; border-color: rgba(15, 157, 110, .35); }
.v2-chip-warn { background: rgba(194, 116, 10, .16); color: #f5c164; border-color: rgba(194, 116, 10, .35); }

/* Navigazione raggruppata: nella v1 erano 14 voci piatte senza gerarchia. */
.v2-nav { flex: 1; overflow-y: auto; margin: 0 -.25rem; padding: 0 .25rem; }
.v2-nav-group + .v2-nav-group { margin-top: 1.1rem; }
.v2-nav-group-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--v2-side-text-mute);
  padding: 0 .6rem .4rem;
}
.v2-nav-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }

.v2-nav-link {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .5rem .6rem;
  border-radius: var(--v2-r-sm);
  color: var(--v2-side-text);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  position: relative;
  transition: background .15s var(--v2-ease), color .15s var(--v2-ease);
}
.v2-nav-link:hover { background: rgba(255, 255, 255, .05); color: var(--v2-side-text-hi); }
.v2-nav-link.active {
  background: rgba(81, 69, 229, .18);
  color: #fff;
  font-weight: 600;
}
.v2-nav-link.active::before {
  content: "";
  position: absolute;
  left: -.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 18px;
  border-radius: 0 3px 3px 0;
  background: #8b7cff;
}
.v2-nav-icon { font-size: 17px; width: 20px; text-align: center; flex: none; opacity: .85; }
.v2-nav-link.active .v2-nav-icon { opacity: 1; color: #a99eff; }
.v2-nav-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Marcatore delle sezioni non ancora portate in v2 */
.v2-nav-flag {
  font-size: 9.5px; font-weight: 700; letter-spacing: .05em;
  color: var(--v2-side-text-mute);
  border: 1px solid #3a4468;
  border-radius: var(--v2-r-pill);
  padding: 0 5px;
  flex: none;
}

/* Piede sidebar: identita' + logout, sempre raggiungibili */
.v2-sidebar-footer {
  margin-top: 1rem;
  padding-top: .85rem;
  border-top: 1px solid var(--v2-side-border);
}
.v2-user { display: flex; align-items: center; gap: .6rem; padding: 0 .35rem .7rem; min-width: 0; }
.v2-user-avatar {
  width: 32px; height: 32px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--v2-primary) 0%, #7b6ef6 100%);
  color: #fff;
  font-size: 12px; font-weight: 700; letter-spacing: .02em;
}
.v2-user-info { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.v2-user-email {
  color: var(--v2-side-text-hi); font-size: 12.5px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.v2-user-role { color: var(--v2-side-text-mute); font-size: 11px; }

.v2-sidebar-actions { display: grid; gap: 1px; }
.v2-sidebar-action {
  display: flex; align-items: center; gap: .55rem;
  padding: .45rem .6rem;
  border-radius: var(--v2-r-sm);
  color: var(--v2-side-text);
  font-size: 13px; font-weight: 500;
  text-decoration: none;
  transition: background .15s var(--v2-ease), color .15s var(--v2-ease);
}
.v2-sidebar-action:hover { background: rgba(255, 255, 255, .05); color: var(--v2-side-text-hi); }
.v2-sidebar-action i { font-size: 16px; width: 18px; text-align: center; }
.v2-sidebar-action-danger:hover { background: rgba(217, 45, 60, .14); color: #ff8b95; }

/* Su schermi stretti la sidebar diventa una barra: teniamo il menu utente
   sempre visibile, perche' nella v1 sotto i 992px non si poteva uscire. */
@media (max-width: 991.98px) {
  .v2-sidebar .container-fluid { padding-inline: .75rem; }
  .v2-brand { padding: .5rem 0; }
  .v2-sidebar-inner { padding: .5rem 0 1rem; }
  .v2-context-card { margin-top: .5rem; }
}

/* --------------------------------------------------------------------------
   4. Topbar
   -------------------------------------------------------------------------- */
.v2-topbar {
  background: var(--v2-surface);
  border-bottom: 1px solid var(--v2-border);
  min-height: 52px;
  box-shadow: none;
}
.v2-topbar-hint {
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: 12.5px;
  color: var(--v2-text-soft);
  background: var(--v2-primary-soft);
  border: 1px solid var(--v2-primary-border);
  border-radius: var(--v2-r-pill);
  padding: .25rem .8rem;
}
.v2-topbar-hint i { color: var(--v2-primary); }

/* --------------------------------------------------------------------------
   5. Intestazione di pagina
   -------------------------------------------------------------------------- */
.v2-body .page-header {
  background: var(--v2-surface);
  border-bottom: 1px solid var(--v2-border);
  padding: 1.5rem 0 1.35rem;
  margin: 0;
}
.v2-body .page-pretitle {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--v2-primary);
  margin-bottom: .25rem;
}
.v2-body .page-title {
  font-family: "Outfit", var(--tblr-font-sans-serif);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -.025em;
  color: var(--v2-text);
  margin: 0;
  line-height: 1.2;
}
.v2-body .page-subtitle {
  color: var(--v2-text-soft);
  font-size: 13.5px;
  margin-top: .35rem;
  max-width: 76ch;
}
.v2-back {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: 12.5px; font-weight: 600;
  color: var(--v2-text-soft);
  text-decoration: none;
  margin-bottom: .4rem;
}
.v2-back:hover { color: var(--v2-primary); }

/* --------------------------------------------------------------------------
   6. Card
   -------------------------------------------------------------------------- */
.v2-body .card {
  background: var(--v2-surface);
  border: 1px solid var(--v2-border);
  border-radius: var(--v2-r-lg);
  box-shadow: var(--v2-shadow-xs);
}
.v2-body .card-header {
  background: transparent;
  border-bottom: 1px solid var(--v2-border);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 0;
}
.card-header-text { min-width: 0; flex: 1; }
.v2-body .card-title {
  font-size: 14.5px;
  font-weight: 650;
  letter-spacing: -.01em;
  color: var(--v2-text);
  margin: 0;
}
.card-subtitle {
  font-size: 12.5px;
  color: var(--v2-text-soft);
  margin: .2rem 0 0;
  line-height: 1.45;
}
.v2-body .card-actions { margin-left: auto; display: flex; align-items: center; gap: .5rem; flex: none; }
.v2-body .card-body { padding: 1.25rem; }
.v2-body .card-footer {
  background: var(--v2-subtle);
  border-top: 1px solid var(--v2-border);
  padding: .85rem 1.25rem;
  border-radius: 0 0 var(--v2-r-lg) var(--v2-r-lg);
}
.v2-body .card-table { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   7. Statistiche
   -------------------------------------------------------------------------- */
.card-stat { position: relative; transition: border-color .15s var(--v2-ease), box-shadow .15s var(--v2-ease); }
.card-stat:has(.card-stat-link):hover { border-color: var(--v2-border-strong); box-shadow: var(--v2-shadow-sm); }
.card-stat .card-body { padding: 1.1rem 1.25rem; }
.card-stat-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.card-stat-label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--v2-text-mute);
}
.card-stat-icon { font-size: 18px; opacity: .75; line-height: 1; }
.card-stat-value {
  font-family: "Outfit", var(--tblr-font-sans-serif);
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -.03em;
  color: var(--v2-text);
  margin-top: .5rem;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.card-stat-foot {
  display: flex; align-items: center; flex-wrap: wrap; gap: .45rem;
  margin-top: .5rem;
  font-size: 12.5px;
  color: var(--v2-text-soft);
}
.card-stat-delta { display: inline-flex; align-items: center; gap: .2rem; font-weight: 600; }
.card-stat-hint { color: var(--v2-text-mute); }
.card-stat-link { position: absolute; inset: 0; border-radius: inherit; }

/* --------------------------------------------------------------------------
   8. Bottoni
   -------------------------------------------------------------------------- */
.v2-body .btn {
  border-radius: var(--v2-r-sm);
  font-weight: 550;
  font-size: 13.5px;
  padding: .44rem .9rem;
  transition: background .15s var(--v2-ease), border-color .15s var(--v2-ease), box-shadow .15s var(--v2-ease);
}
.v2-body .btn i { font-size: 15px; }
.v2-body .btn-primary {
  background: var(--v2-primary);
  border-color: var(--v2-primary);
  box-shadow: var(--v2-shadow-xs);
}
.v2-body .btn-primary:hover,
.v2-body .btn-primary:focus { background: var(--v2-primary-hover); border-color: var(--v2-primary-hover); }
.v2-body .btn-secondary {
  background: var(--v2-surface);
  border-color: var(--v2-border-strong);
  color: var(--v2-text);
}
.v2-body .btn-secondary:hover { background: var(--v2-subtle); border-color: var(--v2-text-mute); color: var(--v2-text); }
.v2-body .btn-ghost-secondary { color: var(--v2-text-soft); border-color: transparent; background: transparent; }
.v2-body .btn-ghost-secondary:hover { background: var(--v2-subtle); color: var(--v2-text); }
.v2-body .btn-list { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

/* --------------------------------------------------------------------------
   9. Form
   -------------------------------------------------------------------------- */
.v2-body .form-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--v2-text-soft);
  margin-bottom: .35rem;
}
.v2-body .form-label.required::after { content: " *"; color: var(--v2-danger); }
.v2-body .form-control,
.v2-body .form-select {
  border-color: var(--v2-border-strong);
  border-radius: var(--v2-r-sm);
  font-size: 13.5px;
  padding: .44rem .7rem;
  color: var(--v2-text);
  background-color: var(--v2-surface);
  box-shadow: none;
  transition: border-color .15s var(--v2-ease), box-shadow .15s var(--v2-ease);
}
.v2-body .form-control:hover,
.v2-body .form-select:hover { border-color: var(--v2-text-mute); }
.v2-body .form-control:focus,
.v2-body .form-select:focus {
  border-color: var(--v2-primary);
  box-shadow: var(--v2-ring);
  outline: none;
}
.v2-body .form-control::placeholder { color: var(--v2-text-mute); }
.v2-body .form-control:disabled,
.v2-body .form-control[readonly] { background: var(--v2-subtle); color: var(--v2-text-soft); }
.v2-body .form-hint { font-size: 12px; color: var(--v2-text-mute); margin-top: .3rem; }
.v2-body .input-group-text {
  background: var(--v2-subtle);
  border-color: var(--v2-border-strong);
  color: var(--v2-text-soft);
  font-size: 13px;
}
.v2-body .form-check-input:checked { background-color: var(--v2-primary); border-color: var(--v2-primary); }
.v2-body .form-check-input:focus { box-shadow: var(--v2-ring); }
.v2-body .form-check-label { font-size: 13.5px; color: var(--v2-text); }

/* Barra filtri: identica in resi, analytics, qualita, eventi, spedizioni */
.v2-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: .75rem;
  padding: .9rem 1.25rem;
}
.v2-filter-field { flex: 0 1 auto; min-width: 150px; }
.v2-filter-field:first-child { flex: 1 1 220px; }
.v2-filter-field .mb-3 { margin-bottom: 0 !important; }
.v2-filter-actions { display: flex; gap: .4rem; align-items: center; margin-left: auto; }
@media (max-width: 575.98px) {
  .v2-filter-field, .v2-filter-actions { flex: 1 1 100%; min-width: 0; margin-left: 0; }
  .v2-filter-actions .btn { flex: 1; }
}

/* --------------------------------------------------------------------------
   10. Tabelle
   -------------------------------------------------------------------------- */
.v2-body .v2-table { font-size: 13.5px; margin-bottom: 0; }
.v2-body .v2-table > thead > tr > th {
  background: var(--v2-subtle);
  color: var(--v2-text-mute);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .65rem 1rem;
  border-bottom: 1px solid var(--v2-border);
  white-space: nowrap;
}
.v2-body .v2-table > tbody > tr > td {
  padding: .8rem 1rem;
  border-bottom: 1px solid var(--v2-border);
  vertical-align: middle;
  color: var(--v2-text);
}
.v2-body .v2-table > tbody > tr:last-child > td { border-bottom: 0; }
.v2-body .v2-table > tbody > tr { transition: background .12s var(--v2-ease); }
.v2-body .v2-table > tbody > tr:hover { background: var(--v2-subtle); }
.v2-body .v2-table-compact > tbody > tr > td { padding: .55rem 1rem; }
.v2-body .v2-table .text-end { font-variant-numeric: tabular-nums; }

.v2-cell-main { font-weight: 600; color: var(--v2-text); line-height: 1.35; }
.v2-cell-sub { font-size: 12px; color: var(--v2-text-mute); margin-top: .15rem; line-height: 1.4; }

.v2-code {
  background: var(--v2-subtle);
  border: 1px solid var(--v2-border);
  border-radius: var(--v2-r-sm);
  padding: 1px 6px;
  font-size: 12px;
  color: var(--v2-text-soft);
}

.v2-body .table-responsive { border-radius: 0 0 var(--v2-r-lg) var(--v2-r-lg); }

/* --------------------------------------------------------------------------
   11. Badge
   -------------------------------------------------------------------------- */
.badge-soft {
  display: inline-flex;
  align-items: center;
  gap: .28rem;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .01em;
  padding: .22rem .6rem;
  border-radius: var(--v2-r-pill);
  border: 1px solid transparent;
  white-space: nowrap;
  line-height: 1.5;
}
.badge-soft.badge-primary   { background: var(--v2-primary-soft); color: var(--v2-primary-hover); border-color: var(--v2-primary-border); }
.badge-soft.badge-success   { background: #e7f7f0; color: #0b7d57; border-color: #c2ead9; }
.badge-soft.badge-warning   { background: #fdf3e2; color: #9a5c05; border-color: #f6ddb4; }
.badge-soft.badge-danger    { background: #fdecee; color: #b02330; border-color: #f7ccd1; }
.badge-soft.badge-info      { background: #e8f2fd; color: #1a63b5; border-color: #c5ddf7; }
.badge-soft.badge-secondary { background: var(--v2-subtle); color: var(--v2-text-soft); border-color: var(--v2-border); }

.v2-dot-badge { display: inline-flex; align-items: center; gap: .4rem; font-size: 13px; }
.v2-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }

/* --------------------------------------------------------------------------
   12. Tab
   -------------------------------------------------------------------------- */
.v2-tabs { margin-bottom: 1.25rem; overflow-x: auto; scrollbar-width: thin; }
.v2-tabs .nav-tabs {
  border-bottom: 1px solid var(--v2-border);
  flex-wrap: nowrap;
  gap: .15rem;
}
.v2-tabs .nav-link {
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: .6rem .9rem;
  font-size: 13.5px;
  font-weight: 550;
  color: var(--v2-text-soft);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  transition: color .15s var(--v2-ease), border-color .15s var(--v2-ease);
}
.v2-tabs .nav-link:hover { color: var(--v2-text); border-bottom-color: var(--v2-border-strong); }
.v2-tabs .nav-link.active {
  color: var(--v2-primary);
  border-bottom-color: var(--v2-primary);
  background: transparent;
  font-weight: 650;
}

/* --------------------------------------------------------------------------
   13. Avvisi
   -------------------------------------------------------------------------- */
.v2-alert {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  border-radius: var(--v2-r-md);
  border-width: 1px;
  padding: .95rem 1.1rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--v2-shadow-xs);
}
.v2-alert-icon { font-size: 20px; line-height: 1; flex: none; margin-top: 1px; }
.v2-alert-body { flex: 1; min-width: 0; }
.v2-alert .alert-title { font-size: 13.5px; font-weight: 650; margin: 0 0 .15rem; }
.v2-alert-text { font-size: 13px; line-height: 1.5; opacity: .9; }
.v2-alert-action { flex: none; align-self: center; }

/* --------------------------------------------------------------------------
   14. Stati vuoti
   -------------------------------------------------------------------------- */
.v2-empty { padding: 3.5rem 1.5rem; text-align: center; }
.v2-empty-compact { padding: 2rem 1rem; }
.v2-empty-icon {
  width: 56px; height: 56px;
  margin: 0 auto .9rem;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--v2-primary-soft);
  color: var(--v2-primary);
  font-size: 26px;
}
.v2-empty-compact .v2-empty-icon { width: 44px; height: 44px; font-size: 21px; margin-bottom: .6rem; }
.v2-body .empty-title { font-size: 15px; font-weight: 650; color: var(--v2-text); margin: 0 0 .3rem; }
.v2-body .empty-subtitle { font-size: 13px; color: var(--v2-text-soft); margin: 0 auto; max-width: 44ch; }
.v2-body .empty-action { margin-top: 1.1rem; }

/* --------------------------------------------------------------------------
   15. Barre e grafico
   -------------------------------------------------------------------------- */
.v2-bars { display: grid; gap: .95rem; }
.v2-bar-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .35rem; }
.v2-bar-label {
  font-size: 13px; font-weight: 550; color: var(--v2-text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.v2-bar-value { font-size: 12.5px; font-weight: 650; color: var(--v2-text-soft); font-variant-numeric: tabular-nums; flex: none; }
.v2-bar-track { height: 6px; border-radius: var(--v2-r-pill); background: var(--v2-subtle); overflow: hidden; }
.v2-bar-fill {
  height: 100%;
  border-radius: var(--v2-r-pill);
  background: linear-gradient(90deg, var(--v2-primary) 0%, #7b6ef6 100%);
}

.v2-chart-meta { display: flex; align-items: baseline; gap: .6rem; margin-bottom: .5rem; flex-wrap: wrap; }
.v2-chart-total {
  font-family: "Outfit", var(--tblr-font-sans-serif);
  font-size: 1.6rem; font-weight: 700; letter-spacing: -.03em;
  color: var(--v2-text); font-variant-numeric: tabular-nums;
}
.v2-chart-caption { font-size: 12.5px; color: var(--v2-text-mute); }
.v2-chart-svg { width: 100%; height: 200px; display: block; overflow: visible; }
.v2-chart-grid { stroke: var(--v2-border); stroke-width: 1; stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }
.v2-chart-area { fill: rgba(81, 69, 229, .10); stroke: none; }
.v2-chart-line {
  fill: none;
  stroke: var(--v2-primary);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.v2-chart-dot { fill: var(--v2-surface); stroke: var(--v2-primary); stroke-width: 2; vector-effect: non-scaling-stroke; opacity: 0; transition: opacity .15s var(--v2-ease); }
.v2-chart:hover .v2-chart-dot { opacity: 1; }
.v2-chart-axis { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--v2-text-mute); margin-top: .4rem; }

/* --------------------------------------------------------------------------
   16. Timeline e step
   -------------------------------------------------------------------------- */
.v2-timeline { list-style: none; margin: 0; padding: 0; }
.v2-timeline-item { display: flex; gap: .85rem; position: relative; padding-bottom: 1.15rem; }
.v2-timeline-item:last-child { padding-bottom: 0; }
.v2-timeline-item::before {
  content: "";
  position: absolute;
  left: 13px; top: 28px; bottom: 0;
  width: 1px;
  background: var(--v2-border);
}
.v2-timeline-item:last-child::before { display: none; }
.v2-timeline-marker {
  width: 27px; height: 27px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--v2-surface);
  border: 1px solid var(--v2-border);
  font-size: 14px;
  z-index: 1;
}
.v2-timeline-content { min-width: 0; flex: 1; padding-top: .15rem; }
.v2-timeline-head { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; }
.v2-timeline-head b { font-size: 13.5px; font-weight: 600; color: var(--v2-text); }
.v2-timeline-head time { font-size: 11.5px; color: var(--v2-text-mute); flex: none; }
.v2-timeline-detail {
  margin: .35rem 0 0;
  font-size: 12.5px;
  color: var(--v2-text-soft);
  background: var(--v2-subtle);
  border: 1px solid var(--v2-border);
  border-radius: var(--v2-r-sm);
  padding: .5rem .7rem;
  line-height: 1.5;
  word-break: break-word;
}

.v2-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }
.v2-step { display: flex; align-items: center; gap: .7rem; padding: .55rem 0; position: relative; }
.v2-step-marker {
  width: 24px; height: 24px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  font-size: 13px;
  background: var(--v2-subtle);
  color: var(--v2-text-mute);
  border: 1px solid var(--v2-border);
}
.v2-step-done .v2-step-marker { background: #e7f7f0; color: #0b7d57; border-color: #c2ead9; }
.v2-step-current .v2-step-marker { background: var(--v2-primary-soft); color: var(--v2-primary); border-color: var(--v2-primary-border); box-shadow: var(--v2-ring); }
.v2-step-label { flex: 1; font-size: 13.5px; font-weight: 550; color: var(--v2-text); }
.v2-step-todo .v2-step-label { color: var(--v2-text-mute); font-weight: 500; }
.v2-step-date { font-size: 12px; color: var(--v2-text-mute); flex: none; }

/* --------------------------------------------------------------------------
   17. Liste di dettaglio e codice
   -------------------------------------------------------------------------- */
.v2-details { display: grid; grid-template-columns: minmax(110px, 34%) 1fr; gap: .55rem 1rem; margin: 0; font-size: 13.5px; }
.v2-details dt { color: var(--v2-text-soft); font-weight: 500; }
.v2-details dd { margin: 0; color: var(--v2-text); font-weight: 550; word-break: break-word; }
@media (max-width: 480px) { .v2-details { grid-template-columns: 1fr; gap: .1rem .5rem; } .v2-details dd { margin-bottom: .5rem; } }

.v2-codeblock { border: 1px solid var(--v2-border); border-radius: var(--v2-r-md); overflow: hidden; background: var(--v2-subtle); }
.v2-codeblock-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .5rem .75rem;
  border-bottom: 1px solid var(--v2-border);
  background: var(--v2-surface);
  font-size: 12.5px; font-weight: 600; color: var(--v2-text-soft);
}
.v2-codeblock-body {
  margin: 0;
  padding: .85rem;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.6;
  color: var(--v2-text);
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* --------------------------------------------------------------------------
   18. Feedback: progress, loader, toast
   -------------------------------------------------------------------------- */
.v2-progress {
  position: fixed; top: 0; left: 0; z-index: 2000;
  height: 2.5px; width: 0;
  background: linear-gradient(90deg, var(--v2-primary), #8b7cff);
  box-shadow: 0 0 8px rgba(81, 69, 229, .5);
  opacity: 0;
  transition: width .2s var(--v2-ease), opacity .25s var(--v2-ease);
}
.v2-progress.is-active { opacity: 1; }

.v2-loader {
  position: fixed; inset: 0; z-index: 1900;
  display: grid; place-items: center;
  background: rgba(246, 247, 251, .72);
  backdrop-filter: blur(2px);
}
.v2-loader[hidden] { display: none; }
.v2-loader-box {
  display: flex; align-items: center; gap: .7rem;
  background: var(--v2-surface);
  border: 1px solid var(--v2-border);
  border-radius: var(--v2-r-md);
  box-shadow: var(--v2-shadow-lg);
  padding: .9rem 1.3rem;
  font-size: 13.5px; font-weight: 550; color: var(--v2-text);
}
.v2-spinner {
  width: 17px; height: 17px; flex: none;
  border: 2px solid var(--v2-primary-border);
  border-top-color: var(--v2-primary);
  border-radius: 50%;
  animation: v2-spin .7s linear infinite;
}
@keyframes v2-spin { to { transform: rotate(360deg); } }

.v2-toasts {
  position: fixed; bottom: 1.25rem; right: 1.25rem; z-index: 2100;
  display: flex; flex-direction: column; gap: .55rem;
  max-width: min(380px, calc(100vw - 2.5rem));
  pointer-events: none;
}
.v2-toast {
  display: flex; align-items: flex-start; gap: .6rem;
  background: var(--v2-surface);
  border: 1px solid var(--v2-border);
  border-left: 3px solid var(--v2-text-mute);
  border-radius: var(--v2-r-md);
  box-shadow: var(--v2-shadow-lg);
  padding: .75rem .9rem;
  font-size: 13.5px;
  color: var(--v2-text);
  pointer-events: auto;
  transform: translateX(120%);
  transition: transform .3s var(--v2-ease), opacity .3s var(--v2-ease);
}
.v2-toast.is-visible { transform: translateX(0); }
.v2-toast.is-leaving { opacity: 0; transform: translateX(120%); }
.v2-toast-icon { font-size: 17px; line-height: 1.3; flex: none; }
.v2-toast-text { flex: 1; min-width: 0; word-break: break-word; }
.v2-toast-close {
  border: 0; background: transparent; padding: 0; margin: 0;
  color: var(--v2-text-mute); font-size: 16px; line-height: 1; cursor: pointer; flex: none;
}
.v2-toast-close:hover { color: var(--v2-text); }
.v2-toast-ok      { border-left-color: var(--v2-success); }
.v2-toast-ok      .v2-toast-icon { color: var(--v2-success); }
.v2-toast-error   { border-left-color: var(--v2-danger); }
.v2-toast-error   .v2-toast-icon { color: var(--v2-danger); }
.v2-toast-warning { border-left-color: var(--v2-warning); }
.v2-toast-warning .v2-toast-icon { color: var(--v2-warning); }
.v2-toast-info    { border-left-color: var(--v2-info); }
.v2-toast-info    .v2-toast-icon { color: var(--v2-info); }

@media (max-width: 575.98px) {
  .v2-toasts { left: 1rem; right: 1rem; bottom: 1rem; max-width: none; }
  .v2-toast { transform: translateY(140%); }
  .v2-toast.is-visible { transform: translateY(0); }
  .v2-toast.is-leaving { transform: translateY(140%); }
}

/* --------------------------------------------------------------------------
   19. Pagine senza shell: login, errori
   -------------------------------------------------------------------------- */
.v2-body-bare { background: var(--v2-page); }
.v2-body-bare .page-wrapper { display: grid; place-items: center; min-height: 100vh; }
.v2-body-bare .page-body { padding: 2rem 0; width: 100%; }

.v2-auth { width: 100%; max-width: 400px; margin: 0 auto; }
.v2-auth-brand {
  display: flex; align-items: center; justify-content: center; gap: .55rem;
  margin-bottom: 1.5rem;
  text-decoration: none;
  color: var(--v2-text);
}
.v2-auth-brand .v2-brand-mark { width: 34px; height: 34px; font-size: 19px; }
.v2-auth-brand-text { font-family: "Outfit", var(--tblr-font-sans-serif); font-weight: 700; font-size: 20px; letter-spacing: -.02em; }
.v2-auth-card { padding: 1.75rem; }
.v2-auth-title { font-family: "Outfit", var(--tblr-font-sans-serif); font-size: 1.25rem; font-weight: 700; letter-spacing: -.02em; margin: 0 0 .3rem; }
.v2-auth-text { font-size: 13.5px; color: var(--v2-text-soft); margin: 0 0 1.35rem; }
.v2-auth-foot { text-align: center; margin-top: 1.15rem; font-size: 12.5px; color: var(--v2-text-mute); }
.v2-auth-foot a { color: var(--v2-text-soft); font-weight: 550; }

.v2-error { text-align: center; padding: 3rem 1.5rem; max-width: 480px; margin: 0 auto; }
.v2-error-code {
  font-family: "Outfit", var(--tblr-font-sans-serif);
  font-size: 4rem; font-weight: 800; letter-spacing: -.05em;
  color: var(--v2-primary-border);
  line-height: 1;
}
.v2-error-title { font-family: "Outfit", var(--tblr-font-sans-serif); font-size: 1.35rem; font-weight: 700; margin: .5rem 0 .4rem; }
.v2-error-text { color: var(--v2-text-soft); font-size: 14px; margin-bottom: 1.5rem; }

/* --------------------------------------------------------------------------
   20. Utility
   -------------------------------------------------------------------------- */
.v2-body .row-stats { --tblr-gutter-y: 1rem; }
.v2-section-title {
  font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--v2-text-mute); margin: 1.75rem 0 .85rem;
}
.v2-section-title:first-child { margin-top: 0; }
.v2-muted { color: var(--v2-text-soft); font-size: 13px; }
.v2-nums { font-variant-numeric: tabular-nums; }

@media print {
  .v2-sidebar, .v2-topbar, .v2-progress, .v2-loader, .v2-toasts, .d-print-none { display: none !important; }
  .v2-body .page-wrapper { margin: 0; }
  .v2-body .card { box-shadow: none; border-color: #ccc; }
}

/* --------------------------------------------------------------------------
   21. Dashboard: checklist di configurazione
   -------------------------------------------------------------------------- */
.v2-setup-progress {
  width: 120px; height: 5px;
  border-radius: var(--v2-r-pill);
  background: var(--v2-subtle);
  overflow: hidden;
  display: block;
}
.v2-setup-progress-bar {
  height: 100%;
  border-radius: var(--v2-r-pill);
  background: linear-gradient(90deg, var(--v2-primary) 0%, #7b6ef6 100%);
  transition: width .4s var(--v2-ease);
}
.v2-setup-progress-label { font-size: 12px; color: var(--v2-text-mute); white-space: nowrap; }

.v2-setup-list { display: grid; gap: .35rem; }
.v2-setup-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .7rem .8rem;
  border: 1px solid var(--v2-border);
  border-radius: var(--v2-r-md);
  background: var(--v2-surface);
  text-decoration: none;
  color: inherit;
  transition: border-color .15s var(--v2-ease), background .15s var(--v2-ease);
}
.v2-setup-item:hover { border-color: var(--v2-primary-border); background: var(--v2-primary-soft); }
.v2-setup-item.is-done { background: var(--v2-subtle); border-color: transparent; }
.v2-setup-item.is-done:hover { background: var(--v2-subtle); border-color: var(--v2-border); }
.v2-setup-check { font-size: 21px; line-height: 1; flex: none; color: var(--v2-text-mute); }
.v2-setup-item.is-done .v2-setup-check { color: var(--v2-success); }
.v2-setup-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.4; }
.v2-setup-text b { font-size: 13.5px; font-weight: 600; color: var(--v2-text); }
.v2-setup-item.is-done .v2-setup-text b { color: var(--v2-text-soft); font-weight: 550; }
.v2-setup-text small { font-size: 12px; color: var(--v2-text-mute); }
.v2-setup-go { color: var(--v2-text-mute); font-size: 17px; flex: none; }
.v2-setup-item:hover .v2-setup-go { color: var(--v2-primary); }

/* --------------------------------------------------------------------------
   22. Dashboard: code di lavoro
   -------------------------------------------------------------------------- */
.v2-queue {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1.1rem 1.25rem;
  background: var(--v2-surface);
  border: 1px solid var(--v2-border);
  border-radius: var(--v2-r-lg);
  box-shadow: var(--v2-shadow-xs);
  text-decoration: none;
  color: inherit;
  transition: border-color .15s var(--v2-ease), box-shadow .15s var(--v2-ease);
}
.v2-queue:hover { border-color: var(--v2-border-strong); box-shadow: var(--v2-shadow-sm); color: inherit; }
.v2-queue.is-empty { opacity: .65; }
.v2-queue-icon { font-size: 20px; line-height: 1; margin-bottom: .55rem; }
.v2-queue-count {
  font-family: "Outfit", var(--tblr-font-sans-serif);
  font-size: 2rem; font-weight: 700; letter-spacing: -.03em;
  line-height: 1; color: var(--v2-text);
  font-variant-numeric: tabular-nums;
}
.v2-queue-label { font-size: 13.5px; font-weight: 600; color: var(--v2-text); margin-top: .3rem; }
.v2-queue-hint { font-size: 12px; color: var(--v2-text-mute); margin-top: .15rem; line-height: 1.4; }

/* --------------------------------------------------------------------------
   23. Dashboard: anteprima snippet
   -------------------------------------------------------------------------- */
.v2-snippet-preview {
  display: flex; align-items: center; flex-wrap: wrap; gap: .75rem;
  margin-top: 1rem;
  padding: 1rem;
  border: 1px dashed var(--v2-border-strong);
  border-radius: var(--v2-r-md);
  background: var(--v2-subtle);
}

/* --------------------------------------------------------------------------
   24. Resi: avvisi in tabella, paginazione
   -------------------------------------------------------------------------- */
.v2-cell-warn {
  display: inline-flex; align-items: center; gap: .25rem;
  margin-top: .2rem;
  font-size: 11.5px; font-weight: 600;
  color: var(--v2-warning);
}

.v2-pagination {
  display: flex; align-items: center; flex-wrap: wrap; gap: .75rem 1.25rem;
  padding: .85rem 1.25rem;
  border-top: 1px solid var(--v2-border);
  background: var(--v2-subtle);
  border-radius: 0 0 var(--v2-r-lg) var(--v2-r-lg);
}
.v2-pagination-info { font-size: 12.5px; color: var(--v2-text-soft); font-variant-numeric: tabular-nums; }
.v2-pagination-size { display: flex; align-items: center; gap: .45rem; margin: 0; }
.v2-pagination-size .form-label { font-size: 12.5px; color: var(--v2-text-soft); }
.v2-pagination-nav { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.v2-pagination-page { font-size: 12.5px; color: var(--v2-text-soft); white-space: nowrap; font-variant-numeric: tabular-nums; }
.v2-pagination .btn.disabled { opacity: .45; pointer-events: none; }
@media (max-width: 575.98px) {
  .v2-pagination-nav { margin-left: 0; width: 100%; justify-content: space-between; }
}

/* Card con contenuto lungo (timeline): scorre dentro se stessa */
.v2-scroll-card .card-body { max-height: 420px; overflow-y: auto; }

/* --------------------------------------------------------------------------
   25. Scheda RMA: foto e decisione rimborso
   -------------------------------------------------------------------------- */
.v2-photo-row { display: grid; grid-template-columns: minmax(180px, 240px) 1fr; gap: 1.25rem; align-items: start; }
.v2-photo-row + .v2-photo-row { margin-top: 1.1rem; padding-top: 1.1rem; border-top: 1px solid var(--v2-border); }
.v2-photo-grid { display: flex; flex-wrap: wrap; gap: .6rem; }
.v2-photo {
  width: 104px; height: 104px;
  border: 1px solid var(--v2-border);
  border-radius: var(--v2-r-md);
  overflow: hidden;
  background: var(--v2-subtle);
  display: block;
  transition: border-color .15s var(--v2-ease), box-shadow .15s var(--v2-ease);
}
.v2-photo:hover { border-color: var(--v2-primary); box-shadow: var(--v2-shadow-sm); }
.v2-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 767.98px) { .v2-photo-row { grid-template-columns: 1fr; gap: .6rem; } }

.v2-refund-list { display: grid; gap: .5rem; margin-bottom: 1.1rem; }
.v2-refund-row {
  display: grid;
  grid-template-columns: auto 1fr 170px;
  align-items: center;
  gap: 1rem;
  margin: 0;
  padding: .85rem 1rem;
  border: 1px solid var(--v2-border);
  border-radius: var(--v2-r-md);
  background: var(--v2-surface);
  cursor: pointer;
  transition: border-color .15s var(--v2-ease), background .15s var(--v2-ease);
}
.v2-refund-row:hover { border-color: var(--v2-border-strong); }
.v2-refund-row.is-checked { border-color: var(--v2-primary-border); background: var(--v2-primary-soft); }
.v2-refund-row .form-check-input { margin: 0; flex: none; }
.v2-refund-info { display: flex; flex-direction: column; min-width: 0; line-height: 1.45; }
.v2-refund-title { font-size: 13.5px; font-weight: 600; color: var(--v2-text); }
.v2-refund-meta { font-size: 12px; color: var(--v2-text-mute); }
.v2-refund-max { font-size: 12px; color: var(--v2-text-soft); margin-top: .15rem; }
.v2-refund-amount { justify-self: end; width: 100%; }
.v2-refund-amount .form-control { text-align: right; font-variant-numeric: tabular-nums; }

.v2-refund-row-deduct { border-style: dashed; }
.v2-refund-row-deduct.is-checked {
  background: #fdf3e2;
  border-color: #f6ddb4;
  border-style: solid;
}
.v2-refund-row-deduct .v2-refund-title { color: #9a5c05; }

.v2-refund-total {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  border-radius: var(--v2-r-md);
  background: var(--v2-primary-soft);
  border: 1px solid var(--v2-primary-border);
}
.v2-refund-total span { font-size: 13.5px; font-weight: 600; color: var(--v2-primary-hover); }
.v2-refund-total b {
  font-family: "Outfit", var(--tblr-font-sans-serif);
  font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em;
  color: var(--v2-primary-hover);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 575.98px) {
  .v2-refund-row { grid-template-columns: auto 1fr; gap: .6rem .75rem; }
  .v2-refund-amount { grid-column: 2; justify-self: stretch; }
}

/* --------------------------------------------------------------------------
   26. Analytics: insight ed eventi
   -------------------------------------------------------------------------- */
.v2-insights { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.v2-insight {
  display: flex; align-items: flex-start; gap: .7rem;
  padding: .7rem .85rem;
  border: 1px solid var(--v2-border);
  border-radius: var(--v2-r-md);
  background: var(--v2-subtle);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--v2-text);
}
.v2-insight-icon { font-size: 17px; line-height: 1.35; flex: none; }

.v2-event-detail {
  margin-top: .35rem;
  padding: .4rem .6rem;
  border-radius: var(--v2-r-sm);
  background: var(--v2-subtle);
  border: 1px solid var(--v2-border);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--v2-text-soft);
  word-break: break-word;
  max-width: 640px;
}

/* --------------------------------------------------------------------------
   27. Spedizioni
   -------------------------------------------------------------------------- */
.v2-quick-filters { display: flex; flex-wrap: wrap; gap: .4rem; padding: 1rem 1.25rem 0; }
.v2-quick-filter {
  padding: .3rem .8rem;
  border-radius: var(--v2-r-pill);
  border: 1px solid var(--v2-border-strong);
  background: var(--v2-surface);
  color: var(--v2-text-soft);
  font-size: 12.5px; font-weight: 600;
  text-decoration: none;
  transition: background .15s var(--v2-ease), color .15s var(--v2-ease), border-color .15s var(--v2-ease);
}
.v2-quick-filter:hover { background: var(--v2-subtle); color: var(--v2-text); }
.v2-quick-filter.active { background: var(--v2-primary); border-color: var(--v2-primary); color: #fff; }

.v2-bulk-bar {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem 1rem;
  padding: .9rem 1.25rem;
  background: var(--v2-subtle);
  border-top: 1px solid var(--v2-border);
  border-bottom: 1px solid var(--v2-border);
}
.v2-bulk-field { min-width: 140px; }
.v2-bulk-field .mb-3 { margin-bottom: 0 !important; }
.v2-bulk-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-left: auto; }
.v2-bulk-actions .btn:disabled { opacity: .5; }
@media (max-width: 767.98px) {
  .v2-bulk-field, .v2-bulk-actions { flex: 1 1 100%; margin-left: 0; }
}

.v2-inline-filters { display: flex; gap: .4rem; align-items: center; margin: 0; flex-wrap: wrap; }

.v2-order-items { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.v2-order-item { display: flex; gap: .6rem; align-items: baseline; font-size: 13.5px; }
.v2-order-qty { font-weight: 700; color: var(--v2-primary); font-variant-numeric: tabular-nums; flex: none; }
.v2-order-name { color: var(--v2-text); }
.v2-order-name small { display: block; color: var(--v2-text-mute); font-size: 11.5px; }

.v2-quote-box {
  border: 1px dashed var(--v2-border-strong);
  border-radius: var(--v2-r-md);
  padding: .7rem .85rem;
  background: var(--v2-subtle);
  display: flex; flex-direction: column; gap: .35rem; align-items: flex-start;
  margin-bottom: 1rem;
}
.v2-quote-label { font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--v2-text-mute); }
.v2-quote-value { font-size: 14px; font-weight: 650; color: var(--v2-text); }

.v2-cod-box {
  margin-top: 1.25rem;
  padding: 1rem 1.15rem;
  border: 1px solid #f6ddb4;
  border-radius: var(--v2-r-md);
  background: #fdf9f0;
}
.v2-cod-head {
  display: flex; align-items: center; gap: .4rem;
  font-size: 13px; font-weight: 700; color: #9a5c05;
  margin-bottom: .6rem;
}

/* --------------------------------------------------------------------------
   28. Superadmin
   -------------------------------------------------------------------------- */
.v2-danger-zone {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .85rem 1rem;
  border: 1px solid var(--v2-border);
  border-radius: var(--v2-r-md);
  background: var(--v2-subtle);
  margin: 0 0 .6rem;
}
.v2-danger-zone:last-child { margin-bottom: 0; }
.v2-danger-zone b { font-size: 13.5px; font-weight: 600; color: var(--v2-text); }
.v2-danger-zone .btn { flex: none; }
@media (max-width: 575.98px) {
  .v2-danger-zone { flex-direction: column; align-items: stretch; }
}

/* La modale eredita i token: senza questo Tabler userebbe i propri sfondi */
.v2-body .modal-content {
  border: 1px solid var(--v2-border);
  border-radius: var(--v2-r-lg);
  box-shadow: var(--v2-shadow-lg);
}
.v2-body .modal-header { border-bottom: 1px solid var(--v2-border); padding: 1rem 1.25rem; }
.v2-body .modal-title { font-size: 15px; font-weight: 650; }
.v2-body .modal-body { padding: 1.25rem; }

/* --------------------------------------------------------------------------
   29. Impostazioni
   -------------------------------------------------------------------------- */
.v2-settings-section {
  display: grid;
  grid-template-columns: minmax(200px, 300px) minmax(0, 1fr);
  gap: 1.5rem 2.5rem;
  padding: 1.5rem 0;
}
.v2-settings-section + .v2-settings-section { border-top: 1px solid var(--v2-border); }
.v2-settings-section:first-child { padding-top: 0; }
.v2-settings-aside h3 {
  font-size: 14.5px; font-weight: 650; color: var(--v2-text); margin: 0 0 .3rem;
}
.v2-settings-aside p {
  font-size: 12.5px; color: var(--v2-text-soft); line-height: 1.5; margin: 0;
}
.v2-settings-fields > .mb-3:last-child { margin-bottom: 0 !important; }
@media (max-width: 991.98px) {
  .v2-settings-section { grid-template-columns: 1fr; gap: .75rem; }
}

/* --------------------------------------------------------------------------
   30. Anteprima del portale cliente
   -------------------------------------------------------------------------- */
.v2-portal-preview {
  margin: 1.25rem;
  border: 1px solid var(--v2-border-strong);
  border-radius: var(--v2-r-md);
  overflow: hidden;
  background: var(--v2-surface);
  box-shadow: var(--v2-shadow-sm);
}
.v2-portal-preview-bar {
  display: flex; align-items: center; gap: .6rem;
  padding: .5rem .75rem;
  background: var(--v2-subtle);
  border-bottom: 1px solid var(--v2-border);
}
.v2-portal-preview-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--v2-border-strong);
  box-shadow: 14px 0 0 var(--v2-border-strong), 28px 0 0 var(--v2-border-strong);
  margin-right: 28px;
  flex: none;
}
.v2-portal-preview-url {
  font-size: 11.5px; color: var(--v2-text-mute);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: "SFMono-Regular", Consolas, monospace;
}
.v2-portal-preview-frame {
  width: 100%; height: 620px; border: 0; display: block; background: #fff;
}
@media (max-width: 1199.98px) { .v2-portal-preview-frame { height: 460px; } }

/* --------------------------------------------------------------------------
   31. Template email, traduzioni, regole
   -------------------------------------------------------------------------- */
.v2-vars { display: flex; flex-wrap: wrap; gap: .35rem; }
.v2-var {
  border: 1px solid var(--v2-primary-border);
  background: var(--v2-primary-soft);
  color: var(--v2-primary-hover);
  border-radius: var(--v2-r-sm);
  padding: .2rem .5rem;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11.5px;
  cursor: pointer;
  transition: background .15s var(--v2-ease);
}
.v2-var:hover { background: var(--v2-primary); color: #fff; border-color: var(--v2-primary); }

.v2-sticky-save {
  position: sticky; bottom: 1rem; z-index: 20;
  display: flex; justify-content: flex-end;
  margin-top: 1.25rem;
  padding: .75rem 1rem;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(8px);
  border: 1px solid var(--v2-border);
  border-radius: var(--v2-r-md);
  box-shadow: var(--v2-shadow-md);
}

.v2-translation {
  display: grid;
  grid-template-columns: minmax(160px, 260px) 1fr 1fr;
  gap: .75rem 1.25rem;
  align-items: start;
  padding: 1rem 0;
}
.v2-translation + .v2-translation { border-top: 1px solid var(--v2-border); }
.v2-translation:first-child { padding-top: 0; }
.v2-translation-key { padding-top: 1.7rem; word-break: break-word; }
.v2-translation-field .mb-3 { margin-bottom: 0 !important; }
@media (max-width: 991.98px) {
  .v2-translation { grid-template-columns: 1fr; gap: .5rem; }
  .v2-translation-key { padding-top: 0; }
}

.v2-conditions { display: grid; gap: .4rem; margin-bottom: .75rem; }
.v2-condition {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: .45rem .7rem;
  border: 1px solid var(--v2-border);
  border-radius: var(--v2-r-sm);
  background: var(--v2-subtle);
  font-size: 13px;
  color: var(--v2-text);
}
.v2-condition-remove {
  border: 0; background: transparent; color: var(--v2-text-mute);
  font-size: 17px; line-height: 1; cursor: pointer; padding: 0 .2rem;
}
.v2-condition-remove:hover { color: var(--v2-danger); }
.v2-condition-builder { display: flex; flex-wrap: wrap; gap: .4rem; }
.v2-condition-builder .form-select { width: auto; flex: 0 1 auto; }
.v2-condition-builder .form-control { flex: 1 1 140px; min-width: 120px; }

.v2-rule-order {
  display: inline-grid; place-items: center;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--v2-primary-soft);
  color: var(--v2-primary-hover);
  font-size: 12px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   32. Profilo, wallet e piani
   -------------------------------------------------------------------------- */
.v2-wallet { display: flex; flex-direction: column; gap: .15rem; margin-bottom: 1rem; }
.v2-wallet-label {
  font-size: 11.5px; font-weight: 600; letter-spacing: .05em;
  text-transform: uppercase; color: var(--v2-text-mute);
}
.v2-wallet-value {
  font-family: "Outfit", var(--tblr-font-sans-serif);
  font-size: 2rem; font-weight: 700; letter-spacing: -.03em; line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.v2-wallet-form { display: flex; align-items: flex-end; gap: .6rem; flex-wrap: wrap; }
.v2-wallet-form .mb-3 { margin-bottom: 0 !important; flex: 1 1 180px; }

.v2-plan { position: relative; }
.v2-plan.is-current { border-color: var(--v2-primary); box-shadow: var(--v2-ring); }
.v2-plan-flag {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  background: var(--v2-primary); color: #fff;
  font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: .15rem .7rem; border-radius: var(--v2-r-pill);
  white-space: nowrap;
}
.v2-plan-name {
  font-family: "Outfit", var(--tblr-font-sans-serif);
  font-size: 1.15rem; font-weight: 700; letter-spacing: -.02em; color: var(--v2-text);
}
.v2-plan-price {
  font-family: "Outfit", var(--tblr-font-sans-serif);
  font-size: 1.6rem; font-weight: 700; letter-spacing: -.03em;
  color: var(--v2-primary); margin: .2rem 0 .5rem;
}
.v2-plan-desc { font-size: 13px; color: var(--v2-text-soft); line-height: 1.5; margin: 0 0 .75rem; min-height: 2.6em; }
.v2-plan-limit {
  font-size: 12.5px; font-weight: 650; color: var(--v2-text);
  padding: .4rem .6rem; border-radius: var(--v2-r-sm);
  background: var(--v2-subtle); border: 1px solid var(--v2-border);
  margin-bottom: .85rem;
}
.v2-plan-features { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.v2-plan-features li {
  display: flex; align-items: flex-start; gap: .4rem;
  font-size: 13px; color: var(--v2-text-soft); line-height: 1.45;
}
.v2-plan-features i { color: var(--v2-success); font-size: 15px; line-height: 1.3; flex: none; }
