@charset "UTF-8";
.pw-wrap {
  position: relative;
  display: block;
}
.pw-wrap input {
  width: 100%;
  padding-right: 2.75rem !important;
}
.pw-wrap .pw-toggle {
  position: absolute;
  top: 50%;
  right: 0.5rem;
  transform: translateY(-50%);
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: var(--radius);
  color: var(--white-40);
  cursor: pointer;
  padding: 0;
  transition: color 0.2s, background 0.2s;
}
.pw-wrap .pw-toggle svg {
  width: 18px;
  height: 18px;
  display: block;
}
.pw-wrap .pw-toggle:hover {
  color: var(--white);
  background: var(--white-06);
}
.pw-wrap .pw-toggle:focus-visible {
  outline: none;
  color: var(--white);
  box-shadow: 0 0 0 2px rgba(212, 46, 46, 0.25);
}

A.btn-primary:hover {
  color: #fff;
}

#L5 {
  width: 100%;
}

.auth-card .auth-icon {
  margin: 0 auto 10px;
}

.error-msg {
  color: var(--error);
  font-size: 0.82rem;
  margin-top: -0.75rem;
  margin-bottom: 1rem;
  display: none !important;
}
.error-msg.visible {
  display: flex !important;
}

/* =====================================================================
   JoeSMTP - Design System (centralizzato)
   Palette: Indigo Pro
   Stack: HTML + CSS + jQuery (target finale: PHP/MySQL)
   ===================================================================== */
:root {
  /* Brand */
  --bg: #0F172A; /* navy profondo */
  --surface: #111A30; /* card scuro */
  --surface-2: #1E293B; /* hover / striping */
  --border: #243049;
  --primary: #4F46E5; /* indigo */
  --primary-2: #6366F1;
  --primary-soft: #A5B4FC;
  /* Light surface (per aree contenuto) */
  --paper: #F7F8FC;
  --paper-2: #FFFFFF;
  --ink: #0F172A;
  --ink-soft: #475569;
  --ink-mute: #94A3B8;
  --line: #E5E8F0;
  /* Status */
  --ok: #10B981;
  --warn: #F59E0B;
  --err: #EF4444;
  --info: #3B82F6;
  /* Shape */
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.06);
  --shadow: 0 6px 20px rgba(15,23,42,.08);
  --shadow-lg: 0 20px 40px rgba(15,23,42,.18);
  /* Layout */
  --sidebar-w: 248px;
  --sidebar-w-collapsed: 64px;
  --header-h: 60px;
  /* Type */
  --font-display: "Space Grotesk", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-body: "DM Sans", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

/* Reset minimale */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  margin: 0 0 0.25em;
  letter-spacing: -0.01em;
}

h1 {
  font-size: 24px;
}

h2 {
  font-size: 18px;
}

h3 {
  font-size: 15px;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  color: var(--primary-2);
}

small, .muted {
  color: var(--ink-mute);
}

/* ============== AUTH (login) ============== */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(1200px 600px at 80% -10%, rgba(99, 102, 241, 0.35), transparent 60%), radial-gradient(900px 500px at -10% 110%, rgba(79, 70, 229, 0.28), transparent 60%), var(--bg);
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--paper-2);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: var(--shadow-lg);
}

.auth-card .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.auth-card .brand img {
  width: 36px;
  height: 36px;
}

.auth-card .brand b {
  font-family: var(--font-display);
  font-size: 20px;
}

.auth-card .brand span {
  color: var(--primary);
}

/* ============== LAYOUT APP ============== */
.app {
  display: flex;
  min-height: 100vh;
  background: var(--paper);
}

.sidebar {
  width: var(--sidebar-w);
  background: var(--bg);
  color: #CBD5E1;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  transition: width 0.2s ease;
  border-right: 1px solid #0a1226;
}

.sidebar.collapsed {
  width: var(--sidebar-w-collapsed);
}

.sidebar .brand {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border-bottom: 1px solid #1a2542;
  white-space: nowrap;
}

.sidebar .brand img {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
}

.sidebar .brand b {
  font-family: var(--font-display);
  color: #fff;
  font-size: 16px;
}

.sidebar .brand span {
  color: var(--primary-soft);
}

.sidebar.collapsed .brand .brand-text,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-section {
  display: none;
}

.sidebar.collapsed .project-switcher {
  display: none;
}

