/* ============================================================
   ZillerPortal — Nuova Shell UI
   zp-shell.css

   Sostituisce le classi .portal-shell, .portal-sidebar, .portal-main
   con il nuovo sistema a variabili CSS del design system.
   Le pagine interne continuano a usare .portal-card etc. dall'app.css.
   ============================================================ */

/* ── Animazioni globali ─────────────────────────────────────── */
@keyframes zp-fade {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
/* Fade senza transform: usato su .zp-page per non creare un containing-block
   per position:fixed (transform:translateY(0) in fill-mode:both lo romperebbe) */
@keyframes zp-page-enter {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes zp-drawer-in {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}
@keyframes zp-spin {
  to { transform: rotate(360deg); }
}
@keyframes zp-pulse-dot {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* ── Shell ──────────────────────────────────────────────────── */
.zp-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Topbar (56px, sempre scura in entrambi i temi) ──────────── */
.zp-topbar-main {
  height: 56px;
  flex-shrink: 0;
  background: var(--inverse-surface);
  display: flex;
  align-items: center;
  padding: 0 32px 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 0;
}
.zp-brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  margin-right: 24px;
  flex-shrink: 0;
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
}
.zp-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  padding: 3px;
}
.zp-mark img { width: 100%; height: 100%; object-fit: contain; }
.zp-wordmark-text {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: 1rem;
  color: #fff;
  letter-spacing: var(--tracking-tight);
  white-space: nowrap;
}
.zp-wordmark-text strong { color: var(--ember-400); font-weight: inherit; }
.zp-topbar-sep {
  width: 1px;
  height: 24px;
  background: var(--inverse-line);
  margin-right: 8px;
  flex-shrink: 0;
}

/* ── Nav (voci orizzontali di primo livello) ─────────────────── */
.zp-nav {
  display: flex;
  align-items: center;
  height: 56px;
  flex-wrap: wrap;
}
.zp-nav-item {
  height: 56px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--inverse-text-muted);
  position: relative;
  white-space: nowrap;
  text-decoration: none;
  background: none;
  border: none;
  font-family: var(--font-sans);
}
.zp-nav-item i { font-size: 0.92rem; }
.zp-nav-item:hover { color: #fff; }
.zp-nav-item.active,
.zp-nav-item[aria-expanded="true"] { color: #fff; }
.zp-nav-item-bar {
  position: absolute;
  left: 14px; right: 14px; bottom: 0;
  height: 2px;
  border-radius: 1px;
  background: transparent;
}
.zp-nav-item.active .zp-nav-item-bar { background: var(--ember-400); }
.zp-nav-item .zp-nav-caret { font-size: 0.62rem; opacity: 0.7; }

.zp-nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--r-full);
  font-size: 0.66rem;
  font-weight: var(--weight-black);
  background: #C2340F;
  color: #fff;
  flex-shrink: 0;
}

/* ── Lato destro topbar: orologio + avatar utente ────────────── */
.zp-topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}
.zp-topbar-clock {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--inverse-text-muted);
}
.zp-topbar-clock .zp-status-dot { width: 7px; height: 7px; background: #3FA860; }
.zp-online-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--inverse-text-muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: var(--weight-semibold);
  cursor: pointer;
  transition: background 0.15s ease;
}
.zp-online-btn:hover { background: rgba(255, 255, 255, 0.16); }
.zp-online-btn i { font-size: 0.85rem; color: #3FA860; }
.zp-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ember-600);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: var(--weight-black);
  font-size: 0.8rem;
  cursor: pointer;
  border: none;
  flex-shrink: 0;
}

/* Mobile burger (nascosto su desktop, riusa lo scrim per drawer nav) */
.zp-topbar { display: none; }

