/* E-commerce tab, Visitors part: the counts, the funnel and top lists, the log, a visitor's timeline, live now and settings.
   Party Villa's colours from style.css; the part's own colours are tokens below (a dark set follows data-theme="dark"). */
.vz {
  --vz-track: #eef1ef; --vz-live-bg: #f1fbf4; --vz-live-line: #9fd4b1; --vz-live: #1f9d55; --vz-note-bg: #fff6dc; --vz-note-line: #f2db9a; --vz-note-ink: #6b4a00;
  --vz-chip: #f4f6f5; --vz-row-hover: #f6f9f8; --vz-ord-bg: #e8f1ee; --vz-ord-ink: var(--brand, #14433f); --vz-bad: var(--bad, #b3261e);
  --vz-wa: #1f9d55; --vz-google: #3367d6; --vz-ig: #c13584; --vz-fb: #1877f2; --vz-pick: #a15c00; --vz-camp: #6b4fbb; --vz-web: #0e7a6b; --vz-other: #5d6b67;
  padding: 18px 20px 40px; max-width: 1180px; overflow-y: auto; overflow-x: hidden; height: 100%; box-sizing: border-box;
}
:root[data-theme="dark"] .vz {
  --vz-track: #2a3331; --vz-live-bg: #14281d; --vz-live-line: #2f6b47; --vz-live: #4cc985; --vz-note-bg: #3a2f12; --vz-note-line: #6b5520; --vz-note-ink: #f4dc9a;
  --vz-chip: #24302d; --vz-row-hover: #1d2725; --vz-ord-bg: #1d3530; --vz-ord-ink: #9fe0cf; --vz-bad: #ff8a80;
}
.vz-head h1 { margin: 0 0 4px; font-size: 1.35rem; }
.vz-head p { margin: 0 0 10px; }
.vz-note { background: var(--vz-note-bg); border: 1px solid var(--vz-note-line); color: var(--vz-note-ink); border-radius: var(--radius); padding: 10px 14px; }
.vz-pad { padding: 14px 4px; }
.vz-ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -4px; }
.vz-grow { flex: 1; }
.vz-n small, .vz-c-num small { color: var(--muted); font-weight: 400; }