/* Project switcher */
.project-switcher {
  padding: 10px 14px 12px;
  border-bottom: 1px solid #1a2542;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.project-switcher .proj-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748B;
  font-weight: 600;
}

.project-switcher .proj-select {
  width: 100%;
  background: #0f1830;
  color: #fff;
  border: 1px solid #1f2c4f;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23A5B4FC' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

.project-switcher .proj-select:hover {
  border-color: #2d3d6a;
}

.project-switcher .proj-select:focus {
  border-color: var(--primary, #4F46E5);
}

.project-switcher .proj-select:disabled {
  opacity: 0.5;
  cursor: wait;
}

.project-switcher .proj-single {
  background: #0f1830;
  border: 1px solid #1f2c4f;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

.sidebar .nav {
  padding: 14px 8px;
  flex: 1;
  overflow-y: auto;
}

.sidebar .nav-section {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748B;
  padding: 14px 12px 6px;
}

.sidebar a.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  color: #CBD5E1;
  font-weight: 500;
  font-size: 13.5px;
  margin: 2px 0;
}

.sidebar a.nav-item:hover {
  background: #182240;
  color: #fff;
}

.sidebar a.nav-item.active {
  background: linear-gradient(90deg, rgba(79, 70, 229, 0.25), rgba(79, 70, 229, 0.05));
  color: #fff;
  box-shadow: inset 3px 0 0 var(--primary);
}

.sidebar a.nav-item .icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-soft);
}

.sidebar .footer-pin {
  padding: 12px;
  border-top: 1px solid #1a2542;
}

/* Expandable "Info & Legale" group in the footer-pin */
.sidebar .nav-item-toggle {
  cursor: pointer;
}

.sidebar .nav-item-toggle .nav-caret {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  color: #64748B;
  transition: transform 0.2s ease;
}

.sidebar .nav-group.open .nav-item-toggle .nav-caret {
  transform: rotate(180deg);
}

.sidebar .nav-submenu {
  display: none;
  padding: 2px 0 2px 12px;
  margin-left: 10px;
  border-left: 1px solid #1a2542;
}

.sidebar .nav-group.open .nav-submenu {
  display: block;
}

.sidebar a.nav-subitem {
  padding: 8px 12px;
  font-size: 12.5px;
  color: #94A3B8;
}

.sidebar a.nav-subitem:hover {
  background: #182240;
  color: #fff;
}

/* Collapsed sidebar: hide caret and submenu (labels are hidden too) */
.sidebar.collapsed .nav-caret,
.sidebar.collapsed .nav-submenu {
  display: none;
}

/* Main area */
.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--header-h);
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar .toggle {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--line);
  cursor: pointer;
  color: var(--ink-soft);
}

.topbar .toggle:hover {
  background: var(--paper);
}

.topbar .page-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
}

.topbar .spacer {
  flex: 1;
}

.credits-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.1), rgba(99, 102, 241, 0.18));
  border: 1px solid rgba(79, 70, 229, 0.25);
  color: var(--primary);
  font-weight: 600;
  font-size: 13px;
}

.credits-pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
}

.credits-pill a {
  color: var(--primary);
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper-2);
  cursor: pointer;
}

.user-chip .avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.user-chip .who {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.user-chip .who b {
  font-size: 12.5px;
}

.user-chip .who span {
  font-size: 11px;
  color: var(--ink-mute);
}

.user-menu {
  position: absolute;
  top: 54px;
  right: 16px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 220px;
  padding: 6px;
  display: none;
  z-index: 30;
}

.user-menu.open {
  display: block;
}

.user-menu a {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--ink);
  font-size: 13px;
}

.user-menu a:hover {
  background: var(--paper);
}

.user-menu hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 6px 0;
}

/* Content */
.content {
  padding: 22px 26px 60px;
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
  min-width: 0;
  overflow-x: hidden;
}

.main {
  min-width: 0;
  overflow-x: hidden;
}

@media (max-width: 640px) {
  .content {
    padding: 16px 14px 60px;
  }
}
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.page-head p {
  margin: 4px 0 0;
  color: var(--ink-soft);
}

/* ============== CARD / TABLE / FORM (riusabili) ============== */
.card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.card .card-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.card .card-head > button, .card .card-head > .btn, .card .card-head > a {
  flex: 0 0 auto;
  align-self: center;
}

.card .card-head h2 {
  margin: 0;
  font-size: 15px;
}

