/* ═══════════════════════════════════════════════════════════════════════════
   TEMISTEC — Ticketing System Styles
   Temistec design system
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── CSS Reset & Variables ─────────────────────────────────────────────── */
:root {
  --accent: #0082fb;
  --accent-dim: rgba(0, 130, 251, 0.12);
  --accent-text: #38bdf8;
  --bg: #031127;
  --surface: #0a1b35;
  --fg: #ffffff;
  --muted: #8898aa;
  --border: #162a45;
  --font-display: 'SF Pro Display', 'Inter', -apple-system, sans-serif;
  --font-body: 'SF Pro Text', 'Inter', -apple-system, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', monospace;
  --max-w: 1200px;
  --gutter: 24px;
  --radius: 12px;
  --radius-sm: 8px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #031127;
    --surface: #0a1b35;
    --fg: #ffffff;
    --muted: #8898aa;
    --border: #162a45;
    --accent: #0082fb;
    --accent-dim: rgba(0, 130, 251, 0.12);
    --accent-text: #38bdf8;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--fg);
  background: var(--bg);
  min-height: 100vh;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4, h5, h6 { font-family: var(--font-display); font-weight: 600; line-height: 1.3; }
h1 { font-size: clamp(28px, 4vw, 40px); }
h2 { font-size: clamp(22px, 3vw, 30px); }
h3 { font-size: clamp(18px, 2.5vw, 22px); }

code, pre { font-family: var(--font-mono); font-size: 0.9em; }

/* ─── Layout ────────────────────────────────────────────────────────────── */
.w { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--gutter); }

main { min-height: calc(100vh - 200px); padding: 40px 0; }

/* ─── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  border: none;
  cursor: pointer;
  min-height: 48px;
  transition: opacity 0.15s, transform 0.1s;
  text-decoration: none;
}
.btn:hover { opacity: 0.9; text-decoration: none; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); color: white; }
.btn-secondary {
  background: var(--surface);
  color: var(--fg);
  border: 1px solid var(--border);
}
.btn-danger { background: #DC2626; color: white; }

/* ─── Forms ─────────────────────────────────────────────────────────────── */
input, select, textarea {
  font-family: var(--font-body);
  font-size: 15px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--fg);
  outline: none;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
}

label { font-size: 14px; font-weight: 500; display: block; margin-bottom: 4px; }

