/**
 * ADA Cards — Friendly UX (solo presentazione, zero logica).
 * ~3 KB · nessuna animazione pesante · nessun layout shift critico.
 */
:root {
  --pt-guide-bg: #f8fafc;
  --pt-guide-border: #e2e8f0;
  --pt-guide-accent: #0080FF;
  --pt-help-bg: #fffbeb;
  --pt-help-border: #fcd34d;
}

/* ── Barra passi (breadcrumb operativo) ── */
.pt-guide-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 2px;
  padding: 8px 12px;
  margin: 0 0 10px;
  background: var(--pt-guide-bg);
  border: 1px solid var(--pt-guide-border);
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.35;
  color: #475569;
}
.pt-guide-bar .pt-step {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #e2e8f0;
  font-weight: 600;
  white-space: nowrap;
}
.pt-guide-bar .pt-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #cbd5e1;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}
.pt-guide-bar .pt-step.is-active {
  border-color: var(--pt-guide-accent);
  background: #eff6ff;
  color: #0c4a6e;
}
.pt-guide-bar .pt-step.is-active .pt-step-num {
  background: var(--pt-guide-accent);
}
.pt-guide-bar .pt-step-arrow {
  color: #94a3b8;
  font-size: 11px;
  user-select: none;
}

/* ── Due percorsi affiancati (ordine vs DDT) ── */
.pt-flow-split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  margin: 8px 0 10px;
}
.pt-flow-path {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px dashed #cbd5e1;
  background: #fafafa;
}
.pt-flow-path-title {
  font-size: 12px;
  font-weight: 800;
  color: #1e293b;
  margin: 0 0 6px;
}
  .pt-flow-path .sped-row,
  .pt-flow-path .pt-flow-row {
  margin-bottom: 0;
}

/* ── Preview indirizzi spedizione (standard / shipping / una tantum) ── */
.ship-addr-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin: 4px 0 8px;
}
.ship-addr-preview-card {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #fafafa;
  font-size: 11px;
  line-height: 1.45;
}
.ship-addr-preview-card.is-active {
  border-color: #e87722;
  border-width: 2px;
  background: #fff8e1;
  box-shadow: 0 0 0 1px rgba(232, 119, 34, 0.15);
}
.ship-addr-preview-card.is-empty {
  opacity: 0.55;
  border-style: dashed;
}
.ship-addr-preview-title {
  font-weight: 800;
  font-size: 12px;
  color: #1e293b;
  margin: 0 0 6px;
}
.ship-addr-preview-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: #e87722;
  color: #fff;
  margin-left: 6px;
  vertical-align: middle;
}
.ship-addr-preview-dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 8px;
}
.ship-addr-preview-dl dt {
  color: #64748b;
  font-weight: 600;
  margin: 0;
}
.ship-addr-preview-dl dd {
  margin: 0;
  color: #1e293b;
  word-break: break-word;
}
.ship-addr-preview-apply {
  margin-top: 8px;
  width: 100%;
}

/* ── Aiuto espandibile (nativo <details>) ── */
.pt-help {
  margin: 8px 0 0;
  border: 1px solid var(--pt-help-border);
  border-radius: 8px;
  background: var(--pt-help-bg);
  overflow: hidden;
}
.pt-help > summary {
  cursor: pointer;
  list-style: none;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  color: #92400e;
  user-select: none;
}
.pt-help > summary::-webkit-details-marker { display: none; }
.pt-help > summary::before {
  content: "▸ ";
  display: inline-block;
  transition: transform 0.12s ease;
}
.pt-help[open] > summary::before { transform: rotate(90deg); }
/* Guida in alto — legacy details (prima dell'enhance JS) */
.pt-help-top {
  margin-top: 0;
  margin-bottom: 10px;
}
.pt-help-top > summary {
  font-size: 13px;
}