.card .card-body {
  padding: 16px 18px;
}

.card .card-foot {
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 1000px) {
  .grid.cols-3, .grid.cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 640px) {
  .grid.cols-2, .grid.cols-3, .grid.cols-4 {
    grid-template-columns: 1fr;
  }
}
.kpi {
  padding: 16px 18px;
}

.kpi .label {
  color: var(--ink-mute);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.kpi .value {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  margin-top: 4px;
}

.kpi .delta {
  font-size: 12px;
  margin-top: 4px;
}

.kpi .delta.up {
  color: var(--ok);
}

.kpi .delta.down {
  color: var(--err);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13.5px;
  border: 1px solid transparent;
  cursor: pointer;
  user-select: none;
  background: var(--paper-2);
  color: var(--ink);
  border-color: var(--line);
  transition: transform 0.04s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  background: var(--paper);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-2);
  border-color: var(--primary-2);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
}

.btn-ghost:hover {
  background: var(--paper);
}

.btn-danger {
  background: #fff;
  color: var(--err);
  border-color: #fecaca;
}

.btn-danger:hover {
  background: #fff5f5;
}

.btn-sm {
  height: 30px;
  padding: 0 10px;
  font-size: 12.5px;
  border-radius: 6px;
}

.btn .icon {
  width: 16px;
  height: 16px;
}

/* Inputs */
.field {
  display: block;
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.input, .select, .textarea {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--paper-2);
  color: var(--ink);
  font: inherit;
  outline: none;
}

.textarea {
  height: auto;
  padding: 10px 12px;
  min-height: 90px;
  resize: vertical;
}

.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.18);
}

.help {
  font-size: 12px;
  color: var(--ink-mute);
  margin-top: 6px;
}

/* Table */
.table-wrap {
  overflow-x: auto;
}