/* ─── Cards ─────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
}
.stat-card .num { font-size: 28px; font-weight: 700; line-height: 1.2; }
.stat-card .lbl { font-size: 12px; color: var(--muted); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.04em; }

/* ─── Tables ────────────────────────────────────────────────────────────── */
.app-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.app-table th {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.app-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.app-table tr:last-child td { border-bottom: none; }

/* ─── Status Badges ─────────────────────────────────────────────────────── */
.status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.status-approved { background: #1a3d2e; color: #6fcf97; }
.status-pending { background: #3d3522; color: #f9e79f; }
.status-rejected { background: #3d1a1a; color: #f1948a; }
.status-revoked { background: #3d1a1a; color: #f1948a; }

/* ─── Error / Success Messages ──────────────────────────────────────────── */
.error-message {
  color: #f1948a;
  font-size: 14px;
  padding: 8px 12px;
  background: #3d1a1a;
  border: 1px solid #7f1d1d;
  border-radius: var(--radius-sm);
}
.success-message {
  color: #6fcf97;
  font-size: 14px;
  padding: 8px 12px;
  background: #1a3d2e;
  border: 1px solid #166534;
  border-radius: var(--radius-sm);
}

/* ─── Navigation ────────────────────────────────────────────────────────── */
header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
header nav { height: 60px; }
header nav .w { display: flex; align-items: center; height: 100%; gap: 24px; }
header nav .logo { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--fg); text-decoration: none; display: flex; align-items: center; }
header nav .logo img { height: 32px; width: auto; object-fit: contain; }
header nav .logo:hover { text-decoration: none; }

.logo-container { display: flex; align-items: center; text-decoration: none; height: 100%; }
.logo-container:hover { text-decoration: none; }
.nav-logo { height: 32px; width: auto; object-fit: contain; }
.hero-logo { max-width: 280px; height: auto; margin: 0 auto 24px; display: block; }

.nav-links { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.nav-links a {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.nav-links a:hover { background: var(--accent-dim); color: var(--fg); text-decoration: none; }
.nav-links a[aria-current="page"] { color: var(--fg); background: var(--accent-dim); }
.nav-links .nav-cta { background: var(--accent); color: white; }
.nav-links .nav-cta:hover { background: var(--accent-text); color: white; }

.nav-toggle { display: none; background: none; border: none; padding: 8px; cursor: pointer; color: var(--fg); margin-left: auto; }
.nav-more { position: relative; display: inline-block; }
.nav-more summary { list-style: none; cursor: pointer; padding: 8px 14px; border-radius: var(--radius-sm); color: var(--muted); font-size: 14px; font-weight: 500; }
.nav-more summary::-webkit-details-marker { display: none; }
.nav-more[open] summary { background: var(--accent-dim); color: var(--fg); }
.nav-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  padding: 8px;
  z-index: 200;
}
.nav-dropdown a { display: block; padding: 8px 12px; white-space: nowrap; }

/* Mobile nav */
@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 16px;
    gap: 4px;
    display: none;
    z-index: 99;
  }
  .nav-links.nav-open { display: flex; }
  .nav-links a { width: 100%; }
  .nav-toggle { display: block; }
  .nav-more { width: 100%; }
  .nav-dropdown {
    position: static;
    box-shadow: none;
    border: none;
    padding-left: 16px;
    background: transparent;
  }
}

/* ─── Bottom Tabs (mobile) ──────────────────────────────────────────────── */
.bottom-tabs {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 100;
  padding: 4px 0 env(safe-area-inset-bottom, 4px) 0;
}
@media (max-width: 768px) {
  body { padding-bottom: 70px; }
  .bottom-tabs { display: block; }
}
.tab-row { display: flex; justify-content: space-around; }
.bottom-tabs a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 8px;
  font-size: 10px;
  color: var(--muted);
  text-decoration: none;
  min-height: 44px;
  justify-content: center;
}
.bottom-tabs a span { display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; }
.bottom-tabs a span svg { width: 22px; height: 22px; }
.bottom-tabs a.active, .bottom-tabs a[aria-current="page"] { color: var(--accent); }

/* ─── Footer ────────────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  font-size: 14px;
  color: var(--muted);
}
footer .w { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
footer a { color: var(--muted); }
footer a:hover { color: var(--fg); }
footer .footer-links { display: flex; gap: 16px; }

/* ─── Grid ──────────────────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ─── Gift / Modal ──────────────────────────────────────────────────────── */
.gift-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
}
.gift-overlay.open { opacity: 1; }
.gift-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 420px;
  width: 90%;
  text-align: center;
  position: relative;
  transform: scale(0.95);
  transition: transform 0.3s;
}
.gift-overlay.open .gift-box { transform: scale(1); }
.gift-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 13px;
  padding: 4px 14px;
  cursor: pointer;
  color: var(--muted);
  min-height: 36px;
}
.gift-icon { font-size: 48px; line-height: 1; margin-bottom: 12px; }
.gift-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 100px;
  background: var(--accent-dim);
  color: var(--accent-text);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}
.gift-box h2 { margin-bottom: 8px; }
.gift-box p { font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.gift-items { text-align: left; margin: 16px 0; }
.gift-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  font-size: 14px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.gift-item.revealed { opacity: 1; transform: translateY(0); }
.gift-item .check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 100px;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.gift-confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.gift-confetti span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  animation: confetti-fall 1s ease-out forwards;
}
@keyframes confetti-fall {
  0% { transform: translate(-50%, -50%) rotate(0deg); opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(var(--r)); opacity: 0; }
}

