/* QR4Events customer dashboard (works with the qr4events theme's tokens) */
.q4e { display: grid; gap: 1.75rem; align-items: start; }
@media (min-width: 960px) { .q4e { grid-template-columns: 230px minmax(0, 1fr); } }
/* The dashboard uses more of a wide screen than the marketing pages, so the codes table fits */
.wrap.q4e { max-width: 1480px; }
@media (min-width: 1280px) { .q4e { grid-template-columns: 210px minmax(0, 1fr); } }
.q4e-side { display: grid; gap: 1rem; }
@media (min-width: 960px) { .q4e-side { position: sticky; top: 84px; } }
.q4e-side nav { display: flex; flex-wrap: wrap; gap: .25rem; }
@media (min-width: 960px) { .q4e-side nav { flex-direction: column; } }
.q4e-side nav a { padding: .55rem .85rem; border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 600; font-size: .95rem; }
.q4e-side nav a:hover { background: #e9eef5; }
.q4e-side nav a.q4e-side__help { font-weight: 500; color: var(--muted); }
@media (min-width: 960px) { .q4e-side nav a.q4e-side__help { margin-top: .5rem; border-top: 1px solid var(--border); border-radius: 0; padding-top: .8rem; } }
.q4e-helplink { float: right; margin: 0 0 .5rem 1rem; font-size: .85rem; font-weight: 600; color: var(--accent-strong); }
.q4e-helplink::before { content: "?"; display: inline-grid; place-items: center; width: 1.15rem; height: 1.15rem; margin-right: .35rem; border-radius: 50%; background: var(--accent-strong); color: #fff; font-size: .72rem; }
.q4e-side nav a.is-active { background: var(--ink); color: #fff; }
.q4e-side__plan { display: grid; gap: .2rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem 1rem; font-size: .875rem; color: var(--muted); }
.q4e-side__plan b { color: var(--text); font-size: 1.05rem; }
.q4e-side__plan .q4e-pill { justify-self: start; margin-bottom: .2rem; }

.q4e-main { min-width: 0; }
.q4e-head { margin-bottom: 1.25rem; }
.q4e-head h1 { font-size: clamp(1.7rem, 3vw, 2.2rem); margin: 0 0 .25rem; }
.q4e-head p { margin: 0; }
.q4e-alert { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }
.q4e-alert .btn, .q4e-alert form { margin-left: auto; }

.q4e-pill { display: inline-block; border-radius: 999px; padding: .1rem .6rem; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.q4e-pill.is-ok { background: #dcf5e7; color: #14532d; }
.q4e-pill.is-warn { background: #fdecc8; color: #7a4b00; }
.q4e-pill.is-bad { background: #fde2e2; color: #8a1c1c; }

.q4e-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.35rem 1.5rem; margin: 0 0 1.25rem; }
.q4e-card h2 { font-size: 1.35rem; margin: 0 0 .5rem; }
.q4e-card__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: .75rem; margin-bottom: 1rem; }
.q4e-card__head h2 { margin: 0; }
.q4e-card__actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.q4e-empty { background: var(--surface); border: 1px dashed #c4cdd9; border-radius: var(--radius); padding: 1.5rem; color: var(--muted); }
.q4e-upsell { background: radial-gradient(500px 200px at 100% 0%, rgba(163, 230, 53, .2), transparent 70%), var(--ink); color: var(--ink-text); border-radius: var(--radius); padding: 1.75rem; }
.q4e-upsell h2 { color: #fff; margin: 0 0 .4rem; }
.q4e-upsell p { color: var(--ink-muted); margin: 0 0 1.1rem; max-width: 40rem; }

/* stats */
.q4e-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .75rem; margin-bottom: 1.1rem; }
.q4e-kpis div { border: 1px solid var(--border); border-radius: 12px; padding: .7rem .9rem; }
.q4e-kpis b { display: block; font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.q4e-kpis span { font-size: .78rem; color: var(--muted); }
.q4e-chart { display: flex; align-items: flex-end; gap: 2px; height: 120px; border-bottom: 1px solid var(--border); }
.q4e-chart__bar { flex: 1 1 0; min-width: 0; position: relative; border-radius: 3px 3px 0 0; background: #c9e99a; }
.q4e-chart__bar.is-zero { background: #e8ecf2; }
.q4e-chart__bar i { position: absolute; left: 0; right: 0; bottom: 0; background: #4d7c0f; border-radius: 3px 3px 0 0; }
.q4e-chart__axis { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); margin: .3rem 0 1rem; }
.q4e-splits { display: grid; gap: 1rem 2rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.q4e-split h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.q4e-hbar { display: grid; grid-template-columns: 6rem 1fr 3rem; gap: .5rem; align-items: center; font-size: .85rem; margin-bottom: .3rem; }
.q4e-hbar__track { height: .5rem; border-radius: 999px; background: #e8ecf2; overflow: hidden; }
.q4e-hbar__track i { display: block; height: 100%; background: #4d7c0f; }
.q4e-hbar span:last-child { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.q4e-range { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .8rem; }
.q4e-range a { padding: .3rem .75rem; border: 1px solid var(--border); border-radius: 999px; text-decoration: none; color: var(--muted); font-size: .85rem; background: var(--surface); }
.q4e-range a.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }

.q4e-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.q4e-table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: .5rem .6rem; border-bottom: 1px solid var(--border); }
.q4e-table td { padding: .55rem .6rem; border-bottom: 1px solid #eef1f5; }
.q4e-table tr:last-child td { border-bottom: 0; }
.q4e-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.q4e-table tr.is-paused td { color: var(--muted); }
table.q4e-card { padding: 0; overflow: hidden; display: table; }
.q4e-codes { margin-top: .25rem; }
.q4e-codes summary { cursor: pointer; font-weight: 600; color: var(--muted); }
.q4e-share { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; background: var(--accent-soft); border-radius: 12px; padding: .6rem .8rem; margin: -.25rem 0 1rem; font-size: .9rem; }
.q4e-share input { flex: 1 1 18rem; min-width: 0; padding: .4rem .6rem; border: 1px solid var(--border); border-radius: 8px; font: inherit; font-size: .85rem; }

/* forms */
.q4e-form { display: grid; gap: .5rem; max-width: 40rem; }
.q4e-fields { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.q4e-fields__wide { grid-column: 1 / -1; }
/* UK VAT or reverse charge, switched by the billing country (data-rc on the form) */
form:not([data-rc]) .q4e-rc-only, [data-rc] .q4e-uk-only { display: none; }
.q4e-fields__check { display: block; margin-top: .3rem; color: var(--muted, #64748b); font-size: .8rem; }
.q4e-fields__check.is-ok { color: #15803d; }
.q4e-fields__note { margin: 0 0 1rem; padding: .6rem .8rem; border-radius: 8px; background: #f1f5f9; font-size: .875rem; }
.req { color: var(--bad); }
.q4e-agree { display: flex; gap: .5rem; align-items: flex-start; margin-top: .25rem; }

/* plan */
.q4e-plan { display: grid; gap: 1rem 2rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); align-items: start; }
.q4e-plan__main h2 { font-size: 1.8rem; margin: .35rem 0 0; }
.q4e-plan__main p { margin: 0; }
.q4e-plan__facts { margin: 0; display: grid; gap: .4rem; }
.q4e-plan__facts div { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px solid #eef1f5; padding-bottom: .35rem; }
.q4e-plan__facts dt { color: var(--muted); }
.q4e-plan__facts dd { margin: 0; font-weight: 600; text-align: right; }
.q4e-plan__features { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; font-size: .92rem; grid-column: 1 / -1; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.q4e-plan__features li::before { content: "\2713"; color: #4d7c0f; font-weight: 800; margin-right: .45rem; }
.q4e-plan__actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .5rem; }
.q4e-buy h2 { margin-bottom: .75rem; }
.q4e-options { border: 0; padding: 0; margin: 0 0 1.5rem; }
.q4e-options legend { font-weight: 800; margin-bottom: .75rem; font-size: 1.05rem; }
.q4e-option-group { border: 1px solid var(--border); border-radius: 12px; padding: .8rem 1rem; margin-bottom: .6rem; }
.q4e-option-group.is-wanted { border-color: var(--ink); box-shadow: 0 0 0 2px var(--accent-soft); }
.q4e-option-group__head { margin-bottom: .4rem; }
.q4e-option-group__choices { display: grid; gap: .4rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.q4e-choice { display: grid; grid-template-columns: auto 1fr; gap: .1rem .6rem; align-items: center; border: 1px solid #e3e8ef; border-radius: 10px; padding: .6rem .75rem; cursor: pointer; }
.q4e-choice:hover { border-color: var(--muted); }
.q4e-choice:has(input:checked) { border-color: var(--ink); background: #f5fbe9; }
.q4e-choice input { grid-row: span 2; accent-color: #4d7c0f; }
.q4e-choice__main { font-weight: 600; }
.q4e-choice__main em { display: block; font-style: normal; font-weight: 400; font-size: .8rem; color: var(--muted); }
.q4e-choice__price { font-weight: 800; }
.q4e-choice__price small { font-weight: 500; color: var(--muted); }
.q4e-credit { display: block; color: #3f6212 !important; }
.q4e-choice.is-off { cursor: default; opacity: .7; }
.q4e-choice.is-off:hover { border-color: #e3e8ef; }
.q4e-choice__why { font-size: .8rem; color: var(--muted); }
.q4e-history summary { cursor: pointer; font-weight: 700; }
.q4e-history ul { margin: .75rem 0 0; padding-left: 1.1rem; display: grid; gap: .3rem; font-size: .9rem; }

/* the qr-link-tracker builder, with Admin 2's colour names mapped to the theme */
.q4e-builder {
  --background: #ffffff; --foreground: var(--text); --card: #ffffff; --card-foreground: var(--text);
  --muted: #f1f4f8; --muted-foreground: #5d687c; --border: #e2e8f0; --input: #d5dce6; --ring: #4d7c0f;
  --primary: #0a1120; --primary-foreground: #ffffff; --accent: #eef2f7; --popover: #ffffff;
  --success: #2f9e6b; --warning: #d9930d; --destructive: #c53030; --radius: 12px; --text-sm: .9rem; --text-xl: 1.5rem;
  font-size: .92rem;
}
q4e-builder { display: block; min-height: 300px; }

/* toasts and dialogs (for the builder) */
.q4e-toasts { position: fixed; right: 1rem; bottom: 1rem; display: grid; gap: .5rem; z-index: 1000; max-width: min(24rem, calc(100vw - 2rem)); }
.q4e-toast { background: var(--ink); color: #fff; border-radius: 12px; padding: .7rem 1rem; box-shadow: var(--shadow-lg); font-size: .92rem; border-left: 4px solid var(--accent); transition: opacity .3s, transform .3s; }
.q4e-toast--error { border-left-color: #f87171; }
.q4e-toast--warning { border-left-color: #fbbf24; }
.q4e-toast.is-leaving { opacity: 0; transform: translateY(6px); }
.q4e-dialog { border: 0; border-radius: var(--radius); padding: 1.5rem; max-width: 28rem; width: calc(100vw - 2rem); box-shadow: var(--shadow-lg); }
.q4e-dialog::backdrop { background: rgba(10, 17, 32, .55); }
.q4e-dialog h2 { margin: 0 0 .5rem; font-size: 1.35rem; }
.q4e-dialog p { margin: 0 0 1.25rem; color: var(--muted); }
.q4e-dialog__actions { display: flex; justify-content: flex-end; gap: .5rem; }
.btn--danger-solid { background: var(--bad); border-color: var(--bad); color: #fff; }

/* invoice */
.q4e-invoice { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; max-width: 52rem; }
.q4e-invoice__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.5rem; margin-bottom: 1.5rem; }
.q4e-invoice__brand { display: flex; align-items: center; gap: .5rem; font-family: var(--display); font-size: 1.2rem; margin: 0 0 1rem; }
.q4e-invoice h1 { font-size: 1.8rem; margin: 0 0 .75rem; }
.q4e-invoice dl { margin: 0; display: grid; gap: .2rem; }
.q4e-invoice dl div { display: flex; gap: .75rem; }
.q4e-invoice dt { color: var(--muted); min-width: 8rem; }
.q4e-invoice dd { margin: 0; font-weight: 600; }
.q4e-invoice__seller { text-align: right; font-size: .92rem; line-height: 1.5; }
.q4e-invoice__buyer h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 .3rem; font-family: var(--font); font-weight: 700; }
.q4e-invoice__lines { margin: 1.5rem 0; }
.q4e-invoice__lines tfoot td { font-weight: 600; }
.q4e-invoice__note { font-size: .9rem; padding: .75rem 1rem; border-left: 3px solid var(--text); background: #f8fafc; margin: 0 0 1.25rem; }
.q4e-invoice__total td { font-size: 1.1rem; border-top: 2px solid var(--text); }
@media print {
  .site-head, .site-foot, .q4e-noprint { display: none !important; }
  .site-main { padding: 0; }
  .q4e-invoice { border: 0; padding: 0; }
}

/* ------------------------------------------------------------ help centre (/help) */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.q4e-help-hero { max-width: 760px; margin: 0 auto 2.5rem; text-align: center; }
.q4e-help-hero h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin: 0 0 .5rem; }
.q4e-help-hero p { color: var(--muted); }
.q4e-help-search input { width: 100%; margin-top: 1.25rem; font: inherit; font-size: 1.05rem; padding: .9rem 1.1rem .9rem 2.8rem; border: 1px solid var(--border); border-radius: 999px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235d687c' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") 1rem center / 1.2rem no-repeat; box-shadow: var(--shadow); }
.q4e-help-search input:focus { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
/* Masonry: cards flow down columns, so short sections don't leave gaps beside tall ones */
.q4e-help-sections { columns: 3 300px; column-gap: 1.25rem; }
.q4e-help-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem 1.35rem; break-inside: avoid; display: inline-block; width: 100%; margin: 0 0 1.25rem; }
.q4e-help-section[hidden] { display: none; }
.q4e-help-section h2 { font-size: 1.2rem; margin: 0 0 .25rem; }
.q4e-help-section > p { margin: 0 0 .6rem; font-size: .9rem; }
.q4e-help-section ul { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .15rem; }
.q4e-help-section a { display: block; padding: .55rem .65rem; margin: 0 -.65rem; border-radius: 10px; color: var(--text); text-decoration: none; }
.q4e-help-section a:hover { background: var(--bg); }
.q4e-help-section a b { display: block; font-weight: 600; color: var(--accent-strong); }
.q4e-help-section a span { display: block; font-size: .875rem; color: var(--muted); }
.q4e-help-none { text-align: center; margin: 1rem 0 0; }
.q4e-help { display: grid; gap: 2rem; align-items: start; }
@media (min-width: 900px) { .q4e-help { grid-template-columns: 250px minmax(0, 1fr); gap: 3rem; } .q4e-help__nav { position: sticky; top: 1.5rem; } }
.q4e-help__home { display: inline-block; font-weight: 600; margin-bottom: .75rem; }
.q4e-help__toc summary { cursor: pointer; font-weight: 600; }
@media (min-width: 900px) { .q4e-help__toc summary { display: none; } }
.q4e-help__section { margin: 1rem 0 .3rem; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.q4e-help__nav ul { list-style: none; margin: 0; padding: 0; }
.q4e-help__nav li a { display: block; padding: .3rem .6rem; border-radius: 8px; color: var(--text); text-decoration: none; font-size: .925rem; }
.q4e-help__nav li a:hover { background: var(--surface); }
.q4e-help__nav li a[aria-current] { background: var(--ink); color: #fff; }
.q4e-help__body { max-width: 760px; }
.q4e-help__body img { max-width: 100%; height: auto; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); margin: .5rem 0 1rem; }
.q4e-help__body ol, .q4e-help__body ul { padding-left: 1.3rem; }
.q4e-help__body li { margin: .3rem 0; }
.q4e-help__body table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: .925rem; }
.q4e-help__body th, .q4e-help__body td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.q4e-help__body code { background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: .05rem .35rem; font-size: .9em; }
.q4e-help__body kbd { border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; padding: 0 .3rem; font-size: .85em; }
.q4e-help__plans { display: inline-block; background: var(--accent-soft); border-radius: 999px; padding: .35rem .9rem; font-size: .875rem; margin: 0 0 1rem; }
.q4e-help__pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 2.5rem 0 0; }
.q4e-help__pager a { display: block; border: 1px solid var(--border); border-radius: 12px; padding: .8rem 1rem; text-decoration: none; color: var(--text); font-weight: 600; }
.q4e-help__pager a span { display: block; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.q4e-help__pager a.is-next { text-align: right; }
.q4e-help__pager a:hover { border-color: var(--accent-strong); }
.q4e-help-contact { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin: 2.5rem 0 0; padding: 1rem 1.25rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.q4e-help-contact b { display: block; }
.q4e-help-contact span { color: var(--muted); font-size: .925rem; }
/* GitHub-style callouts (github-markdown-alerts): > [!TIP] / [!NOTE] / [!IMPORTANT] / [!WARNING] */
.q4e-help__body .md-alert { border-left: 4px solid #2563eb; background: #eef6ff; border-radius: 10px; padding: .75rem 1rem; margin: 1rem 0; }
.q4e-help__body .md-alert-body > :last-child { margin-bottom: 0; }
.q4e-help__body .md-alert-title { font-weight: 700; margin: 0 0 .25rem; display: flex; align-items: center; gap: .4rem; }
.q4e-help__body .md-alert-title svg { fill: currentColor; }
.q4e-help__body .md-alert--tip { border-color: var(--accent-strong); background: #f3fbe6; }
.q4e-help__body .md-alert--important { border-color: #7c3aed; background: #f5f0ff; }
.q4e-help__body .md-alert--warning, .q4e-help__body .md-alert--caution { border-color: var(--warn); background: #fff4dc; }