table.tbl {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

table.tbl th, table.tbl td {
  padding: 12px 14px;
  text-align: left;
  vertical-align: middle;
}

table.tbl thead th {
  background: var(--paper);
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
}

table.tbl tbody tr {
  border-bottom: 1px solid var(--line);
}

table.tbl tbody tr:hover {
  background: #fbfbfe;
}

table.tbl td .rate {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

/* Status pill */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  background: #EEF2FF;
  color: var(--primary);
}

.pill.ok {
  background: #ECFDF5;
  color: var(--ok);
}

.pill.warn {
  background: #FFFBEB;
  color: var(--warn);
}

.pill.err {
  background: #FEF2F2;
  color: var(--err);
}

.pill.info {
  background: #EFF6FF;
  color: var(--info);
}

.pill.muted {
  background: #F1F5F9;
  color: var(--ink-soft);
}

.pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex-wrap: nowrap;
  max-width: 100%;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tabs button, .tabs a.tab {
  background: none;
  border: none;
  padding: 10px 14px;
  cursor: pointer;
  font: inherit;
  color: var(--ink-soft);
  border-bottom: 2px solid transparent;
  font-weight: 600;
  white-space: nowrap;
  flex: 0 0 auto;
}

.tabs button.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Stepper (wizard) */
.stepper {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  max-width: 100%;
  padding-bottom: 4px;
}

.stepper::-webkit-scrollbar {
  display: none;
}

.stepper .step {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  flex: 0 0 auto;
}

.stepper .step .n {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.stepper .step.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.stepper .step.active .n {
  background: rgba(255, 255, 255, 0.25);
  border-color: transparent;
  color: #fff;
}

.stepper .step.done {
  background: #EEF2FF;
  color: var(--primary);
  border-color: #C7D2FE;
}

.stepper .sep {
  flex: 0 0 28px;
  height: 1px;
  background: var(--line);
}

@media (max-width: 640px) {
  .stepper .step {
    padding: 7px 11px;
    font-size: 12.5px;
    gap: 7px;
  }
  .stepper .step .num, .stepper .step .n {
    width: 20px;
    height: 20px;
    font-size: 11px;
  }
}
/* Wizard step container */
.wizard-step {
  display: none;
}

.wizard-step.active {
  display: block;
}

.wizard-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 22px;
}

/* Filtri condizioni */
.cond-row {
  display: grid;
  grid-template-columns: 90px 1fr 160px 1fr 36px;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.cond-row .logic {
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  border-radius: 8px;
  font-weight: 700;
  color: var(--ink-soft);
  border: 1px solid var(--line);
}

.cond-row .input, .cond-row .select {
  height: 38px;
}

.icon-btn {
  width: 36px;
  height: 38px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  cursor: pointer;
}

.icon-btn:hover {
  background: var(--paper);
  color: var(--err);
  border-color: #fecaca;
}

@media (max-width: 720px) {
  .cond-row {
    grid-template-columns: 70px 1fr 1fr;
  }
  .cond-row .field-3, .cond-row .field-4 {
    grid-column: span 2;
  }
}
/* CSV importer */
.dropzone {
  border: 2px dashed #C7D2FE;
  background: #F5F7FF;
  border-radius: var(--radius-lg);
  padding: 38px 20px;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.dropzone:hover, .dropzone.drag {
  background: #EEF2FF;
  border-color: var(--primary);
}

.dropzone .ico {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  margin-bottom: 10px;
}

.dropzone h3 {
  font-family: var(--font-display);
  font-size: 16px;
}

.dropzone p {
  color: var(--ink-soft);
  margin: 4px 0 0;
  font-size: 13px;
}

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

.mapping-table th, .mapping-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.mapping-table th {
  font-size: 11.5px;
  text-transform: uppercase;
  color: var(--ink-soft);
  letter-spacing: 0.05em;
  background: var(--paper);
}

.mapping-table .preview {
  color: var(--ink-mute);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

/* Modal */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 16px;
}

.modal-bg.open {
  display: flex;
}

.modal {
  background: var(--paper-2);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 32px);
}

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

.modal .body {
  padding: 18px;
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
}

.modal .foot {
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.modal.lg {
  max-width: 820px;
}

/* Toast */
.toast-wrap {
  position: fixed;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 100;
}

.toast {
  background: #111A30;
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  min-width: 220px;
  border-left: 3px solid var(--primary);
}

.toast.ok {
  border-left-color: var(--ok);
}

.toast.err {
  border-left-color: var(--err);
}

.toast.warn {
  border-left-color: var(--warn);
}

/* Toast "hero": prima fase grande e centrata (vedi JoeSMTP._errToast).
   Alla seconda fase il JS rimuove .toast-hero e sposta il nodo in #toasts. */
.toast-hero {
  position: fixed;
  left: 50%;
  top: 26%;
  transform: translate(-50%, -12px) scale(0.96);
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(560px, 92vw);
  padding: 18px 22px;
  font-size: 15px;
  line-height: 1.4;
  border-left-width: 4px;
  opacity: 0;
  z-index: 1000;
  transition: opacity 0.24s ease, transform 0.24s ease;
}

.toast-hero.show {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.toast-hero-ico {
  flex: 0 0 auto;
  display: inline-flex;
}

.toast-hero-ico svg {
  width: 22px;
  height: 22px;
}

.toast-hero.err .toast-hero-ico {
  color: var(--err);
}

.toast-hero.warn .toast-hero-ico {
  color: var(--warn);
}

.toast-hero-msg {
  flex: 1 1 auto;
}

/* Column picker */
.col-picker {
  position: absolute;
  top: 44px;
  right: 0;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 10px;
  min-width: 220px;
  z-index: 30;
  display: none;
}

.col-picker.open {
  display: block;
}

.col-picker label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  font-size: 13px;
}

/* Misc */
.row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.row.between {
  justify-content: space-between;
}

.row.wrap {
  flex-wrap: wrap;
}

.spacer-y {
  height: 16px;
}

.hidden {
  display: none !important;
}

.search {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  height: 36px;
  min-width: 240px;
}

.search input {
  border: none;
  outline: none;
  background: transparent;
  flex: 1;
  font: inherit;
  color: var(--ink);
}

/* Sidebar credits link (visible only on mobile) */
.sidebar-credits {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  border-radius: 8px;
  background: #182240;
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid #1f2c52;
}

.sidebar-credits .icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  flex: 0 0 18px;
  color: var(--primary-soft);
}

.sidebar-credits b {
  color: var(--primary-soft);
  font-weight: 700;
}

/* Mobile sidebar overlay */
@media (max-width: 880px) {
  .sidebar {
    position: fixed;
    z-index: 60;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    width: min(86vw, 300px);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.25);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar.collapsed {
    width: min(86vw, 300px);
  } /* su mobile annulla collapse */
  .sidebar.collapsed .brand-text,
  .sidebar.collapsed .nav-label,
  .sidebar.collapsed .nav-section {
    display: initial;
  }
  .scrim {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 55;
    display: none;
  }
  .scrim.open {
    display: block;
  }
  /* Crediti: solo nel menu laterale su mobile */
  .topbar .credits-pill {
    display: none;
  }
  .sidebar-credits {
    display: inline-flex;
  }
  /* User chip: solo avatar */
  .user-chip {
    padding: 0;
    border: none;
    background: transparent;
  }
  .user-chip .who {
    display: none;
  }
  /* Topbar più compatta */
  .topbar {
    padding: 0 12px;
    gap: 8px;
  }
  .topbar .page-title {
    font-size: 14px;
  }
}
/* GrapesJS host */
#gjs {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 520px;
}

/* Email preview iframe */
.email-preview {
  width: 100%;
  height: 520px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

/* ============== App layout (shell) ============== */
.app {
  display: flex;
  min-height: 100vh;
  background: var(--paper);
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.sidebar {
  display: flex;
  flex-direction: column;
}

/* Topbar fixes */
.topbar {
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
  padding: 0 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  height: var(--header-h);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar .toggle {
  background: transparent;
  border: 1px solid var(--line);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink-soft);
}

/* Sidebar nav */
.sidebar .nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 8px;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 2px;
}

.sidebar .nav-item .icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  flex: 0 0 18px;
}

/* Helpers */
.right {
  text-align: right;
}

.small {
  font-size: 12px;
}

.empty {
  text-align: center;
  color: var(--ink-mute);
  padding: 28px 10px;
  font-style: italic;
}

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

@media (max-width: 1000px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 560px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
}
.kpi-card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}

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

