/* ============================================================
   Drop & Preordini (Components/Pages/Preordini.razor + DropHub/*)
   ============================================================ */

.dh-index-line {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: var(--text-xs); color: var(--text-soft);
  margin: -6px 0 16px;
}
.dh-index-line .dh-progress { color: var(--ember-700); font-weight: 700; }

.dh-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.dh-toolbar .dh-grow { flex: 1 1 auto; }
.dh-search { position: relative; min-width: 220px; flex: 0 1 300px; }
.dh-search i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-400); font-size: .85rem; }
.dh-search .zp-input { width: 100%; padding-left: 32px; }
.dh-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.dh-chips .zp-chip { padding: 5px 11px; font-size: var(--text-xs); }
.dh-chip-count { font-weight: 800; opacity: .75; }

.dh-section-title { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.dh-section-title .zp-title { font-size: var(--text-body); margin: 0; }
.dh-section-title .dh-grow { flex: 1; }

/* Righe cliccabili */
.dh-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.dh-table thead th {
  text-align: left; padding: 9px 12px; white-space: nowrap;
  font-size: var(--text-xs); font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--ink-500); background: var(--paper-sunk);
}
.dh-table tbody td { padding: 10px 12px; border-top: 1px solid var(--line); color: var(--ink-700); vertical-align: middle; }
.dh-table tbody tr.dh-click { cursor: pointer; }
.dh-table tbody tr.dh-click:hover td { background: var(--paper-sunk); }
.dh-table tbody tr.dh-sub td { background: var(--surface-2, #FBF8F3); border-top: none; padding-top: 0; }
.dh-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dh-table .muted { color: var(--text-faint); }
.dh-table tfoot td { padding: 10px 12px; border-top: 2px solid var(--line); font-weight: 800; }
.dh-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); }

.dh-name { font-weight: 700; color: var(--ink-900); }
.dh-sub { font-size: var(--text-xs); color: var(--text-faint); margin-top: 2px; }
.dh-link { background: none; border: none; padding: 0; font: inherit; font-weight: 700; color: var(--ink-900); cursor: pointer; text-align: left; }
.dh-link:hover { color: var(--accent-2); text-decoration: underline; }
.dh-badges { display: inline-flex; gap: 4px; flex-wrap: wrap; vertical-align: middle; }
.dh-badges .zp-badge { font-size: .66rem; padding: 1px 7px; }
.dh-sub .dh-badges { margin-left: 6px; }
.dh-head-actions a.zp-btn, a.zp-btn.dh-nolink { text-decoration: none; }

/* Icona tipo drop */
.dh-type { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 15px; flex-shrink: 0; }
.dh-type--lg { width: 48px; height: 48px; border-radius: 13px; font-size: 21px; }
.dh-type--std    { background: var(--info-bg); color: var(--info); }
.dh-type--alloc  { background: var(--warning-bg); color: var(--warning); }
.dh-type--raffle { background: #f3e8ff; color: #7c3aed; }
.dh-drop-cell { display: flex; align-items: center; gap: 10px; min-width: 220px; }

/* Lista "Da fare" */
.dh-todo { display: flex; flex-direction: column; gap: 8px; }
.dh-todo-item {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface);
}
.dh-todo-item .dh-todo-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; }
.dh-todo-item .dh-todo-text { flex: 1; min-width: 200px; font-size: var(--text-sm); }
.dh-todo--warn .dh-todo-icon { background: var(--warning-bg); color: var(--warning); }
.dh-todo--info .dh-todo-icon { background: var(--info-bg); color: var(--info); }
.dh-todo--bank .dh-todo-icon { background: var(--success-bg); color: var(--success); }

/* Testata del drop */
.dh-head { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.dh-head-main { flex: 1; min-width: 240px; }
.dh-head-title { font-family: var(--font-display); font-weight: 800; font-size: 1.35rem; letter-spacing: -.02em; color: var(--ink-900); line-height: 1.2; }
.dh-head-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.dh-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: var(--text-xs); color: var(--text-soft); margin-top: 10px; }
.dh-meta span { display: inline-flex; align-items: center; gap: 5px; }
.dh-meta b { color: var(--ink-700); }
.dh-back { display: inline-flex; align-items: center; gap: 6px; background: none; border: none; padding: 0; margin-bottom: 10px; font-size: var(--text-sm); font-weight: 700; color: var(--text-soft); cursor: pointer; }
.dh-back:hover { color: var(--accent-2); }

/* Stepper fasi */
.dh-steps { display: flex; gap: 0; margin-top: 16px; flex-wrap: wrap; }
.dh-step { flex: 1 1 140px; display: flex; align-items: center; gap: 8px; padding: 8px 10px; font-size: var(--text-xs); font-weight: 700; color: var(--text-faint); border-top: 3px solid var(--bg-900); }
.dh-step .dh-step-dot { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: .65rem; background: var(--bg-900); color: var(--text-soft); flex-shrink: 0; }
.dh-step.done { color: var(--success); border-top-color: var(--success); }
.dh-step.done .dh-step-dot { background: var(--success-bg); color: var(--success); }
.dh-step.current { color: var(--ember-700); border-top-color: var(--ember-500); }
.dh-step.current .dh-step-dot { background: var(--ember-500); color: #fff; }

.dh-source { font-size: var(--text-xs); color: var(--text-faint); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0 0; }

/* Pannelli interni (sezioni del drop) */
.dh-panel-tabs { margin: 18px 0 14px; }
.dh-tab-count { font-size: .68rem; font-weight: 800; padding: 1px 6px; border-radius: 999px; background: var(--bg-900); color: var(--text-soft); }
.dh-items { width: 100%; border-collapse: collapse; font-size: var(--text-xs); margin: 4px 0 6px; }
.dh-items td, .dh-items th { padding: 6px 8px; border-top: 1px solid var(--line); }
.dh-items th { color: var(--ink-500); font-weight: 700; text-align: left; border-top: none; }
.dh-items .num { text-align: right; }
.dh-entry-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: var(--text-xs); color: var(--text-soft); padding: 4px 8px 8px; }