/* ── Popover generico dei gruppi nav ─────────────────────────── */
.zp-nav-popover-backdrop {
  /* z-index deliberatamente sotto la topbar (100): la topbar crea il proprio stacking
     context (position:sticky + z-index), quindi i popover al suo interno restano
     "intrappolati" in quel contesto — se il backdrop avesse uno z-index più alto della
     topbar intercetterebbe tutti i click sul popover anche stando sotto visivamente. */
  position: fixed;
  inset: 0;
  background: rgba(28, 18, 10, 0.28);
  z-index: 60;
}
.zp-nav-popover {
  position: absolute;
  top: 56px;
  background: var(--surface);
  border-radius: var(--r-popover, 12px);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 200;
  width: 300px;
  max-width: calc(100vw - 32px);
}
.zp-nav-popover-title {
  padding: 16px 20px 8px;
  font-size: var(--text-eyebrow);
  font-weight: var(--weight-black);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--ember-600);
}
.zp-nav-popover-list { padding: 0 12px 12px; }
.zp-nav-popover-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  box-sizing: border-box;
}
.zp-nav-popover-item:hover { background: var(--panel-soft); }
.zp-nav-popover-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg-900);
  color: var(--text-soft);
  display: grid;
  place-items: center;
  font-size: 0.84rem;
  flex-shrink: 0;
}
.zp-nav-popover-label { min-width: 0; flex: 1; }
.zp-nav-popover-name { font-size: 0.82rem; font-weight: var(--weight-bold); color: var(--ink-900); }
.zp-nav-popover-desc { font-size: 0.7rem; color: var(--text-faint); margin-top: 1px; }
.zp-nav-popover-item .zp-nav-badge { background: var(--ember-100); color: var(--ember-700); }

/* ── Mega-popover Catalogo (2 colonne) ───────────────────────── */
.zp-catalog-popover {
  position: absolute;
  top: 56px;
  left: max(16px, min(280px, calc(100vw - 640px)));
  width: 608px;
  max-width: calc(100vw - 32px);
  background: var(--surface);
  border-radius: var(--r-popover, 12px);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 200;
}
.zp-catalog-popover-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 20px 16px;
  flex-wrap: wrap;
}
.zp-catalog-popover-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--bg-900);
}
.zp-catalog-popover-col { padding: 16px 20px; }
.zp-catalog-popover-col + .zp-catalog-popover-col { border-left: 1px solid var(--bg-900); }
.zp-catalog-popover-col-title {
  font-size: var(--text-eyebrow);
  font-weight: var(--weight-black);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 12px;
}
.zp-catalog-popover-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: var(--panel-soft);
  border-top: 1px solid var(--bg-900);
}

/* ── User menu popover ────────────────────────────────────────── */
.zp-user-popover {
  position: absolute;
  top: 64px;
  right: 24px;
  width: 260px;
  background: var(--surface);
  border-radius: var(--r-md, 12px);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 200;
}
.zp-user-popover-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--bg-900);
}
.zp-user-popover-name { font-size: 0.84rem; font-weight: var(--weight-black); color: var(--ink-900); }
.zp-user-popover-role { font-size: 0.7rem; color: var(--text-faint); }
.zp-user-popover-body { padding: 8px; }
.zp-user-popover-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: var(--weight-semibold);
  color: var(--ink-700);
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  text-decoration: none;
  box-sizing: border-box;
}
.zp-user-popover-item:hover { background: var(--panel-soft); }
.zp-user-popover-item.danger { color: var(--danger); }

/* ── Content column ─────────────────────────────────────────── */
.zp-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 56px);
}

/* ── Main ────────────────────────────────────────────────────── */
.zp-main {
  flex: 1;
  overflow-y: auto;
  padding: 16px 32px 32px;
  width: 100%;
  box-sizing: border-box;
}
.zp-main > * {
  animation: zp-page-enter 0.3s var(--ease) both;
}