.kpi-value {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  margin-top: 6px;
  color: var(--ink);
}

.kpi-sub {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 4px;
}

/* Generic .table (alias di .tbl) */
table.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

table.table th, table.table td {
  padding: 11px 14px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
}

table.table thead th {
  background: var(--paper);
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

table.table tbody tr:hover {
  background: #fbfbfe;
}

table.table.small th, table.table.small td {
  padding: 8px 10px;
  font-size: 12.5px;
}

/* Intestazioni ordinabili: clic per ordinare (asc → desc → default) */
table.table thead th.sortable {
  cursor: pointer;
  user-select: none;
}

table.table thead th.sortable:hover {
  color: var(--primary);
}

table.table thead th.sortable .sort-ind {
  font-size: 10px;
  color: var(--primary);
}

/* Toolbar (filtri pagina) */
.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.toolbar .search {
  flex: 1;
  min-width: 240px;
}

/* Form grid */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 18px 22px;
}

@media (max-width: 700px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}
.card-foot.row {
  padding: 12px 22px;
}

/* Tabs (anchor) */
.tabs a.tab {
  display: inline-block;
  padding: 10px 14px;
  color: var(--ink-soft);
  border-bottom: 2px solid transparent;
  font-weight: 600;
  font-size: 13.5px;
  text-decoration: none;
}

.tabs a.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Plans (pacchetti crediti) */
.plans {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding: 18px 22px;
}

@media (max-width: 800px) {
  .plans {
    grid-template-columns: 1fr;
  }
}
.plan {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  background: var(--paper-2);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.plan.featured {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.plan .badge {
  position: absolute;
  top: -10px;
  right: 14px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 700;
}

.plan-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
}

.plan-credits {
  color: var(--ink-soft);
  font-size: 13px;
}

.plan-price {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  margin: 6px 0 12px;
}

.plan .btn {
  margin-top: auto;
}

.big-number {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  color: var(--ink);
}

/* Stepper number alias (.num) */
.stepper .step .num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.stepper .step.active .num {
  background: rgba(255, 255, 255, 0.25);
  border-color: transparent;
  color: #fff;
}

/* Filters (wizard step 2) */
.filters {
  padding: 14px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-row {
  display: grid;
  grid-template-columns: 1fr 130px 1fr 40px;
  gap: 8px;
  align-items: center;
}

@media (max-width: 700px) {
  .filter-row {
    grid-template-columns: 1fr 1fr;
  }
}
/* Upload zone */
.upload-zone {
  border: 2px dashed #C7D2FE;
  background: #F5F7FF;
  border-radius: var(--radius-lg);
  padding: 28px;
  text-align: center;
  color: var(--ink-soft);
  cursor: pointer;
}

.upload-zone:hover {
  background: #EEF2FF;
  border-color: var(--primary);
}

.upload-zone.drag {
  background: #EEF2FF;
  border-color: var(--primary);
}

/* Recap */
.recap {
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13.5px;
}

/* Credits pill in topbar */
.credits-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #EEF2FF;
  color: var(--primary);
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid #E0E7FF;
}

/* Status badges */
.badge-ok {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: #DCFCE7;
  color: #166534;
}

.badge-warn {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: #FEF3C7;
  color: #92400E;
}

.badge-err {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: #FEE2E2;
  color: #991B1B;
}

/* ============== AUTH (recover + register) ============== */
.auth-card-wide {
  max-width: 540px;
}

.auth-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.12), rgba(99, 102, 241, 0.2));
  color: var(--primary);
  margin: 0 0 18px;
}

