/**
 * Plus Technologies — navigazione unificata (tutti i moduli).
 * Logo arancione · Casetta dashboard a destra · Indietro/Chiudi sulle sotto-viste.
 */
:root {
  --pt-orange: #e67800;
  --pt-orange-h: #c96800;
  --pt-bar-bg: #1a1a2e;
}

.pt-module-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  padding: 6px 12px;
  background: var(--pt-bar-bg);
  border-bottom: 2px solid var(--pt-orange);
  position: sticky;
  top: 0;
  z-index: 200;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.pt-global-ctrls {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  margin-left: 0;
}
.pt-global-ctrls > * { flex: 0 0 auto; }
.pt-global-ctrls .nav-home-btn,
.pt-global-ctrls .nav-back-btn { margin-left: 0; }

.pt-logo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--pt-orange);
  font-weight: 800;
  font-size: 15px;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.pt-logo:hover { color: var(--pt-orange-h); }
.pt-spark { font-size: 17px; line-height: 1; color: var(--pt-orange); }

.pt-module-title {
  color: rgba(255, 255, 255, 0.88);
  font-size: 13px;
  font-weight: 600;
  padding-left: 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.18);
  white-space: nowrap;
}

.pt-nav-spacer { flex: 1 1 auto; min-width: 8px; }

.pt-nav-user {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pt-fic-api {
  flex: 0 0 auto;
  color: #fde68a;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(253, 230, 138, 0.35);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  line-height: 1.2;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
}
.pt-fic-api[hidden] {
  display: none !important;
}

.pt-ui-unlock-btn {
  position: relative;
  z-index: 13050;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: rgba(255, 255, 255, 0.75);
  font-size: 15px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 6px;
  cursor: pointer;
  line-height: 1;
}
.pt-ui-unlock-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.45);
}

.pt-tab-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* Ordini: in alto solo controlli globali (To do…campanella/sblocca); tab sotto e grandi */
.pt-module-bar--orders {
  flex-wrap: nowrap;
  gap: 8px;
  margin-bottom: 0;
}
.pt-module-bar--orders .pt-orders-global-ctrls {
  flex: 0 0 auto;
  flex-wrap: nowrap;
  margin-left: 0;
  gap: 6px;
}
.pt-orders-tabs-row {
  display: flex;
  align-items: stretch;
  flex-wrap: nowrap;
  gap: 10px;
  padding: 12px 16px 14px;
  margin: 0 0 8px;
  background: #141422;
  border-bottom: 1px solid rgba(230, 120, 0, 0.35);
}
.pt-orders-tabs-row .btn.pt-orders-tab,
.pt-orders-tabs-row .pt-orders-tab {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  flex: 1 1 0;
  min-width: 0;
  min-height: 48px;
  padding: 12px 14px !important;
  border: none !important;
  border-radius: 10px !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  line-height: 1.15 !important;
  letter-spacing: 0.01em;
  white-space: nowrap;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
}
.pt-orders-tabs-row .pt-orders-tab.is-active {
  box-shadow: 0 0 0 2px rgba(230, 120, 0, 0.55), 0 3px 14px rgba(0, 0, 0, 0.35);
}
.pt-orders-tabs-row .btn.pt-orders-tab:hover {
  filter: brightness(1.1);
  opacity: 1;
}
@media (max-width: 900px) {
  .pt-module-bar--orders {
    flex-wrap: wrap;
  }
  .pt-orders-tabs-row {
    flex-wrap: wrap;
    padding: 10px 12px 12px;
    gap: 8px;
  }
  .pt-orders-tabs-row .btn.pt-orders-tab {
    flex: 1 1 calc(50% - 8px);
    min-height: 46px;
    font-size: 14px !important;
  }
}

.nav-home-btn,
.nav-menu-btn,
.nav-back-btn,
.nav-close-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  font-family: inherit;
  transition: background 0.15s ease, opacity 0.15s ease;
}
.nav-home-btn:hover,
.nav-menu-btn:hover,
.nav-back-btn:hover,
.nav-close-btn:hover { opacity: 0.9; }