/* ── Command palette ─────────────────────────────────────────── */
.zp-cmd-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(36, 26, 18, 0.4);
  z-index: 1060;
  backdrop-filter: blur(2px);
}
.zp-cmd-shell {
  position: fixed;
  inset: 0;
  z-index: 1070;
  display: flex;
  justify-content: center;
  padding-top: 14vh;
  pointer-events: none;
}
.zp-cmd-card {
  width: min(560px, 92vw);
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line-strong);
  overflow: hidden;
  pointer-events: all;
  animation: zp-fade 0.18s var(--ease-out) both;
}
.zp-cmd-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-400);
  font-size: 1.05rem;
}
.zp-cmd-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: var(--ink-900);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: var(--weight-medium);
}
.zp-cmd-input::placeholder { color: var(--ink-400); }
.zp-cmd-results {
  max-height: 400px;
  overflow-y: auto;
  padding: 6px;
}
.zp-cmd-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: none;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  transition: background var(--dur-fast) var(--ease);
}
.zp-cmd-item:hover { background: var(--paper-sunk); }
.zp-cmd-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--ember-50);
  display: grid;
  place-items: center;
  color: var(--ember-600);
  flex-shrink: 0;
}
.zp-cmd-label {
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
  color: var(--ink-900);
}
.zp-cmd-group {
  font-size: var(--text-xs);
  color: var(--ink-400);
}

/* ── Admin passcode gate (blocco pieno post-login, non chiudibile) ── */
.zp-admin-gate {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--bg-900, #1c1410);
}
.zp-admin-gate-card {
  width: min(380px, 92vw);
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line-strong);
  padding: 26px 24px 22px;
  text-align: center;
}
.zp-admin-gate-icon {
  width: 46px;
  height: 46px;
  margin: 0 auto 12px;
  border-radius: 12px;
  background: var(--ember-50);
  color: var(--ember-600);
  display: grid;
  place-items: center;
  font-size: 1.3rem;
}
.zp-admin-gate-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--ink-900);
}
.zp-admin-gate-text {
  font-size: .85rem;
  color: var(--ink-400);
  margin: 8px 0 16px;
}
.zp-admin-gate-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin-top: 14px;
  padding: 8px;
  border: none;
  background: none;
  color: var(--ink-400);
  font-size: .8rem;
  cursor: pointer;
}
.zp-admin-gate-logout:hover { color: var(--danger); }

/* ── Drawer (run monitor) ───────────────────────────────────── */
.zp-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(36, 26, 18, 0.4);
  z-index: 400;
}
.zp-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 460px;
  height: 100vh;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  z-index: 410;
  display: flex;
  flex-direction: column;
  animation: zp-drawer-in 0.26s cubic-bezier(0.16, 1, 0.3, 1) both;
  overflow: hidden;
}
.zp-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.zp-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.zp-drawer-close {
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: var(--ink-500);
  cursor: pointer;
}
.zp-drawer-close:hover { color: var(--ink-900); }

/* Spinner */
.zp-spin { animation: zp-spin 1s linear infinite; }

/* ── Run strip banner ────────────────────────────────────────── */
.zp-run-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--ember-50);
  border: 1px solid var(--line-ember);
  border-radius: 12px;
  margin-bottom: 20px;
  color: var(--ember-700);
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
}
.zp-run-strip .zp-spin { color: var(--ember-600); }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1180px) {
  .zv2-split { grid-template-columns: minmax(0, 1fr) !important; }
  .zv2-side, .zp-inspector { position: static !important; }
}
@media (max-width: 1080px) {
  .zp-main { padding: 16px 24px 24px; }
}
@media (max-width: 900px) {
  .zp-topbar-clock { display: none; }
  .zp-drawer { width: 100%; }
}

/* ── Nav mobile: sotto gli 860px la riga orizzontale di voci sparisce,
   sostituita da un bottone hamburger + drawer a tutta larghezza ─────── */
.zp-mobile-burger {
  display: none;
  width: 36px; height: 36px;
  border: none; background: transparent; color: #fff;
  border-radius: 8px;
  align-items: center; justify-content: center;
  font-size: 1.2rem; cursor: pointer; flex-shrink: 0;
  margin-left: auto;
}
.zp-mobile-burger:hover { background: rgba(255,255,255,.1); }