.auth-icon svg {
  width: 28px;
  height: 28px;
}

/* Variante verde per stati di successo (es. account confermato) */
.auth-icon-success {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(16, 185, 129, 0.22));
  color: var(--ok);
}

/* Email evidenziata nello step di verifica codice */
.email-highlight {
  color: var(--primary);
  font-weight: 600;
}

.recover-step[hidden] {
  display: none;
}

/* Layout campi */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 480px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}
/* Hint sotto i field */
.hint {
  color: var(--ink-mute);
  font-size: 12px;
  margin-top: 6px;
}

/* Select sullo stesso stile di .input */
select.input {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%), linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

/* Input password con toggle */
.input-pw {
  position: relative;
}

.input-pw .input {
  padding-right: 42px;
}

.input-pw .pw-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--ink-mute);
  font-size: 16px;
}

.input-pw .pw-toggle:hover {
  color: var(--primary);
  background: var(--paper);
}

/* OTP a 6 cifre */
.otp-group {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.otp-group input {
  width: 100%;
  height: 52px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-2);
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.otp-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.18);
}

/* Checkbox termini */
.terms {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--ink-soft);
  margin: 4px 0 18px;
  line-height: 1.45;
}

.terms input[type=checkbox] {
  appearance: none;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border: 1.5px solid var(--line);
  border-radius: 5px;
  background: var(--paper-2);
  cursor: pointer;
  margin-top: 1px;
  position: relative;
  transition: all 0.15s;
}

.terms input[type=checkbox]:hover {
  border-color: var(--primary-soft);
}

.terms input[type=checkbox]:checked {
  background: var(--primary);
  border-color: var(--primary);
}

.terms input[type=checkbox]:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.terms a {
  color: var(--primary);
  font-weight: 500;
}

/* =====================================================================
   Alert / Messaggi (riutilizzabile in login, register, recover, ecc.)
   ===================================================================== */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 13px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 13px;
  line-height: 1.4;
  margin-bottom: 16px;
  background: #fff;
}

.alert .alert-ico {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin-top: 1px;
}

.alert .alert-body {
  flex: 1;
  min-width: 0;
}

.alert .alert-title {
  font-weight: 600;
  margin: 0 0 2px;
}

.alert .alert-msg {
  margin: 0;
  opacity: 0.92;
}

.alert .alert-close {
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  color: inherit;
  opacity: 0.55;
  padding: 2px 4px;
  margin: -2px -4px 0 4px;
  border-radius: 4px;
}

.alert .alert-close:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.05);
}

.alert-error {
  background: #FEF2F2;
  border-color: #FECACA;
  color: #991B1B;
}

.alert-success {
  background: #ECFDF5;
  border-color: #A7F3D0;
  color: #065F46;
}

.alert-warn {
  background: #FFFBEB;
  border-color: #FDE68A;
  color: #92400E;
}

.alert-info {
  background: #EFF6FF;
  border-color: #BFDBFE;
  color: #1E40AF;
}

/* ================= Loader globale ================= */
.joe-loader {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 18, 32, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.joe-loader.is-visible {
  display: flex;
  opacity: 1;
}

.joe-loader-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 28px 36px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(99, 102, 241, 0.25);
  box-shadow: 0 20px 60px -20px rgba(99, 102, 241, 0.45);
}

.joe-loader-ring {
  position: relative;
  width: 64px;
  height: 64px;
}

.joe-loader-ring::before,
.joe-loader-ring::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid transparent;
}