.dh-tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.dh-tool { border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; display: flex; flex-direction: column; gap: 8px; background: var(--surface); }
.dh-tool-title { font-weight: 800; color: var(--ink-900); font-size: var(--text-sm); display: flex; align-items: center; gap: 7px; }
.dh-tool p { font-size: var(--text-xs); color: var(--text-soft); margin: 0; flex: 1; }
.dh-tool .zp-btn { align-self: flex-start; }

.dh-finalize-grid > .zp-card + .zp-card { margin-top: 0; }

.dh-bar { height: 7px; border-radius: 4px; background: var(--ember-400); opacity: .75; min-width: 3px; }
.dh-empty { text-align: center; padding: 36px 16px; color: var(--text-soft); font-size: var(--text-sm); }
.dh-empty i { font-size: 2rem; display: block; margin-bottom: 8px; color: var(--ink-300); }

/* Drawer cliente: più largo del run-monitor standard */
.dh-drawer { width: 560px; }
.dh-drawer-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.dh-drawer-kpi { background: var(--paper-sunk); border-radius: var(--r-md); padding: 10px; }
.dh-drawer-kpi .l { font-size: .66rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); }
.dh-drawer-kpi .v { font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; color: var(--ink-900); margin-top: 2px; }
.dh-drop-card { border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; }
.dh-drop-card-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.dh-contact { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: var(--text-sm); }
.dh-wa { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; background: #25D366; color: #fff !important; font-size: var(--text-xs); font-weight: 700; text-decoration: none; }
.dh-wa:hover { filter: brightness(.95); }

/* Persone: avatar con iniziali + nome/email */
.dh-person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.dh-person-text { min-width: 0; }
.dh-avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; font: 800 .7rem/1 var(--font-sans); letter-spacing: .03em; }
.dh-avatar--lg { width: 46px; height: 46px; font-size: .92rem; }
.dh-av-0 { background: var(--ember-100); color: var(--ember-700); }
.dh-av-1 { background: var(--info-bg); color: var(--info); }
.dh-av-2 { background: var(--success-bg); color: var(--success); }
.dh-av-3 { background: var(--gold-100); color: var(--gold-500); }
.dh-av-4 { background: #f3e8ff; color: #7c3aed; }
.dh-av-5 { background: var(--bg-900); color: var(--ink-700); }
.dh-loyal { display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; font-size: .68rem; font-weight: 800; color: var(--gold-500); }
.dh-note { font-size: var(--text-xs); color: var(--text-soft); font-style: italic; margin-top: 3px; }

/* Consegna */
.dh-ship { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: .72rem; font-weight: 700; white-space: nowrap; }
.dh-ship--pickup { background: var(--info-bg); color: var(--info); }
.dh-ship--home { background: var(--warning-bg); color: var(--warning); }

/* Azioni secondarie a icona: neutre, il rosso solo al passaggio */
.dh-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; }
.dh-icon-btn { width: 30px; height: 30px; display: inline-grid; place-items: center; flex-shrink: 0; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); color: var(--ink-500); cursor: pointer; transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease); }
.dh-icon-btn:hover { color: var(--ink-900); border-color: var(--line-strong); background: var(--paper-sunk); }
.dh-icon-btn--danger:hover { color: var(--danger); border-color: var(--danger-line); background: var(--danger-bg); }
.dh-icon-btn--success:hover { color: var(--success); border-color: var(--success-line); background: var(--success-bg); }
.dh-icon-btn:focus-visible, .dh-toggle:focus-visible { outline: none; box-shadow: var(--ring-ember); }
.dh-icon-btn:disabled { opacity: .45; cursor: not-allowed; background: var(--surface); color: var(--ink-500); }

/* Interruttori Contattato / Pagato */
.dh-toggle { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; border: 1px dashed var(--line-strong); background: var(--surface); color: var(--ink-500); font: 700 .74rem/1 var(--font-sans); white-space: nowrap; cursor: pointer; }
.dh-toggle:hover { border-color: var(--ember-400); color: var(--ink-900); }
.dh-toggle.on { border-style: solid; border-color: var(--success-line); background: var(--success-bg); color: var(--success); }
.dh-bon-row.is-paid td:first-child { box-shadow: inset 3px 0 0 var(--success); }
.dh-bon-row:not(.is-paid) td:first-child { box-shadow: inset 3px 0 0 var(--warning-line); }
.dh-items-inline { font-size: var(--text-xs); color: var(--text-soft); line-height: 1.5; max-width: 260px; }

/* Avanzamento del drop aperto */
.dh-progress-track { height: 4px; width: 130px; border-radius: 2px; background: var(--bg-900); margin-top: 6px; overflow: hidden; }
.dh-progress-fill { height: 100%; border-radius: 2px; background: var(--ember-400); }

/* Icona negli strumenti */
.dh-tool-icon { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--ember-100); color: var(--ember-700); font-size: .85rem; flex-shrink: 0; }

@media (max-width: 980px) {
  .dh-finalize-grid { grid-template-columns: minmax(0, 1fr) !important; }
}

@media (max-width: 760px) {
  .dh-toolbar { align-items: stretch; }
  .dh-search { flex: 1 1 100%; min-width: 0; }
  .dh-drawer-kpis { grid-template-columns: repeat(2, 1fr); }
  .dh-step { flex-basis: 50%; }
  .dh-head-actions { width: 100%; }
}