/* tabs */
.vz-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 0 14px; overflow-x: auto; scrollbar-width: none; }
.vz-tab { padding: 8px 14px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 600; font-size: .92rem; }
.vz-tab.on { color: var(--brand-2, #0e7a6b); border-bottom-color: var(--brand-2, #0e7a6b); }

/* counts */
.vz-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.vz-card { display: flex; flex-direction: column; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; min-width: 0; }
.vz-label { display: flex; align-items: center; gap: 7px; font-size: .8rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.vz-card strong { font-size: 1.7rem; line-height: 1.2; color: var(--ink); font-variant-numeric: tabular-nums; }
.vz-sub { font-size: .8rem; color: var(--muted); }
.vz-live { border-color: var(--vz-live-line); background: var(--vz-live-bg); }
.vz-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--vz-live); box-shadow: 0 0 0 0 rgba(31, 157, 85, .5); animation: vz-pulse 1.8s ease-out infinite; flex: none; }
@keyframes vz-pulse { 70% { box-shadow: 0 0 0 7px rgba(31, 157, 85, 0); } 100% { box-shadow: 0 0 0 0 rgba(31, 157, 85, 0); } }
@media (prefers-reduced-motion: reduce) { .vz-dot { animation: none; } }

/* boxes, bars */
.vz-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--gap); margin-top: var(--gap); align-items: start; }
.vz-box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; min-width: 0; }
.vz-box h2, .vz-h2 { margin: 0 0 4px; font-size: 1rem; }
.vz-h2 { margin: 18px 0 8px; }
.vz-box > p { margin: 0 0 8px; }
.vz-bars, .vz-steps { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.vz-bars li { display: grid; grid-template-columns: 96px minmax(0, 1fr) 44px; align-items: center; gap: 8px; font-size: .8rem; }
.vz-steps { gap: 6px; }
.vz-steps li { display: grid; grid-template-columns: 120px minmax(0, 1fr) 92px; align-items: center; gap: 8px; font-size: .88rem; }
.vz-day, .vz-step-t { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vz-track { height: 12px; background: var(--vz-track); border-radius: 6px; overflow: hidden; }
.vz-steps .vz-track { height: 16px; border-radius: 8px; }
.vz-bar { display: block; height: 100%; background: var(--brand-2, #0e7a6b); border-radius: inherit; min-width: 0; }
.vz-n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.vz-funnel { margin-top: var(--gap); }
.vz-bar-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 14px 0 0; }
.vz-tbl { width: 100%; border-collapse: collapse; font-size: .88rem; }
.vz-tbl th { text-align: left; font-size: .75rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding: 6px 6px; border-bottom: 1px solid var(--line); }
.vz-tbl td { padding: 7px 6px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.vz-tbl tr:last-child td { border-bottom: 0; }
.vz-tbl .num { text-align: right; white-space: nowrap; }
.vz-path { font-family: ui-monospace, Consolas, monospace; font-size: .82rem; overflow-wrap: anywhere; }

/* top lists */
.vz-tops { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); margin-top: var(--gap); align-items: start; }
.vz-top, .vz-plist { list-style: none; margin: 6px 0 0; padding: 0; counter-reset: vz; }
.vz-top li, .vz-plist li { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: .88rem; min-width: 0; }
.vz-top li:last-child, .vz-plist li:last-child { border-bottom: 0; }
.vz-top li > :first-child, .vz-plist li > :first-child { min-width: 0; overflow-wrap: anywhere; }
.vz-link { background: none; border: 0; padding: 0; color: var(--ink); font: inherit; text-align: left; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
.vz-link:hover { color: var(--brand-2, #0e7a6b); text-decoration: underline; }
.vz-q { overflow-wrap: anywhere; }
.vz-bad { color: var(--vz-bad); }

/* chips: dates and sources */
.vz-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.vz-chip { border: 1px solid var(--line); background: var(--vz-chip); color: var(--ink); border-radius: 16px; padding: 5px 12px; font: inherit; font-size: .85rem; cursor: pointer; min-height: 32px; }
.vz-chip.on { background: var(--brand-2, #0e7a6b); border-color: var(--brand-2, #0e7a6b); color: #fff; }
.vz-dates { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.vz-dates input { min-height: 32px; max-width: 150px; }
.vz-src { display: inline-block; font-size: .75rem; font-weight: 600; padding: 1px 8px; border-radius: 10px; color: #fff; background: var(--vz-other); white-space: nowrap; }
.vz-src-whatsapp { background: var(--vz-wa); }
.vz-src-google { background: var(--vz-google); }
.vz-src-instagram { background: var(--vz-ig); }
.vz-src-facebook { background: var(--vz-fb); }
.vz-src-pick { background: var(--vz-pick); }
.vz-src-campaign { background: var(--vz-camp); }
.vz-src-website { background: var(--vz-web); }
.vz-src-direct { background: var(--vz-chip); color: var(--ink); border: 1px solid var(--line); }
.vz-ord { display: inline-block; font-size: .78rem; font-weight: 600; padding: 1px 8px; border-radius: 10px; background: var(--vz-ord-bg); color: var(--vz-ord-ink); text-decoration: none; white-space: nowrap; }
a.vz-ord:hover { text-decoration: underline; }
.vz-paid { font-size: .75rem; font-weight: 700; color: var(--ok, #1f7a3d); }
.vz-dev { display: inline-flex; color: var(--muted); }

/* filters */
.vz-filters { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.vz-frow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) repeat(2, minmax(0, 1.4fr)) minmax(0, 1.6fr); gap: 8px; }
.vz-f { display: flex; flex-direction: column; gap: 3px; font-size: .8rem; color: var(--muted); min-width: 0; }
.vz-f select, .vz-f input { width: 100%; min-width: 0; font-size: .95rem; color: var(--ink); min-height: 36px; }
.vz-factions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vz-factions .btn { display: inline-flex; align-items: center; gap: 6px; }

/* the log: a table on a computer, cards on a phone */
.vz-list { margin-top: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.vz-row { display: grid; grid-template-columns: 34px minmax(0, 2fr) minmax(0, 1.5fr) minmax(0, 1.3fr) 56px 56px minmax(0, 1.2fr) minmax(0, 1fr); gap: 10px; align-items: center;
  padding: 9px 12px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: .88rem; min-width: 0; }
.vz-row:last-child { border-bottom: 0; }
.vz-row.vz-click { position: relative; cursor: pointer; }
.vz-row.vz-click:hover { background: var(--vz-row-hover); }
/* the visitor's name is the row's link, stretched over the whole row; the order chips sit above it */
.vz-stretch { color: inherit; text-decoration: none; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.vz-stretch::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.vz-stretch:focus-visible { outline: none; }
.vz-stretch:focus-visible::after { outline: 2px solid var(--brand-2, #0e7a6b); outline-offset: -2px; }
.vz-c-ord .vz-ord { position: relative; z-index: 1; }
.vz-cut { margin: 8px 0 0; }
.vz-rhead { font-size: .72rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding-top: 7px; padding-bottom: 7px; }
.vz-row > span { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.vz-row small { color: var(--muted); font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vz-row b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vz-c-dev { flex-direction: row !important; align-items: center; gap: 4px !important; }
.vz-c-src { align-items: flex-start; }
.vz-c-num { text-align: right; align-items: flex-end; }
.vz-c-land { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block !important; }
.vz-c-ord { flex-direction: row !important; flex-wrap: wrap; gap: 4px !important; }
.vz-lrow { grid-template-columns: 34px minmax(0, 1.6fr) minmax(0, .8fr) minmax(0, 2fr) minmax(0, 1fr); }
.vz-more { text-align: center; margin: 12px 0; }
.vz-livehead { display: flex; align-items: center; gap: 8px; margin: 0; }

/* one visitor */
.vz-back { display: inline-flex; align-items: center; gap: 4px; color: var(--brand-2, #0e7a6b); text-decoration: none; font-weight: 600; margin-bottom: 10px; }
.vz-vtitle { display: flex; gap: 10px; align-items: flex-start; }
.vz-vtitle .vz-dev .vz-ic { width: 30px; height: 30px; }
.vz-vtitle h2 { font-size: 1.15rem; overflow-wrap: anywhere; }
.vz-vtitle p { margin: 2px 0 0; }
.vz-livetag { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; color: var(--vz-live); font-weight: 600; vertical-align: middle; }
.vz-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 16px; margin: 12px 0 0; }
.vz-facts div { min-width: 0; }
.vz-facts dt { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.vz-facts dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.vz-orders { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.vz-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.vz-visit { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; min-width: 0; }
.vz-visit header { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 8px; }
.vz-visit header > span { display: inline-flex; align-items: center; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.vz-tl { list-style: none; margin: 0; padding: 0 0 0 10px; border-left: 2px solid var(--line); }
.vz-ev { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 8px; padding: 4px 0 4px 10px; position: relative; font-size: .88rem; }
.vz-ev::before { content: ''; position: absolute; left: -16px; top: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--line); border: 2px solid var(--panel); }
.vz-ev time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .8rem; }
.vz-ev span { overflow-wrap: anywhere; }
.vz-ev-product::before, .vz-ev-catalogue::before { background: var(--brand-2, #0e7a6b); }
.vz-ev-cart_add::before, .vz-ev-cart_set::before { background: var(--vz-pick); }
.vz-ev-order::before, .vz-ev-paid::before { background: var(--vz-live); }
.vz-ev-order span, .vz-ev-paid span { font-weight: 600; }
.vz-ev-search::before { background: var(--vz-google); }

/* settings */
.vz-set { margin-bottom: var(--gap); }
.vz-keep { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.vz-keep input { width: 120px; }
.vz-privacy { margin: 6px 0; line-height: 1.5; }

@media (max-width: 1000px) {
  .vz-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vz-grid, .vz-three { grid-template-columns: minmax(0, 1fr); }
  .vz-tops { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vz-frow { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .vz { padding: 12px 12px 30px; }
  .vz-card strong { font-size: 1.4rem; }
  .vz-bars li { grid-template-columns: 84px minmax(0, 1fr) 36px; }
  .vz-steps li { grid-template-columns: 96px minmax(0, 1fr) 76px; font-size: .82rem; }
  .vz-tops { grid-template-columns: minmax(0, 1fr); }
  .vz-frow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vz-fq { grid-column: 1 / -1; }
  .vz-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* the log as cards */
  .vz-list { background: none; border: 0; display: flex; flex-direction: column; gap: 8px; }
  .vz-rhead { display: none; }
  .vz-row, .vz-lrow { grid-template-columns: 30px minmax(0, 1fr) auto; grid-template-areas: 'dev who when' 'dev src src' 'dev land land' 'dev ord ord';
    background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); gap: 4px 8px; }
  .vz-row:last-child { border-bottom: 1px solid var(--line); }
  .vz-c-dev { grid-area: dev; align-self: start; }
  .vz-c-who { grid-area: who; }
  .vz-c-when { grid-area: when; align-items: flex-end; text-align: right; }
  .vz-c-src { grid-area: src; flex-direction: row !important; align-items: center !important; gap: 6px !important; }
  .vz-c-land { grid-area: land; }
  .vz-c-ord { grid-area: ord; }
  .vz-c-ord:empty, .vz-c-land:empty { display: none !important; }
  .vz-row .vz-c-num { display: none; }
  .vz-c-on { grid-area: land; }
  .vz-lrow .vz-c-src { grid-area: when; justify-content: flex-end; }
  .vz-dates input { max-width: 130px; }
}
@media (max-width: 380px) {
  .vz-cards { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  .vz-card { padding: 10px; }
  .vz-frow { grid-template-columns: minmax(0, 1fr); }
  .vz-facts { grid-template-columns: minmax(0, 1fr); }
}
