/* ============================================================
   Gutscheine — design-parity stylesheet (2026-07-25)
   Extends the existing lp-* design system (redesign.css).
   Uses existing: lp-btn, lp-card/lp-card-pad, kpi/kpi-grid,
     tbl/tbl-head/tbl-row, lp-status/lp-dot, tgl, callout,
     mgrid, mlabel, mhelp, flex, gap8/gap12, modal shell.
   Adds: vc- scoped row-icon, stat wrapper, per-code table
     column grid, status dots, radio cards, badge-pill, toggle
     row, scope picker boxes, modal sizing.
   ============================================================ */

/* ── Section-scoped layout ──────────────────────────────── */
#section-vouchers .lp-topbar { position: sticky; top: 0; z-index: 20; }

/* ── KPI stat cards (reuses .kpi-grid + .kpi + .kpi-label + .kpi-val) ── */
/* No new rules needed — kpi-grid, kpi-label, kpi-val exist in redesign.css */

/* ── Per-code table ──────────────────────────────────────── */
#section-vouchers .vc-tbl-head,
#section-vouchers .vc-tbl-row {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr 0.8fr 1.1fr 0.9fr 150px;
  align-items: center;
}

#section-vouchers .vc-tbl-head {
  padding: 0 0 12px;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink-3);
  border-bottom: 1px solid var(--line);
}

#section-vouchers .vc-tbl-row {
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background .12s;
}
#section-vouchers .vc-tbl-row:hover { background: var(--hover); }
#section-vouchers .vc-tbl-row:last-child { border-bottom: 0; }

/* gift icon tile */
#section-vouchers .vc-row-ic {
  width: 36px;
  height: 36px;
  border-radius: var(--r-pill);
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--ink-2);
}
.dir-raster #section-vouchers .vc-row-ic { border-radius: var(--r-chip); }

/* code cell */
#section-vouchers .vc-code-span {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  font-weight: 700;
  display: block;
  letter-spacing: .02em;
}

/* muted secondary text */
#section-vouchers .vc-muted { color: var(--ink-3); }

/* right-aligned amount */
#section-vouchers .vc-amt {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  font-weight: 700;
  letter-spacing: -.01em;
  white-space: nowrap;
}

/* small Abo chip / badge-pill */
#section-vouchers .vc-abo-chip {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  margin-left: 6px;
  vertical-align: middle;
  text-transform: none;
  letter-spacing: 0;
}

/* status dot — mirrors redesign.css .lp-status but scoped here */
#section-vouchers .vc-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: var(--fs-sm);
  font-weight: 600;
  white-space: nowrap;
  color: var(--ink-3);
}
#section-vouchers .vc-status .vc-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: 0 0 7px;
  background: var(--ink-3);
}
#section-vouchers .vc-status.ok  { color: var(--success); }
#section-vouchers .vc-status.ok  .vc-dot { background: var(--success); }
#section-vouchers .vc-status.bad { color: var(--danger); }
#section-vouchers .vc-status.bad .vc-dot { background: var(--danger); }

/* gilt-für cell */
#section-vouchers .vc-scope-cell {
  font-size: var(--fs-sm);
  font-weight: 600;
}

/* ── "⋯" action menu on each row ─────────────────────────── */
#section-vouchers .vc-row-actions {
  position: relative;
  display: inline-block;
}
#section-vouchers .vc-row-menu-btn {
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  width: 30px;
  height: 30px;
  border-radius: var(--r-ctl);
  display: grid;
  place-items: center;
  font-size: 18px;
  color: var(--ink-3);
  line-height: 1;
  font-family: inherit;
}
#section-vouchers .vc-row-menu-btn:hover {
  background: var(--hover);
  color: var(--ink);
}
#section-vouchers .vc-row-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: var(--r-ctl);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  min-width: 160px;
  padding: 4px;
}
#section-vouchers .vc-row-menu.open { display: block; }
#section-vouchers .vc-row-menu button {
  display: block;
  width: 100%;
  text-align: left;
  appearance: none;
  border: 0;
  background: transparent;
  padding: 8px 12px;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  border-radius: calc(var(--r-ctl) - 2px);
  font-family: inherit;
}
#section-vouchers .vc-row-menu button:hover { background: var(--hover); }
#section-vouchers .vc-row-menu button.danger { color: var(--danger); }

/* ── Create modal — new lp-modal-xl shell ───────────────── */
#vc-create-modal .lp-modal {
  max-width: 940px;
}

/* ── Art radio cards (Einzelcodes / Aktionscode) ─────────── */
.vc-radio-cards {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.vc-radio-card {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 11px 13px;
  border: 1px solid var(--line-2);
  background: var(--field);
  border-radius: var(--r-ctl);
  cursor: pointer;
  flex: 1 1 0%;
  min-width: 180px;
  transition: border-color .14s, background .14s;
}
.vc-radio-card.sel {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}
.vc-radio-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--line-2);
  display: grid;
  place-items: center;
  flex: 0 0 16px;
  margin-top: 1px;
}
.vc-radio-card.sel .vc-radio-dot { border-color: var(--accent); }
.vc-radio-dot-inner {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  display: none;
}
.vc-radio-card.sel .vc-radio-dot-inner { display: block; }
.vc-radio-label {
  font-weight: 700;
  font-size: 13px;
}
.vc-radio-sub {
  color: var(--ink-3);
  display: block;
  font-size: 11px;
  font-weight: 500;
  margin-top: 2px;
}

/* ── Gilt-für radio cards (same style) ───────────────────── */
/* reuses .vc-radio-card / .vc-radio-card.sel */

/* ── Scope pickers — bordered box ───────────────────────── */
.vc-scope-picker-box {
  border: 1px solid var(--line-2);
  border-radius: var(--r-chip);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--field);
}
.vc-scope-picker-box p {
  font-size: var(--fs-sm);
  font-weight: 600;
  margin: 0 0 4px;
  color: var(--ink);
}
.vc-scope-picker-scroll {
  max-height: 160px;
  overflow-y: auto;
}

/* ── Abo-Option toggle row — reuses .credit-auto from redesign.css ── */
/* credit-auto already defined in redesign.css — no extra rules needed */

/* ── Empty state ─────────────────────────────────────────── */
#section-vouchers .vc-empty {
  padding: 40px 0;
  text-align: center;
  color: var(--ink-3);
  font-size: var(--fs-sm);
  font-weight: 500;
}

/* ── Loading / error text ────────────────────────────────── */
#section-vouchers .vc-loading,
#section-vouchers .vc-error {
  font-size: var(--fs-sm);
  padding: 16px 0;
}
#section-vouchers .vc-loading { color: var(--ink-3); }
#section-vouchers .vc-error   { color: var(--danger); }

/* ── Redemptions + codes modal (reuse lp-modal panel) ── */
#vc-redemptions-modal .lp-modal,
#vc-codes-modal .lp-modal {
  max-width: 640px;
}
#vc-codes-modal .lp-modal { max-width: 520px; }

/* ── Scope pickers side-by-side (design: three columns) ───── */
#vc-scope-pickers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 860px) {
  #vc-scope-pickers { grid-template-columns: 1fr; }
}

/* ── Squared selection boxes — mirrors the site's .chk ────── */
.vc-scope-picker-scroll input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  margin: 0;
  border: 2px solid var(--line-2);
  border-radius: var(--r-chip);
  background: var(--card);
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  transition: background .12s, border-color .12s;
}
.vc-scope-picker-scroll input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3.5 8.5l3 3 6-6.5' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 13px 13px;
  background-position: center;
  background-repeat: no-repeat;
}