/* Dashboard — casetta arancione (standard su tutti i moduli) */
.nav-home-btn,
.nav-menu-btn {
  background: var(--pt-orange);
  color: #fff;
  border-color: var(--pt-orange);
  margin-left: auto;
  padding: 6px 12px;
  min-width: 40px;
  justify-content: center;
}
.nav-home-btn:hover,
.nav-menu-btn:hover {
  background: var(--pt-orange-h);
  border-color: var(--pt-orange-h);
}

.nav-back-btn {
  background: #eceff3;
  color: #1a1a2e;
  border-color: #d4d9e0;
}
.nav-back-btn:hover { background: #e0e4ea; }

.nav-close-btn {
  background: #5a6072;
  color: #fff;
  border-color: #5a6072;
}
.nav-close-btn:hover { background: #4a4f5e; }

.nav-back-btn .nav-ic,
.nav-close-btn .nav-ic,
.nav-home-btn .nav-ic,
.nav-menu-btn .nav-ic {
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
}

.nav-ctrls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex: 0 0 auto;
  flex-wrap: nowrap;
}

@media (max-width: 640px) {
  .pt-module-bar { padding: 8px 10px; gap: 8px; }
  .pt-logo { font-size: 14px; }
  .pt-module-title { display: none; }
}

/* Touch targets condivisi — iPhone / iPad portrait */
@media (max-width: 900px) {
  .pt-module-bar {
    padding: 8px 10px;
    gap: 6px;
  }
  .pt-module-title { display: none; }
  .nav-ctrls { gap: 6px; }
  .nav-home-btn,
  .nav-back-btn,
  .nav-close-btn,
  .nav-menu-btn,
  .nav-enquiry-btn,
  .nav-listini-btn,
  .nav-documents-btn,
  .nav-manual-btn,
  .nav-todo-btn,
  .nav-notif-btn,
  .pt-assist-btn {
    min-height: 44px;
    min-width: 44px;
    padding: 8px 10px;
    justify-content: center;
  }
  .pt-listini-drawer {
    width: 100vw;
    padding: 12px 12px 10px;
  }
  .pt-listini-drawer-title { font-size: 18px; }
  .pt-listini-close {
    width: 44px;
    height: 44px;
    font-size: 18px;
  }
  .pt-listini-row {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
  .pt-listini-lbl {
    flex: none;
    font-size: 13px;
  }
  .pt-listini-sel {
    height: 44px;
    font-size: 16px;
  }
  .pt-listini-body {
    -webkit-overflow-scrolling: touch;
  }
}

/* Enquiry (Offerte) — header */
.nav-enquiry-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border: 1px solid rgba(124, 58, 237, 0.55);
  border-radius: 6px;
  background: rgba(124, 58, 237, 0.88);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.nav-enquiry-btn:hover {
  background: rgba(109, 40, 217, 0.95);
  border-color: rgba(196, 181, 253, 0.45);
  color: #fff;
}
.nav-enquiry-btn .nav-ic { font-size: 14px; line-height: 1; }

@media (max-width: 720px) {
  .nav-enquiry-btn { padding: 6px 9px; min-width: 36px; justify-content: center; }
}

/* To do — header, prima della casella posta */
.pt-todo-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.pt-module-bar button.nav-todo-btn,
button.nav-todo-btn {
  display: inline-flex !important;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border: 1px solid rgba(234, 179, 8, 0.55);
  border-radius: 6px;
  background: #a16207 !important;
  color: #fff !important;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
}
.pt-module-bar button.nav-todo-btn:hover,
button.nav-todo-btn:hover {
  background: #ca8a04 !important;
  border-color: rgba(253, 224, 71, 0.65);
  color: #fff !important;
}
.nav-todo-btn .nav-ic { font-size: 14px; line-height: 1; color: #fff !important; }
.nav-todo-btn .nav-manual-label { color: #fff !important; }
.pt-todo-badge {
  display: none;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  margin-left: 2px;
  border-radius: 999px;
  background: #fff;
  color: #92400e;
  font-size: 10px;
  font-weight: 800;
  line-height: 16px;
  align-items: center;
  justify-content: center;
}
.pt-todo-panel {
  /* fixed: sopra tab Ordini / barre moduli (non clippati da overflow della header) */
  position: fixed;
  top: 56px;
  right: 12px;
  left: auto;
  width: min(420px, 94vw);
  max-height: min(78vh, 640px);
  display: none;
  flex-direction: column;
  background: #fff;
  border: 1px solid #d4d9e0;
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.16);
  z-index: 11000;
  color: #1a1a2e;
  overflow: hidden;
}
.pt-todo-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #eceff3;
  background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%);
}
.pt-todo-title {
  font-size: 13px;
  font-weight: 800;
  color: #78350f;
}
.pt-todo-close {
  border: none;
  background: transparent;
  color: #92400e;
  font-size: 14px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}
.pt-todo-close:hover { background: rgba(146, 64, 14, 0.1); }
.pt-todo-form {
  padding: 10px 12px;
  border-bottom: 1px solid #f0f2f5;
  display: grid;
  gap: 6px;
  background: #fffef8;
}
.pt-todo-input,
.pt-todo-notes,
.pt-todo-due,
.pt-todo-ai-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d6dbe3;
  border-radius: 6px;
  padding: 7px 9px;
  font-size: 12px;
  font-family: inherit;
  color: #1a1a2e;
  background: #fff;
}
.pt-todo-notes { resize: vertical; min-height: 44px; }
.pt-todo-form-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.pt-todo-due { flex: 1; min-width: 0; }
.pt-todo-add {
  flex-shrink: 0;
  border: none;
  border-radius: 6px;
  padding: 7px 14px;
  background: #a16207;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.pt-todo-add:hover { background: #ca8a04; }
.pt-todo-list {
  flex: 1 1 auto;
  overflow: auto;
  max-height: 260px;
  min-height: 80px;
}
.pt-todo-empty {
  padding: 18px 14px;
  font-size: 12px;
  color: #64748b;
  text-align: center;
}
.pt-todo-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #f0f2f5;
  cursor: pointer;
  border-left: 3px solid transparent;
}
.pt-todo-item:hover { background: #fffbeb; }
.pt-todo-item.is-priority {
  border-left-color: #dc2626;
  background: linear-gradient(90deg, #fef2f2 0%, #fff 55%);
}
.pt-todo-item.is-priority:hover { background: #fef2f2; }
.pt-todo-item.is-done .pt-todo-title-text {
  text-decoration: line-through;
  color: #94a3b8;
}
.pt-todo-item.is-done { opacity: 0.88; cursor: default; }
.pt-todo-done-when {
  display: inline-block;
  margin-left: 6px;
  color: #15803d;
  font-weight: 800;
  font-size: 11px;
  font-style: normal;
  text-decoration: none;
  white-space: nowrap;
}
.pt-todo-prio-dot {
  flex-shrink: 0;
  margin-top: 3px;
  color: #dc2626;
  font-size: 12px;
  line-height: 1;
}
.pt-todo-prio-dot--off { color: #d6d3d1; }
.pt-todo-prio-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  vertical-align: middle;
}
.pt-todo-prio-btn {
  flex-shrink: 0;
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: 7px 10px;
  background: #fff;
  color: #b91c1c;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
}
.pt-todo-prio-btn.is-on {
  background: #dc2626;
  border-color: #b91c1c;
  color: #fff;
}
.pt-todo-head-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pt-todo-sub { font-size: 10px; font-weight: 600; color: #a16207; opacity: 0.85; }
.pt-todo-sheet {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 5;
  padding: 12px;
}
.pt-todo-sheet-card {
  width: 100%;
  background: #fff;
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.18);
  display: grid;
  gap: 10px;
}
.pt-todo-sheet-q {
  font-size: 14px;
  font-weight: 800;
  color: #1a1a2e;
}
.pt-todo-sheet-title {
  font-size: 12px;
  color: #475569;
  line-height: 1.35;
  word-break: break-word;
}
.pt-todo-sheet-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
.pt-todo-sheet-done,
.pt-todo-sheet-move,
.pt-todo-sheet-edit,
.pt-todo-sheet-prio {
  border: none;
  border-radius: 8px;
  padding: 10px 8px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
}
.pt-todo-sheet-done { background: #15803d; color: #fff; }
.pt-todo-sheet-move { background: #a16207; color: #fff; }
.pt-todo-sheet-edit { background: #0f766e; color: #fff; }
.pt-todo-sheet-prio { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.pt-todo-sheet-movebox,
.pt-todo-sheet-editbox {
  display: grid;
  gap: 8px;
}
.pt-todo-sheet-lab {
  font-size: 10px;
  font-weight: 800;
  color: #78716c;
  text-transform: uppercase;
}
.pt-todo-check-prio {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #b91c1c;
  cursor: pointer;
}
.pt-todo-sheet-movebox input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d6dbe3;
  border-radius: 6px;
  padding: 8px;
  font-size: 12px;
  font-family: inherit;
}
.pt-todo-sheet-cancel {
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 6px;
  font-family: inherit;
}
.pt-todo-toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: #1a1a2e;
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 9999;
}
.pt-todo-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.pt-todo-check {
  flex-shrink: 0;
  margin-top: 2px;
  cursor: pointer;
}
.pt-todo-check input { width: 16px; height: 16px; cursor: pointer; }
.pt-todo-main { flex: 1; min-width: 0; }
.pt-todo-item-title {
  font-size: 13px;
  font-weight: 700;
  color: #1a1a2e;
  line-height: 1.35;
  word-break: break-word;
}
.pt-todo-item-notes {
  margin-top: 3px;
  font-size: 11px;
  color: #475569;
  white-space: pre-wrap;
  word-break: break-word;
}
.pt-todo-item-due {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #a16207;
}
.pt-todo-del {
  flex-shrink: 0;
  border: 1px solid #fecaca;
  background: #fff;
  color: #b91c1c;
  border-radius: 6px;
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
}
.pt-todo-del:hover { background: #fef2f2; }
.pt-todo-ai {
  border-top: 1px solid #e8edf3;
  background: #f8fafc;
  padding: 8px 10px 10px;
}
.pt-todo-ai-head {
  font-size: 11px;
  font-weight: 800;
  color: #334155;
  margin-bottom: 6px;
}
.pt-todo-ai-log {
  max-height: 110px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 6px;
}
.pt-todo-ai-msg {
  font-size: 11px;
  line-height: 1.4;
  padding: 6px 8px;
  border-radius: 8px;
  white-space: pre-wrap;
  word-break: break-word;
}
.pt-todo-ai-msg--user {
  align-self: flex-end;
  background: #fef3c7;
  color: #78350f;
  max-width: 92%;
}
.pt-todo-ai-msg--assistant {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #e2e8f0;
  color: #1e293b;
  max-width: 92%;
}
.pt-todo-ai-form {
  display: flex;
  gap: 6px;
  align-items: center;
}
.pt-todo-ai-input { flex: 1; min-width: 0; }
.pt-todo-ai-mic {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #0b3d5c;
  font-size: 15px;
  cursor: pointer;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}
.pt-todo-ai-mic:hover:not([disabled]) {
  border-color: #e67800;
  background: #fff7ed;
}
.pt-todo-ai-mic.is-listening {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.25);
  animation: pt-todo-mic-pulse 1.2s ease-in-out infinite;
}
.pt-todo-ai-mic[disabled] { opacity: 0.45; cursor: not-allowed; }
@keyframes pt-todo-mic-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2); }
  50% { box-shadow: 0 0 0 7px rgba(220, 38, 38, 0.08); }
}
.pt-todo-ai-mic-wave {
  display: none;
  align-items: flex-end;
  gap: 2px;
  height: 24px;
  padding: 0 0 4px;
  flex-shrink: 0;
}
.pt-todo-ai-mic-wave.is-live { display: inline-flex; }
.pt-todo-wave-bar {
  display: block;
  width: 2px;
  height: 7px;
  border-radius: 2px;
  background: linear-gradient(180deg, #e67800 0%, #dc2626 100%);
  transform-origin: bottom center;
  animation: pt-todo-wave-idle 0.9s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * 0.07s);
}
.pt-todo-ai-mic-wave.is-live .pt-todo-wave-bar {
  animation: none;
  transition: transform 0.05s linear;
}
@keyframes pt-todo-wave-idle {
  0%, 100% { transform: scaleY(0.55); }
  50% { transform: scaleY(1.7); }
}
.pt-todo-ai-voice-hint {
  margin: 4px 0 0;
  font-size: 11px;
  font-weight: 700;
  color: #dc2626;
}
.pt-todo-ai-send {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 6px;
  background: #0f766e;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}
.pt-todo-ai-send:hover { background: #0d9488; }
.pt-todo-ai-send:disabled { opacity: 0.5; cursor: wait; }
.pt-todo-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #eceff3;
  background: #fffef8;
}
.pt-todo-tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700;
  color: #78716c;
  cursor: pointer;
  font-family: inherit;
  border-bottom: 2px solid transparent;
}
.pt-todo-tab.is-active {
  color: #92400e;
  border-bottom-color: #a16207;
  background: #fffbeb;
}
.pt-todo-quickdue {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.pt-todo-quickdue button,
.pt-todo-chip,
.pt-todo-ai-chips button {
  border: 1px solid #f1e4b8;
  background: #fffbeb;
  color: #92400e;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.pt-todo-quickdue button:hover,
.pt-todo-chip:hover,
.pt-todo-ai-chips button:hover {
  background: #fef3c7;
}
.pt-todo-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #78716c;
}
.pt-todo-meta span:last-child { color: #a16207; }
.pt-todo-move {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}
.pt-todo-move label {
  font-size: 10px;
  font-weight: 800;
  color: #92400e;
  text-transform: uppercase;
}
.pt-todo-move input[type="datetime-local"] {
  flex: 1;
  min-width: 140px;
  border: 1px solid #d6dbe3;
  border-radius: 5px;
  padding: 3px 6px;
  font-size: 11px;
  font-family: inherit;
}
.pt-todo-status {
  font-style: normal;
  font-weight: 600;
  color: #94a3b8;
  font-size: 11px;
}
.pt-todo-arch-mark {
  flex-shrink: 0;
  margin-top: 2px;
  font-size: 14px;
}
.pt-todo-restore {
  flex-shrink: 0;
  border: 1px solid #86efac;
  background: #fff;
  color: #15803d;
  border-radius: 6px;
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
.pt-todo-restore:hover { background: #f0fdf4; }
.pt-todo-ai-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 6px;
}

@media (max-width: 720px) {
  .nav-todo-btn { padding: 6px 9px; min-width: 36px; justify-content: center; }
  .nav-todo-btn .nav-manual-label { display: none; }
}

/* Archivio Documenti — header (arancione Plus) */
/* Casella email — header (navy Plus, testo bianco, apre in nuova scheda) */
.pt-module-bar a.nav-mail-btn,
a.nav-mail-btn {
  display: inline-flex !important;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 6px;
  background: #0b3d5c !important;
  color: #ffffff !important;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none !important;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
.pt-module-bar a.nav-mail-btn:hover,
a.nav-mail-btn:hover {
  background: #0a4f75 !important;
  border-color: rgba(230, 120, 0, 0.55);
  color: #ffffff !important;
}
.nav-mail-btn .nav-ic { font-size: 14px; line-height: 1; color: #fff !important; }
.nav-mail-btn .nav-manual-label { color: #fff !important; }

.pt-module-bar a.nav-chat-btn,
a.nav-chat-btn {
  display: inline-flex !important;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border: 1px solid rgba(124, 58, 237, 0.55);
  border-radius: 6px;
  background: #5b21b6 !important;
  color: #fff !important;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none !important;
  white-space: nowrap;
}
.pt-module-bar a.nav-chat-btn:hover,
a.nav-chat-btn:hover {
  background: #6d28d9 !important;
  color: #fff !important;
}
.nav-chat-btn .nav-ic { font-size: 14px; line-height: 1; color: #fff !important; }
.nav-chat-btn .nav-manual-label { color: #fff !important; }

/* Rotellina config casella — stile Plus */
.pt-module-bar a.nav-mail-gear-btn,
a.nav-mail-gear-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
  color: #fff !important;
  font-size: 16px;
  line-height: 1;
  text-decoration: none !important;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.pt-module-bar a.nav-mail-gear-btn:hover,
a.nav-mail-gear-btn:hover {
  background: #e67800 !important;
  border-color: #e67800;
  color: #fff !important;
}

@media (max-width: 720px) {
  .nav-mail-btn { padding: 6px 9px; min-width: 36px; justify-content: center; }
  .nav-mail-btn .nav-manual-label { display: none; }
  .nav-chat-btn { padding: 6px 9px; min-width: 36px; justify-content: center; }
  .nav-chat-btn .nav-manual-label { display: none; }
}

button.nav-listini-btn,
.nav-listini-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border: 1px solid rgba(16, 185, 129, 0.55);
  border-radius: 6px;
  background: #0f766e;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease, border-color 0.15s ease;
}
button.nav-listini-btn:hover,
.nav-listini-btn:hover {
  background: #0d9488;
  border-color: rgba(110, 231, 183, 0.55);
  color: #fff;
}
.nav-listini-btn .nav-ic { font-size: 14px; line-height: 1; }

@media (max-width: 720px) {
  .nav-listini-btn { padding: 6px 9px; min-width: 36px; justify-content: center; }
  .nav-listini-btn .nav-manual-label { display: none; }
}

/* Drawer a tutto schermo — fuori dall'header */
.pt-listini-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
}
.pt-listini-overlay[hidden] { display: none !important; }
.pt-listini-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}
.pt-listini-drawer {
  position: relative;
  z-index: 1;
  width: min(960px, 100vw);
  max-width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #f8fafc;
  box-shadow: -12px 0 40px rgba(15, 23, 42, 0.28);
  color: #0f172a;
  padding: 18px 20px 16px;
  overflow: hidden;
}
.pt-listini-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex: 0 0 auto;
}
.pt-listini-drawer-title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}
.pt-listini-drawer-sub {
  margin: 4px 0 0;
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
}
.pt-listini-close {
  border: none;
  background: #e2e8f0;
  color: #334155;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  flex: 0 0 auto;
}
.pt-listini-close:hover { background: #cbd5e1; }
.pt-listini-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 14px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
  flex: 0 0 auto;
}
.pt-listini-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  font-size: 14px;
}
.pt-listini-lbl {
  flex: 0 0 140px;
  font-weight: 700;
  color: #334155;
}
.pt-listini-sel {
  flex: 1 1 auto;
  min-width: 0;
  height: 40px;
  padding: 6px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  font-size: 14px;
}
.pt-listini-toast {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #166534;
  background: #dcfce7;
  border: 1px solid #86efac;
  border-radius: 8px;
  padding: 7px 12px;
  opacity: 0;
  transition: opacity 0.15s;
  flex: 0 0 auto;
  max-width: 100%;
  pointer-events: none;
}
.pt-listini-toast.is-visible {
  opacity: 1;
  pointer-events: auto;
}
.pt-listini-toast .pt-listino-toast-msg {
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.35;
}
.pt-listini-body {
  margin-top: 14px;
  flex: 1 1 auto;
  min-height: 0;
  /* Lo scroll verticale/orizzontale del listino resta su .qv-list-scroll-friendly
     così position:sticky sulle thead th funziona (non sul body del drawer). */
  overflow: hidden;
  padding-right: 2px;
  display: flex;
  flex-direction: column;
}
.pt-listini-body > .qv-list-meta,
.pt-listini-body > .pt-listini-empty,
.pt-listini-body > .empty-inline {
  flex: 0 0 auto;
}
.pt-listini-body > .qv-list-panel {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.pt-listini-empty {
  margin: 0;
  padding: 18px 6px;
  color: #64748b;
  font-size: 14px;
}
.pt-listini-manage-wrap {
  flex: 0 0 auto;
  margin: 10px 0 0;
  padding-top: 8px;
  border-top: 1px solid #e2e8f0;
}
.pt-listini-manage {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  color: #0f766e;
  text-decoration: none;
}
.pt-listini-manage:hover { text-decoration: underline; }
.pt-listini-body .qv-list-scroll-friendly {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
}
.pt-listini-body .qv-list-scroll-hint,
.pt-listini-body .qv-list-footer-imgs,
.pt-listini-body .qv-list-footer {
  flex: 0 0 auto;
}
.pt-listini-body .qv-lst-pick-inner,
.pt-listini-body td.qv-lst-copy {
  cursor: pointer;
}
body.pt-listini-open { overflow: hidden; }

.nav-documents-btn {
  display: inline-flex !important;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border: 1px solid rgba(230, 120, 0, 0.55);
  border-radius: 6px;
  background: rgba(230, 120, 0, 0.92) !important;
  color: #fff !important;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none !important;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.nav-documents-btn:hover {
  background: rgba(200, 95, 0, 0.98) !important;
  border-color: rgba(255, 200, 120, 0.5);
  color: #fff !important;
}
.nav-documents-btn .nav-ic { font-size: 14px; line-height: 1; }

@media (max-width: 720px) {
  .nav-documents-btn { padding: 6px 9px; min-width: 36px; justify-content: center; }
}

/* Manuale utente — header */
.nav-manual-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.nav-manual-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}
.nav-manual-btn .nav-ic { font-size: 14px; line-height: 1; }

@media (max-width: 720px) {
  .nav-manual-label { display: none; }
  .nav-manual-btn { padding: 6px 9px; min-width: 36px; justify-content: center; }
}

/* Notifiche commenti */
.pt-notif-wrap { position: relative; display: inline-flex; }
.nav-notif-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 6px 12px;
  min-width: 40px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  background: rgba(255,255,255,0.08);
  color: #fff;
  cursor: pointer;
  font-family: inherit;
}
.nav-notif-btn:hover { background: rgba(255,255,255,0.15); }
.pt-notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #e74c3c;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 16px;
  align-items: center;
  justify-content: center;
}
.pt-notif-panel {
  /* fixed: non resta sotto le tab Ordini / altre barre */
  position: fixed;
  top: 56px;
  right: 12px;
  left: auto;
  width: min(360px, 92vw);
  max-height: 420px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #d4d9e0;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  z-index: 11000;
  color: #1a1a2e;
}
.pt-notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #eceff3;
  font-size: 13px;
  font-weight: 700;
}
.pt-notif-title { flex-shrink: 0; }
.pt-notif-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.pt-notif-markall {
  border: none;
  background: none;
  color: var(--pt-orange);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}
.pt-notif-clearall {
  border: none;
  background: none;
  color: #dc2626;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}
.pt-notif-clearall:hover { color: #b91c1c; text-decoration: underline; }
.pt-notif-list { max-height: 340px; overflow: auto; }
.pt-notif-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid #f0f2f5;
}
.pt-notif-item-main {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}
.pt-notif-item-main:hover { background: transparent; }
.pt-notif-item:hover { background: #f8f9fb; }
.pt-notif-reply-btn {
  flex-shrink: 0;
  align-self: center;
  padding: 5px 10px;
  border: 1px solid #8e44ad;
  border-radius: 6px;
  background: #fff;
  color: #7c3aed;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.pt-notif-reply-btn:hover {
  background: #7c3aed;
  color: #fff;
}
.pt-notif-unread { background: #fef3c7; border-left: 4px solid #f59e0b; }
.pt-notif-sender { font-size: 14px; font-weight: 800; color: #5b21b6; margin-bottom: 2px; }
.pt-notif-context { font-size: 11px; font-weight: 700; color: #6b7280; text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 6px; }
.pt-notif-excerpt { font-size: 14px; line-height: 1.45; color: #111827; font-weight: 500; white-space: pre-wrap; word-break: break-word; }
.pt-notif-meta { font-size: 12px; color: #4a4a6a; margin-bottom: 4px; }
.pt-notif-body { font-size: 13px; color: #1a1a2e; white-space: pre-wrap; }
.pt-notif-ts { font-size: 11px; font-weight: 600; color: #6b7280; margin-top: 6px; }
.pt-notif-empty { padding: 16px 12px; color: #999; font-style: italic; font-size: 13px; }

/* Toast in-app (chat / commenti) */
.pt-notif-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  max-width: min(420px, 92vw);
  padding: 18px 22px;
  border-radius: 12px;
  background: #7c3aed;
  color: #fff;
  font-size: 15px;
  line-height: 1.45;
  box-shadow: 0 10px 28px rgba(124, 58, 237, 0.4);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.28s ease, transform 0.28s ease;
  pointer-events: none;
}
.pt-notif-toast.show { opacity: 1; transform: translateY(0); }
.pt-notif-toast strong { display: block; font-size: 16px; font-weight: 800; margin-bottom: 6px; }
.pt-notif-toast span { display: block; font-size: 15px; font-weight: 500; opacity: 0.95; white-space: pre-wrap; word-break: break-word; }
.pt-notif-toast.pt-notif-toast-team { background: #7c3aed; box-shadow: 0 10px 28px rgba(124, 58, 237, 0.4); }
.pt-notif-toast.pt-notif-toast-sent { background: #059669; box-shadow: 0 10px 28px rgba(5, 150, 105, 0.38); }

/* Banner grande messaggi in arrivo */
.dash-big-msg-alert {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.94);
  z-index: 10050;
  width: min(680px, 92vw);
  padding: 28px 32px;
  border-radius: 18px;
  background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 55%, #4c1d95 100%);
  color: #fff;
  box-shadow: 0 20px 60px rgba(91, 33, 182, 0.45), 0 0 0 1px rgba(255,255,255,0.12);
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.35s ease;
  pointer-events: none;
}
.dash-big-msg-alert.dash-big-msg-incoming {
  pointer-events: auto;
  cursor: pointer;
}
.dash-big-msg-actions {
  margin-top: 18px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.dash-big-msg-reply-btn {
  padding: 10px 22px;
  border: 2px solid rgba(255,255,255,0.85);
  border-radius: 10px;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
.dash-big-msg-reply-btn:hover {
  background: rgba(255,255,255,0.28);
  transform: scale(1.03);
}
.dash-big-msg-alert.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.dash-big-msg-sender {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}
.dash-big-msg-body {
  font-size: 20px;
  font-weight: 500;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.dash-big-msg-alert.dash-big-msg-sent {
  background: linear-gradient(135deg, #059669 0%, #047857 55%, #065f46 100%);
  box-shadow: 0 20px 60px rgba(5, 150, 105, 0.4);
}

/* Toggle notifiche desktop nel pannello campanella */
.pt-notif-desktop-toggle {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 4px;
  opacity: 0.55;
  transition: opacity 0.15s ease, background 0.15s ease;
}
.pt-notif-desktop-toggle:hover { opacity: 1; background: rgba(0, 0, 0, 0.06); }
.pt-notif-desktop-toggle.pt-notif-desktop-on { opacity: 1; background: rgba(124, 58, 237, 0.15); }

/* Pulsante chat flottante (tutte le pagine con nav) */
.pt-float-chat-btn {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 9990;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
  color: #fff;
  font-size: 22px;
  line-height: 52px;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(91, 33, 182, 0.45);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.pt-float-chat-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 8px 24px rgba(91, 33, 182, 0.55);
  color: #fff;
}