/* ── Guida rapida collassabile (post-enhance JS, chiusa di default) ── */
.pt-help-enhanced {
  margin: 0 0 10px;
  border: 1px solid var(--pt-help-border);
  border-radius: 8px;
  background: var(--pt-help-bg);
  overflow: hidden;
  scroll-margin-top: 64px;
}
.pt-help-enhanced > .pt-help-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 10px;
  padding: 8px 12px;
  background: linear-gradient(90deg, #fef3c7, #fffbeb);
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.pt-help-enhanced > .pt-help-summary::-webkit-details-marker {
  display: none;
}
.pt-help-enhanced > .pt-help-summary::before {
  content: "▸ ";
  display: inline-block;
  margin-right: 2px;
  transition: transform 0.12s ease;
  color: #b45309;
  font-weight: 800;
}
.pt-help-enhanced[open] > .pt-help-summary::before {
  transform: rotate(90deg);
}
.pt-help-enhanced[open] > .pt-help-summary {
  border-bottom: 1px solid var(--pt-help-border);
}
.pt-help-title {
  font-size: 13px;
  font-weight: 800;
  color: #92400e;
  line-height: 1.35;
  flex: 1;
  min-width: 120px;
}
.pt-help-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.pt-help-panel {
  background: var(--pt-help-bg);
}
.pt-help-manual-link {
  font-size: 11px;
  font-weight: 700;
  color: #c2410c;
  text-decoration: none;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid #7ec8ff;
  background: #fff;
  white-space: nowrap;
}
.pt-help-manual-link:hover {
  background: #ffedd5;
  color: #0c4a6e;
}
.pt-help-enhanced .pt-help-visible {
  padding: 8px 12px 10px;
  font-size: 12px;
  line-height: 1.5;
  color: #78350f;
}
.pt-help-enhanced .pt-help-visible p {
  margin: 0 0 6px;
}
.pt-help-enhanced .pt-help-visible ul {
  margin: 4px 0 0 18px;
  padding: 0;
}
.pt-help-enhanced .pt-help-visible li {
  margin: 3px 0;
}
.pt-help-more {
  border-top: 1px dashed #fcd34d;
  background: #fffdf5;
}
.pt-help-more > summary {
  cursor: pointer;
  list-style: none;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 700;
  color: #b45309;
  user-select: none;
}
.pt-help-more > summary::-webkit-details-marker {
  display: none;
}
.pt-help-more > summary::before {
  content: "▸ ";
  display: inline-block;
  transition: transform 0.12s ease;
}
.pt-help-more[open] > summary::before {
  transform: rotate(90deg);
}
.pt-help-enhanced .pt-help-extra {
  padding: 0 12px 10px;
  border-top: none;
  background: transparent;
}
@keyframes ptHelpFlash {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(230, 120, 0, 0);
  }
  30% {
    box-shadow: 0 0 0 3px rgba(230, 120, 0, 0.45);
  }
}
.pt-help-flash {
  animation: ptHelpFlash 1.4s ease;
}
.pt-help-body {
  padding: 0 12px 10px;
  font-size: 12px;
  line-height: 1.5;
  color: #78350f;
}
.pt-help-body ul {
  margin: 4px 0 0 18px;
  padding: 0;
}
.pt-help-body li { margin: 4px 0; }