.joe-loader-ring::before {
  border-top-color: #6366F1;
  border-right-color: #818CF8;
  animation: joe-spin 0.9s linear infinite;
  box-shadow: 0 0 18px rgba(99, 102, 241, 0.55);
}

.joe-loader-ring::after {
  inset: 10px;
  border-top-color: #A5B4FC;
  border-left-color: #6366F1;
  animation: joe-spin 1.4s linear infinite reverse;
  opacity: 0.7;
}

.joe-loader-core {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #818CF8;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 14px 2px rgba(129, 140, 248, 0.9);
  animation: joe-pulse 1.2s ease-in-out infinite;
}

.joe-loader-text {
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #E0E7FF;
  font-weight: 600;
}

.joe-loader-text .dots::after {
  content: "";
  display: inline-block;
  width: 1ch;
  text-align: left;
  animation: joe-dots 1.4s steps(4, end) infinite;
}

@keyframes joe-spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes joe-pulse {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.6);
    opacity: 0.5;
  }
}
@keyframes joe-dots {
  0% {
    content: "";
  }
  25% {
    content: ".";
  }
  50% {
    content: "..";
  }
  75% {
    content: "...";
  }
  100% {
    content: "";
  }
}
/* ============================================================
   Stato di errore per input, select, textarea e checkbox
   Uso: <input class="input error">  oppure  <input type="checkbox" class="error">
   Aggiungere .error sul .field per evidenziare anche la label.
   Si può accompagnare con <p class="field-error">Messaggio</p>
   ============================================================ */
.input.error,
.select.error,
.textarea.error,
select.input.error,
.field.error .input,
.field.error .select,
.field.error .textarea {
  border-color: #ef4444 !important;
  background: #fff5f5;
  color: #7f1d1d;
}

.input.error::placeholder,
.field.error .input::placeholder {
  color: #fca5a5;
}

.input.error:focus,
.select.error:focus,
.textarea.error:focus,
.field.error .input:focus,
.field.error .select:focus,
.field.error .textarea:focus {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18) !important;
  outline: none;
}

/* Wrapper password con input in errore */
.input-pw.error .input,
.input-pw .input.error {
  border-color: #ef4444 !important;
  background: #fff5f5;
}

.input-pw.error .pw-toggle,
.input-pw .input.error ~ .pw-toggle {
  color: #ef4444;
}

/* Label del field in errore */
.field.error label {
  color: #b91c1c;
}

/* Messaggio sotto al campo */
.field-error {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 6px 0 0;
  font-size: 12px;
  font-weight: 500;
  color: #b91c1c;
  line-height: 1.3;
}

.field-error::before {
  content: "";
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b91c1c' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><line x1='12' y1='8' x2='12' y2='12'/><line x1='12' y1='16' x2='12.01' y2='16'/></svg>");
  background-size: contain;
  background-repeat: no-repeat;
}

/* Checkbox in errore (anche dentro .terms o .row) */
input[type=checkbox].error,
.terms input[type=checkbox].error,
.terms.error input[type=checkbox] {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18);
  background: #fff5f5;
}

.terms.error span,
.terms.error a {
  color: #b91c1c;
}

.terms.error a {
  text-decoration: underline;
}

/* Radio in errore (per coerenza) */
input[type=radio].error {
  outline: 2px solid #ef4444;
  outline-offset: 2px;
}

/* ---- Nuova campagna: editor + sidebar campi merge ---- */
.merge-chip {
  width: 100%;
  text-align: left;
  border: 1px dashed var(--line) !important;
  background: #fff !important;
}

.merge-chip:hover {
  border-color: var(--primary) !important;
  color: var(--primary) !important;
  background: #eef0ff !important;
}

@media (max-width: 900px) {
  .editor-layout {
    grid-template-columns: 1fr !important;
  }
  .editor-layout .merge-fields {
    border-left: 0 !important;
    border-top: 1px solid var(--line);
    max-height: 240px !important;
  }
}
/* ---- Nuova campagna: responsive recap / anteprima / filtri ---- */
.card .card-foot {
  flex-wrap: wrap;
}

.card .card-foot > .row {
  flex-wrap: wrap;
  row-gap: 8px;
}

.card .card-foot input[type=datetime-local],
.card .card-foot .input {
  max-width: 100%;
}