/* ─── Ticket Cards (Shop) ───────────────────────────────────────────────── */
.ticket-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  transition: border-color 0.2s;
}
.ticket-card:hover { border-color: var(--accent); }
.ticket-card.has-icon { padding-left: 16px; }
.ticket-card-icon { width: 44px; height: 44px; flex-shrink: 0; }
.ticket-card-icon svg { width: 100%; height: 100%; stroke: var(--accent-text); }
.ticket-card-info { flex: 1; }
.ticket-card-info h3 { font-size: 17px; margin-bottom: 4px; }
.ticket-card-info .desc { font-size: 13px; color: var(--muted); }
.ticket-card-price {
  font-size: 20px;
  font-weight: 700;
  white-space: nowrap;
  font-family: var(--font-display);
}
.ticket-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.qty-btn {
  width: 36px;
  height: 36px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg);
  min-height: 36px;
}
.qty-btn:active { background: var(--accent-dim); }
.qty-val { min-width: 20px; text-align: center; font-weight: 600; font-size: 16px; }

/* ─── Cart ──────────────────────────────────────────────────────────────── */
.cart-summary { margin-top: 24px; }
.cart-empty { text-align: center; padding: 40px 20px; color: var(--muted); font-size: 15px; }
.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.cart-item-name { flex: 1; }
.cart-item-qty { color: var(--muted); }
.cart-item-cost { font-weight: 600; white-space: nowrap; }

.cart-total { display: none; margin-top: 16px; }
.cart-total-amount { font-size: 24px; font-weight: 700; }

/* ─── Section Tabs ──────────────────────────────────────────────────────── */
.section-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 4px;
}
.section-tab {
  flex: 1;
  padding: 10px 16px;
  text-align: center;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  color: var(--muted);
  border: none;
  background: none;
  font-family: var(--font-body);
  transition: background 0.15s, color 0.15s;
  min-height: 44px;
}
.section-tab.active {
  background: var(--bg);
  color: var(--fg);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.section-tab:hover { color: var(--fg); }

/* ─── Dashboard ─────────────────────────────────────────────────────────── */
.ticket-dashboard-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
}
.ticket-db-info { flex: 1; }
.ticket-db-info h3 { font-size: 16px; margin-bottom: 2px; }
.ticket-db-info .code { font-size: 13px; color: var(--muted); font-family: var(--font-mono); }
.ticket-db-info .meta { font-size: 12px; color: var(--muted); margin-top: 4px; }
.ticket-db-balance { text-align: center; padding: 0 12px; }
.ticket-db-balance .amt { font-size: 20px; font-weight: 700; }
.ticket-db-balance .lbl { font-size: 10px; color: var(--muted); text-transform: uppercase; }
.ticket-db-actions { display: flex; gap: 6px; flex-shrink: 0; }
.ticket-db-actions .btn { padding: 8px 14px; min-height: 36px; font-size: 13px; }

/* ─── Scanner Page ──────────────────────────────────────────────────────── */
.scanner-passcode { max-width: 400px; margin: 60px auto; text-align: center; }
.scanner-passcode input { font-size: 28px; letter-spacing: 0.3em; text-align: center; font-family: var(--font-mono); }
.scanner-modes { display: none; }
.scanner-modes.active { display: block; }
.scanner-view { display: none; }
.scanner-view.active { display: block; }
.mode-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; max-width: 600px; margin: 0 auto; }
.mode-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.2s;
  font-family: var(--font-body);
  min-height: 100px;
}
.mode-btn:hover { border-color: var(--accent); }
.mode-btn svg { width: 40px; height: 40px; stroke: var(--accent); }
.mode-btn .label { font-size: 15px; font-weight: 600; }
.mode-btn .sub { font-size: 12px; color: var(--muted); }

#camera-zone { position: relative; width: 100%; max-width: 400px; height: 300px; margin: 0 auto; background: #000; border-radius: 16px; overflow: hidden; }
#camera-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: white; gap: 8px; }
#camera-placeholder .cam-icon { opacity: 0.5; }

