/* ═══════════════════════════════════════════════════════════════════
   ShukWAY · Coupons Section + Redemption Page Styles
   All values via tokens — no hardcoded colors, radius, or fonts.
   ═══════════════════════════════════════════════════════════════════ */

/* ─── Dashboard: Coupon form ─── */
.coupon-form-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  margin-bottom: var(--sp-6);
}

.coupon-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
}

@media (max-width: 640px) {
  .coupon-form-grid { grid-template-columns: 1fr; }
}

.coupon-form-field {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.coupon-form-field label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--ink-soft);
}

.coupon-form-field input,
.coupon-form-field select {
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  padding: var(--sp-2) var(--sp-3);
  font-family: var(--font);
  font-size: var(--text-sm);
  background: var(--cream);
  color: var(--ink);
  direction: rtl;
}

.coupon-form-field input:focus,
.coupon-form-field select:focus {
  outline: 2px solid var(--teal);
  outline-offset: 1px;
}

.coupon-form-full {
  grid-column: 1 / -1;
}

/* ─── Dashboard: Coupon list table ─── */
.coupon-table-wrap {
  overflow-x: auto;
}

.coupon-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.coupon-table th {
  text-align: right;
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 2px solid var(--border-strong);
  font-weight: 600;
  color: var(--ink-soft);
  white-space: nowrap;
}

.coupon-table td {
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.coupon-table tr:hover td {
  background: var(--cream-warm);
}

.coupon-badge-active {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  font-size: var(--text-xs);
  font-weight: 600;
  background: var(--teal-soft);
  color: var(--teal);
}

.coupon-badge-inactive {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  font-size: var(--text-xs);
  font-weight: 600;
  background: var(--cream-deep);
  color: var(--ink-soft);
}

.coupon-progress-bar {
  width: 80px;
  height: 6px;
  background: var(--cream-deep);
  border-radius: var(--r-pill);
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
  margin-inline-start: var(--sp-2);
}

.coupon-progress-fill {
  height: 100%;
  border-radius: var(--r-pill);
  background: var(--teal);
  transition: width 0.3s ease;
}

.coupon-progress-fill.danger {
  background: var(--danger);
}

/* ─── QR modal ─── */
.qr-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  padding: var(--sp-4);
}

.qr-modal {
  background: var(--paper);
  border-radius: var(--r-xl);
  padding: var(--sp-8);
  max-width: 360px;
  width: 100%;
  text-align: center;
  box-shadow: var(--sh-xl);
}

.qr-modal canvas {
  border-radius: var(--r-md);
  border: 4px solid var(--cream-warm);
}

.qr-modal-actions {
  display: flex;
  gap: var(--sp-3);
  justify-content: center;
  margin-top: var(--sp-4);
}

/* ─── Redemption page (consumer PWA) ─── */
.redeem-body {
  min-height: 100dvh;
  background: var(--cream);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-6) var(--sp-4);
  font-family: var(--font);
  direction: rtl;
}

.redeem-card {
  background: var(--paper);
  border-radius: var(--r-xl);
  padding: var(--sp-8) var(--sp-6);
  max-width: 360px;
  width: 100%;
  box-shadow: var(--sh-lg);
  text-align: center;
}

.redeem-logo {
  height: 36px;
  margin-bottom: var(--sp-6);
}

.redeem-business {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--teal);
  margin-bottom: var(--sp-1);
}

.redeem-divider {
  width: 48px;
  height: 3px;
  background: var(--orange);
  border-radius: var(--r-pill);
  margin: var(--sp-3) auto;
}

.redeem-coupon-desc {
  font-size: var(--text-xl);
  font-weight: 900;
  color: var(--ink);
  margin-bottom: var(--sp-1);
}

.redeem-coupon-amount {
  font-size: var(--text-3xl);
  font-weight: 900;
  color: var(--orange);
  line-height: 1;
  margin-bottom: var(--sp-2);
}

.redeem-validity {
  font-size: var(--text-xs);
  color: var(--muted);
  margin-bottom: var(--sp-6);
}

.redeem-btn {
  width: 100%;
  padding: var(--sp-4);
  background: var(--teal);
  color: var(--white);
  border: none;
  border-radius: var(--r-md);
  font-size: var(--text-base);
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: background var(--tx-fast);
}

.redeem-btn:active { background: var(--teal-deep); }

.redeem-btn:disabled {
  background: var(--cream-deep);
  color: var(--muted);
  cursor: default;
}

.redeem-status {
  margin-top: var(--sp-5);
  padding: var(--sp-4);
  border-radius: var(--r-md);
  font-weight: 600;
  font-size: var(--text-sm);
}

.redeem-status.success {
  background: var(--teal-soft);
  color: var(--teal);
}

.redeem-status.error {
  background: var(--danger-bg);
  color: var(--danger);
}

.redeem-status.offline {
  background: var(--warning-bg);
  color: var(--orange);
}

.redeem-offline-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  font-size: var(--text-xs);
  background: var(--warning-bg);
  color: var(--warning);
  border-radius: var(--r-pill);
  padding: var(--sp-1) var(--sp-3);
  margin-bottom: var(--sp-4);
  font-weight: 500;
}

.redeem-footer {
  margin-top: var(--sp-6);
  font-size: var(--text-xs);
  color: var(--subtle);
}