@media (max-width: 700px) {
  /* Card foot: pianifica - input non sfora */
  .card .card-foot {
    padding: 12px 14px;
  }
  .card .card-foot input[type=datetime-local] {
    width: 100% !important;
    flex: 1 1 100%;
  }
  .card .card-foot label.row {
    flex: 0 0 auto;
  }
  /* Header card anteprima: select + bottone non sforano */
  .card .card-head {
    padding: 12px 14px;
  }
  .card .card-head .row {
    width: 100%;
    margin-left: 0 !important;
    flex-wrap: wrap;
    row-gap: 6px;
  }
  .card .card-head .row .input {
    flex: 1 1 160px;
    min-width: 0;
  }
  /* Filtri destinatari: layout a due righe + label */
  .filter-row {
    grid-template-columns: 1fr 40px !important;
    grid-template-areas: "field rm" "op    rm" "value rm";
    gap: 6px !important;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    margin-bottom: 10px !important;
  }
  .filter-row [data-k=field] {
    grid-area: field;
  }
  .filter-row [data-k=op] {
    grid-area: op;
  }
  .filter-row [data-k=value] {
    grid-area: value;
  }
  .filter-row [data-rm-filter] {
    grid-area: rm;
    align-self: start;
    height: 40px;
  }
  .filter-row .input {
    font-size: 14px;
    height: 40px;
  }
  .filter-row [data-k=op]::before {
    content: "Operatore";
  }
}
/* Switch on/off (toggle). Riusabile: <span class="switch"><input type="checkbox"><span class="slider"></span></span> */
.switch-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  cursor: pointer;
  line-height: 1.45;
}

.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex: 0 0 40px;
  margin-top: 1px;
}

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

.switch .slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background: var(--line);
  border-radius: 22px;
  transition: background 0.15s;
}

.switch .slider::before {
  content: "";
  position: absolute;
  height: 16px;
  width: 16px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s;
}

.switch input:checked + .slider {
  background: var(--primary);
}

.switch input:checked + .slider::before {
  transform: translateX(18px);
}

.switch input:focus-visible + .slider {
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.18);
}

/* Tour di benvenuto (onboarding primo accesso, progetti.js) */
.tour-hero {
  margin: -18px -18px 16px; /* aderisce ai bordi del .modal .body (padding 18px) */
  padding: 26px 24px 20px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 55%, #818CF8 100%);
  color: #fff;
  text-align: center;
}

.tour-hero .tour-ico {
  display: block;
  font-size: 42px;
  line-height: 1;
  margin-bottom: 10px;
}

.tour-hero h3 {
  color: #fff;
  font-size: 22px;
  margin: 0 0 4px;
}

.tour-hero p {
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
  font-size: 13px;
}

.tour-step {
  animation: tourIn 0.25s ease;
}

@keyframes tourIn {
  from { opacity: 0; transform: translateX(14px); }
  to   { opacity: 1; transform: none; }
}

.tour-li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0 0 12px;
}

.tour-li .t-ico {
  flex: 0 0 28px;
  height: 28px;
  border-radius: 8px;
  background: #EEF2FF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  margin-top: 1px;
}

.tour-gift {
  display: flex;
  gap: 12px;
  align-items: center;
  border: 1px dashed var(--primary-soft);
  background: #EEF2FF;
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-top: 14px;
}

.tour-gift .g-ico {
  font-size: 26px;
  line-height: 1;
}

.tour-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}

.tour-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line);
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: width 0.2s ease, background 0.2s ease;
}

.tour-dots .dot.on {
  width: 22px;
  border-radius: 5px;
  background: var(--primary);
}

/* Font piu' leggibili nel tour: regole scoped su .tour-* cosi' non toccano
   .small/.muted del resto dell'app. Mantenute anche in root/lovable.css. */
.tour-hero .tour-ico { font-size: 48px; }
.tour-hero h3 { font-size: 24px; }
.tour-hero p  { font-size: 15px; }
.tour-step p  { font-size: 14.5px; line-height: 1.5; }
.tour-li b        { font-size: 15px; }
.tour-li .small   { font-size: 13.5px; line-height: 1.45; }
.tour-gift b      { font-size: 15px; }
.tour-gift .small { font-size: 13.5px; line-height: 1.45; }
.tour-li .t-ico   { flex-basis: 32px; width: 32px; height: 32px; font-size: 16px; }

/*# sourceMappingURL=root.css.map */