.scanner-ticket-card {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
}
.scanner-ticket-card .row { display: flex; align-items: center; gap: 16px; }
.scanner-ticket-card .info { flex: 1; }
.scanner-ticket-card .info h3 { font-size: 17px; margin-bottom: 2px; }
.scanner-ticket-card .info .code { font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
.scanner-ticket-card .info .meta { font-size: 12px; color: var(--muted); margin-top: 4px; }
.scanner-ticket-card .balance { text-align: center; }
.scanner-ticket-card .balance .amt { font-size: 22px; font-weight: 700; }

.status-badge.active { background: #d4edda; color: #155724; }
.status-badge.used { background: #fff3cd; color: #856404; }
.status-badge.exhausted { background: #f8d7da; color: #721c24; }
.status-badge.revoked { background: #f8d7da; color: #721c24; }

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  border: none;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  min-height: 44px;
  transition: opacity 0.15s;
}
.action-btn:hover { opacity: 0.9; }
.action-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.action-btn.success { background: #065F46; color: white; }
.action-btn.danger { background: #DC2626; color: white; }
.action-btn.warning { background: #92400E; color: white; }
.action-approve { background: #065F46; color: white; }
.action-reject { background: #991B1B; color: white; }

.scanner-result { display: none; padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 12px; }
.scanner-result.success { display: block; background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.scanner-result.error { display: block; background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.scanner-result.info { display: block; background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

@media (prefers-color-scheme: dark) {
  .scanner-result.success { background: #1a3d2e; color: #6fcf97; border-color: #166534; }
  .scanner-result.error { background: #3d1a1a; color: #f1948a; border-color: #7f1d1d; }
  .scanner-result.info { background: #1a2a3d; color: #7fcdff; border-color: #1e3a5f; }
  .status-badge.active { background: #1a3d2e; color: #6fcf97; }
  .status-badge.used { background: #3d3522; color: #f9e79f; }
  .status-badge.exhausted { background: #3d1a1a; color: #f1948a; }
  .status-badge.revoked { background: #3d1a1a; color: #f1948a; }
}

.input-large {
  font-size: 32px !important;
  font-weight: 700 !important;
  text-align: center !important;
  padding: 16px !important;
  font-family: var(--font-mono) !important;
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 12px 0;
}
.preset-btn {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
  color: var(--fg);
  min-height: 48px;
  transition: border-color 0.15s, background 0.15s;
}
.preset-btn:hover { border-color: var(--accent); background: var(--accent-dim); }
.preset-btn.selected { border-color: var(--accent); background: var(--accent-dim); }

.debit-form { display: none; }
.debit-form.active { display: block; }
.amount-display { text-align: center; font-size: 15px; margin-bottom: 12px; }

.bundle-btn {
  flex: 1;
  padding: 14px 8px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-align: center;
  cursor: pointer;
  font-family: var(--font-body);
  min-height: 60px;
  transition: border-color 0.15s;
}
.bundle-btn.selected { border-color: var(--accent); background: var(--accent-dim); }
.bundle-btn .amt { font-size: 18px; font-weight: 700; }
.bundle-btn .lbl-adj { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 2px; }

/* ─── Top-Up Page ───────────────────────────────────────────────────────── */
.topup-landing { max-width: 480px; margin: 0 auto; text-align: center; }
.topup-landing h1 { margin-bottom: 8px; }
.topup-landing p { color: var(--muted); margin-bottom: 24px; }

.topup-form-container { display: none; }
.topup-form-container.active { display: block; }

.topup-ticket-card {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
}
.topup-ticket-card h3 { font-size: 16px; margin-bottom: 2px; }
.topup-ticket-card .code { font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
.topup-ticket-card .meta { font-size: 12px; color: var(--muted); margin-top: 4px; }
.topup-ticket-card .balance-row { display: flex; gap: 24px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.topup-ticket-card .balance-item { }
.topup-ticket-card .balance-item .lbl { font-size: 11px; text-transform: uppercase; color: var(--muted); letter-spacing: 0.04em; }
.topup-ticket-card .balance-item .amt { font-size: 22px; font-weight: 700; }

.bundles-row { display: flex; gap: 8px; margin: 16px 0; }

.payment-methods { display: none; gap: 8px; margin: 16px 0; }
.payment-methods.active { display: flex; }
.payment-method {
  flex: 1;
  padding: 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s;
  font-family: var(--font-body);
  color: var(--fg);
}
.payment-method:hover { border-color: var(--accent); }
.payment-method.selected { border-color: var(--accent); background: var(--accent-dim); }
.payment-method .icon { font-size: 28px; margin-bottom: 4px; }
.payment-method .lbl { font-size: 13px; font-weight: 600; }

/* ─── Claim Ticket ──────────────────────────────────────────────────────── */
.claim-container { max-width: 520px; margin: 0 auto; }
.claim-card { padding: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 16px; }
.claim-card h3 { font-size: 16px; margin-bottom: 2px; }
.claim-card .code { font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
.claim-card .meta { font-size: 12px; color: var(--muted); margin-top: 4px; }
.claim-status {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.claim-status.status-pending { background: #fff3cd; color: #856404; }
.claim-status.status-completed { background: #d4edda; color: #155724; }
.claim-status.status-claimed { background: #d4edda; color: #155724; }
.claim-status.status-expired { background: #f8d7da; color: #721c24; }
.claim-status.status-cancelled { background: #f8d7da; color: #721c24; }

/* ─── Transfer Modal ────────────────────────────────────────────────────── */
.transfer-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.3);
  align-items: center;
  justify-content: center;
}
.transfer-modal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 420px;
  width: 90%;
  position: relative;
}

/* ─── 404 Page ──────────────────────────────────────────────────────────── */
.error-page { display: flex; align-items: center; justify-content: center; min-height: 80vh; text-align: center; flex-direction: column; padding: 40px 24px; }
.error-page .code { font-family: var(--font-display); font-size: clamp(80px, 12vw, 140px); font-weight: 700; line-height: 1; color: var(--accent); margin-bottom: 8px; }
.error-page h1 { margin-bottom: 12px; }
.error-page p { color: var(--muted); margin-bottom: 32px; max-width: 420px; }

/* ─── Loading / Spinner ─────────────────────────────────────────────────── */
.scanner-loading { display: flex; align-items: center; justify-content: center; padding: 40px; }
.spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ─── Bill Mode ─────────────────────────────────────────────────────────── */
.bill-receipt { background: var(--surface); border: 2px solid var(--accent); border-radius: 12px; padding: 20px; margin-bottom: 12px; text-align: center; }
.bill-log-item { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 6px; margin-bottom: 4px; background: var(--bg); }
.bill-log-item.latest { border: 1px solid var(--accent); }
.bill-log-item .code { font-family: var(--font-mono); font-size: 12px; font-weight: 600; }
.bill-log-item .detail { font-size: 12px; color: var(--muted); }
.bill-log-undo-btn { background: none; border: none; cursor: pointer; color: var(--muted); padding: 4px; min-height: 30px; }
.bill-log-undo-btn:hover { color: var(--fg); }
.bill-log-summary { display: flex; gap: 16px; align-items: center; padding: 8px 12px; background: var(--accent-dim); border-radius: 8px; margin-bottom: 12px; font-size: 13px; }
.bill-log-total-amount { margin-left: auto; font-weight: 700; font-size: 16px; }

/* ─── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .ticket-card { flex-wrap: wrap; }
  .ticket-card-price { width: 100%; }
  .ticket-dashboard-card { flex-wrap: wrap; }
  .ticket-db-actions { width: 100%; justify-content: flex-end; }
  .bundles-row { flex-wrap: wrap; }
  .preset-grid { grid-template-columns: repeat(2, 1fr); }
  .mode-grid { grid-template-columns: repeat(2, 1fr); }
  .payment-methods { flex-direction: column; }
}

/* ─── Print Styles ──────────────────────────────────────────────────────── */
@media print {
  header, footer, .bottom-tabs, .nav-toggle, .btn, button { display: none !important; }
  body { background: white; color: black; }
  .bill-receipt { border-color: #000 !important; }
  #bill-receipt-print-content { display: block !important; }
}