@media (max-width: 860px) {
  .zp-nav { display: none; }
  .zp-mobile-burger { display: flex; }
  .zp-topbar-right { margin-left: 12px; }
  .zp-brand-link { margin-right: 12px; }
  .zp-topbar-sep { display: none; }
}
@media (max-width: 640px) {
  .zp-topbar-main { padding: 0 16px; }
  .zp-wordmark-text { font-size: 0.9rem; }
  .zp-main { padding: 12px 16px 20px; }
  .zp-user-popover { right: 16px; }
}

.zp-mobile-nav-backdrop {
  position: fixed; inset: 0; top: 56px;
  background: rgba(28, 18, 10, 0.4);
  z-index: 150;
}
.zp-mobile-nav {
  position: fixed;
  top: 56px; left: 0; right: 0;
  max-height: calc(100vh - 56px);
  overflow-y: auto;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  z-index: 151;
  padding: 8px 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.zp-mobile-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--ink-700);
  font-weight: var(--weight-semibold);
  font-size: 0.9rem;
}
.zp-mobile-nav-item i { color: var(--ink-500); width: 18px; text-align: center; flex-shrink: 0; }
.zp-mobile-nav-item:hover { background: var(--panel-soft); }
.zp-mobile-nav-item.active { background: var(--ember-500); color: #fff; }
.zp-mobile-nav-item.active i { color: #fff !important; }
.zp-mobile-nav-item--sub { padding-left: 30px; font-size: 0.86rem; }
.zp-mobile-nav-item .zp-nav-badge { margin-left: auto; }
.zp-mobile-nav-group-label {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 14px 4px;
  font-size: var(--text-eyebrow);
  font-weight: var(--weight-black);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--text-faint);
}

/* ── KPI strip: card unica, celle separate da bordo (Dashboard, Inventario, ecc.) ── */
.zp-kpi-strip {
  display: grid;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 16px;
}
.zp-kpi-cell {
  padding: 16px 20px;
  border-left: 1px solid var(--bg-900);
  margin-left: -1px;
}
.zp-kpi-cell:first-child { border-left: none; margin-left: 0; }
.zp-kpi-cell.warn { background: #FCF3E9; }
.zp-kpi-label { font-size: 0.74rem; font-weight: var(--weight-semibold); color: var(--text-soft); margin-bottom: 6px; }
.zp-kpi-value {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: var(--weight-black);
  letter-spacing: var(--tracking-tight);
  color: var(--ink-900);
  line-height: 1;
}
.zp-kpi-value .zp-kpi-suffix { font-size: 0.9rem; font-weight: var(--weight-bold); color: var(--ink-300); }
.zp-kpi-sub { font-size: 0.72rem; font-weight: var(--weight-semibold); color: var(--text-faint); margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.zp-kpi-sub.warn { color: var(--ember-700); }
@media (max-width: 900px) {
  .zp-kpi-strip { grid-template-columns: repeat(2, 1fr) !important; }
  .zp-kpi-cell:nth-child(2n+1) { border-left: none; margin-left: 0; }
}
@media (max-width: 480px) {
  /* Telefono stretto: 2 colonne diventano illeggibili con etichette/numeri lunghi — 1 sola colonna */
  .zp-kpi-strip { grid-template-columns: 1fr !important; }
  .zp-kpi-cell { border-left: none !important; margin-left: 0 !important; border-top: 1px solid var(--bg-900); }
  .zp-kpi-cell:first-child { border-top: none; }
}

/* ── Underline tabs (Inventario, Settings, Ticket, Tornei...) ─── */
.zp-tabline {
  display: flex;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.zp-tabline-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 2px 12px;
  font-size: 0.86rem;
  font-weight: var(--weight-semibold);
  color: var(--text-faint);
  cursor: pointer;
  position: relative;
  background: none;
  border: none;
  font-family: var(--font-sans);
}
.zp-tabline-item:hover { color: var(--ink-700); }
.zp-tabline-item.active { font-weight: var(--weight-black); color: var(--ink-900); }
.zp-tabline-item .zp-tabline-bar {
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: transparent;
}
.zp-tabline-item.active .zp-tabline-bar { background: var(--ember-500); }

/* ── Inspector panel laterale (riga selezionata) ─────────────── */
.zp-inspector {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
  position: sticky;
  top: 72px;
}
.zp-inspector-eyebrow {
  font-size: 0.64rem;
  font-weight: var(--weight-black);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--ember-600);
  margin-bottom: 6px;
}
.zp-inspector-close {
  margin-left: auto;
  width: 28px; height: 28px;
  border: none; background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  font-size: 0.85rem;
}
.zp-inspector-meta-row {
  display: flex; align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--bg-900);
  font-size: 0.76rem;
}
.zp-inspector-meta-row span:last-child { margin-left: auto; font-weight: var(--weight-bold); color: var(--ink-900); }

/* ── Dashboard specific ─────────────────────────────────────── */
.zp-hero-card {
  background: var(--inverse-surface);
  border-radius: var(--r-lg);
  padding: 20px 24px;
  color: #fff;
}
.zp-quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.zp-quick-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  text-decoration: none;
  color: var(--ink-900);
}
.zp-quick-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); color: var(--ink-900); }
.zp-quick-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--ember-50);
  display: grid;
  place-items: center;
  color: var(--ember-600);
  font-size: 1.3rem;
}
@media (max-width: 900px) {
  .zp-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .zp-quick-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Tab segmented control ───────────────────────────────────── */
.zp-tabs {
  display: inline-flex;
  background: var(--paper-sunk);
  border-radius: 12px;
  padding: 4px;
  gap: 2px;
}
.zp-tab {
  padding: 8px 18px;
  border-radius: 10px;
  border: none;
  background: none;
  color: var(--ink-500);
  font-family: var(--font-sans);
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.zp-tab:hover { background: var(--surface); color: var(--ink-900); }
.zp-tab.active {
  background: var(--surface);
  color: var(--ink-900);
  box-shadow: var(--shadow-xs);
}

/* ── Accordion ───────────────────────────────────────────────── */
.zp-accordion-item {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.zp-accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  color: var(--ink-900);
}
.zp-accordion-header:hover { background: var(--paper-sunk); }
.zp-accordion-body { padding: 16px 20px 20px; border-top: 1px solid var(--line); }

/* ── Modal ───────────────────────────────────────────────────── */
.zp-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(36, 26, 18, 0.4);
  z-index: 2000;
  backdrop-filter: blur(3px);
}
.zp-modal-shell {
  position: fixed;
  inset: 0;
  z-index: 2010;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 60px 24px 24px;
  pointer-events: none;
}
.zp-modal-shell > * { pointer-events: auto; }
.zp-modal-card {
  width: 100%;
  max-width: 720px;
  max-height: calc(100vh - 84px);
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-modal, var(--shadow-lg));
  border: 1px solid var(--line);
  overflow-y: auto;
  padding: 28px 32px;
  animation: zp-page-enter 0.2s var(--ease-out) both;
}
.zp-modal-card.zp-modal-card--lg { max-width: min(1080px, calc(100vw - 48px)); }
.zp-modal-card.zp-modal-card--sm { max-width: 500px; }
.zp-modal-x {
  width: 34px; height: 34px; flex-shrink: 0;
  border: 1px solid var(--line); background: var(--surface);
  border-radius: 9px; cursor: pointer; color: var(--ink-500);
  display: grid; place-items: center; font-size: .9rem;
}
.zp-modal-head {
  padding: 24px 24px 0;
}
.zp-modal-body {
  padding: 16px 24px;
}
.zp-modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--line);
}
.zp-modal-foot-left {
  margin-right: auto;
}

/* ── Util: pulse dot ─────────────────────────────────────────── */
.zp-pulse {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ember-500);
  animation: zp-pulse-dot 1.4s ease-in-out infinite;
}

/* ── Page wrapper ─────────────────────────────────────────────── */
.zp-page { animation: zp-page-enter 0.3s var(--ease) both; }