/* ── Hint sotto titoli / hub ── */
.pt-page-intro {
  margin: 0 0 14px;
  padding: 10px 14px;
  background: #fff;
  border-left: 4px solid var(--pt-guide-accent);
  border-radius: 0 8px 8px 0;
  font-size: 13px;
  line-height: 1.45;
  color: #475569;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.pt-page-intro strong { color: #1e293b; }

/* ── Messaggi stato più leggibili ── */
.pt-hint,
.sped-muted.pt-hint {
  font-size: 12px !important;
  line-height: 1.5 !important;
  color: #64748b !important;
}

/* ── Card / sezioni più ariose (non cambia griglia dati) ── */
.sped-card {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.sped-card h2 {
  padding-bottom: 6px;
  border-bottom: 1px solid #eef2f7;
}
.hub-card,
.module-tile {
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.hub-card:hover,
.module-tile:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* ── Label form più chiare (solo dove c'è label esplicita) ── */
.sped-grid label,
.pt-field-label {
  font-size: 12px !important;
  font-weight: 600 !important;
  color: #334155 !important;
}

/* ── Focus accessibile senza JS ── */
.inp:focus,
.sel:focus,
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(230, 120, 0, 0.35);
  outline-offset: 1px;
}

/* ── Tab modulo ordini: hint sotto barra ── */
.pt-tab-hint {
  font-size: 12px;
  color: #64748b;
  padding: 4px 12px 8px;
  line-height: 1.4;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 6px;
  background: #f8fafc;
}

@media (max-width: 640px) {
  .pt-guide-bar { font-size: 11px; }
  .pt-flow-split { grid-template-columns: 1fr; }
}

/* ── Toggle vista semplice ── */
.pt-simple-toggle {
  padding: 5px 10px !important;
  border-radius: 6px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.35) !important;
  background: rgba(255, 255, 255, 0.12) !important;
  color: #fff !important;
  white-space: nowrap;
  font-family: inherit;
}
.pt-simple-toggle[aria-pressed="true"] {
  background: #eff6ff !important;
  color: #0c4a6e !important;
  border-color: #7ec8ff !important;
  box-shadow: 0 0 0 2px rgba(126, 200, 255, 0.55);
  font-size: 12px !important;
  padding: 6px 12px !important;
}

/* ── Elementi nascosti in vista semplice ── */
body.pt-simple-view .pt-advanced-only {
  display: none !important;
}
body.pt-simple-view .pt-simple-hint {
  display: block;
}
.pt-simple-hint {
  display: none;
}

/* ── Azione principale evidenziata ── */
.pt-btn-primary {
  box-shadow: 0 0 0 2px rgba(230, 120, 0, 0.35);
  font-weight: 800 !important;
}

/* ── Powered by Dany (dashboard) ── */
.pt-powered-by {
  color: #9ca3af;
}
.pt-powered-dany {
  color: #0080FF;
  font-weight: 600;
}
.pt-powered-email {
  color: #9ca3af;
}

/* ── Benvenuto dashboard ── */
.pt-welcome-msg {
  margin-top: 0.5rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: #374151;
  letter-spacing: 0.01em;
  line-height: 1.45;
}
.pt-welcome-msg .pt-welcome-greet {
  display: block;
}
.pt-welcome-msg .pt-welcome-name {
  font-weight: 700;
  color: var(--pt-orange, #0080FF);
}
.pt-welcome-msg .pt-welcome-empathy {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.875rem;
  font-weight: 400;
  color: #6b7280;
}

/* ── Pulsanti Friendly (Quote + dettaglio) ── */
.pt-fbtn,
a.pt-fbtn,
button.pt-fbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border: none;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 800;
  color: #fff !important;
  text-decoration: none !important;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.14);
  transition: transform 0.1s ease, filter 0.1s ease, box-shadow 0.1s ease;
  white-space: nowrap;
  font-family: inherit;
  line-height: 1.2;
  -webkit-tap-highlight-color: transparent;
}
.pt-fbtn:hover,
a.pt-fbtn:hover {
  filter: brightness(1.07);
  transform: translateY(-1px);
  text-decoration: none !important;
}
.pt-fbtn:active { transform: translateY(0); }
.pt-fbtn--orange { background: linear-gradient(180deg, #f59a4a 0%, #e87722 100%); box-shadow: 0 3px 10px rgba(232, 119, 34, 0.35); }
.pt-fbtn--green { background: linear-gradient(180deg, #34d399 0%, #27ae60 100%); box-shadow: 0 3px 10px rgba(39, 174, 96, 0.3); }
.pt-fbtn--blue { background: linear-gradient(180deg, #38bdf8 0%, #2980b9 100%); box-shadow: 0 3px 10px rgba(41, 128, 185, 0.3); }
.pt-fbtn--purple { background: linear-gradient(180deg, #c084fc 0%, #8e44ad 100%); box-shadow: 0 3px 10px rgba(142, 68, 173, 0.3); }
.pt-fbtn--slate { background: linear-gradient(180deg, #64748b 0%, #475569 100%); }
.pt-fbtn--teal { background: linear-gradient(180deg, #2dd4bf 0%, #16a085 100%); }
.pt-fbtn--gray { background: linear-gradient(180deg, #94a3b8 0%, #5a6268 100%); }
.pt-fbtn--sky { background: linear-gradient(180deg, #20b8ff 0%, #0080ff 100%); box-shadow: 0 3px 10px rgba(0, 128, 255, 0.3); }
.pt-fbtn--ghost {
  background: linear-gradient(180deg, #fff 0%, #f1f5f9 100%);
  color: #1e293b !important;
  border: 1px solid #94a3b8;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.1);
}
.pt-fbtn--ghost:hover {
  background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
  color: #0f172a !important;
  border-color: #64748b;
}
.pt-fbtn--sm { padding: 6px 10px; font-size: 11px; border-radius: 6px; }

/* Quote — workbench e header */
.page-plus-detail .plus-detail-header-right .pt-fbtn,
.page-plus-detail .ada-qv-toolbar .pt-fbtn,
.page-plus-detail .ada-qh-toolbar .pt-fbtn,
.page-plus-detail .ada-qv-foot .pt-fbtn,
.page-plus-detail .ada-qv-email-head .pt-fbtn {
  min-height: 34px;
}
.ada-qv-toolbar--actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.ada-qv-toolbar--actions .pt-fbtn--green { order: -1; }

/* Email WeClapp — pulsanti riga */
.wc-email-row {
  border-radius: 8px;
  margin-bottom: 6px;
  border: 1px solid #e2e8f0;
}
.wc-email-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}
.wc-email-actions .pt-fbtn {
  min-width: 88px;
  padding: 7px 10px;
  font-size: 11px;
}

/* Lista Quote — righe */
.panel-plus .plus-row:hover td {
  background: #e0f2fe !important;
}
.panel-plus .plus-row td.mono {
  font-weight: 700;
  color: #1d4ed8 !important;
}
