/* ============================================================
   Outdoor Play Arena — Ticketing & Wallet Demo
   Shared design system
   ============================================================ */

:root {
  --teal: #29b7c6;
  --teal-dark: #1e97a4;
  --teal-deep: #0e4a54;
  --green: #7dc242;
  --green-dark: #649c34;
  --yellow: #f5c518;
  --red: #e74c3c;
  --red-soft: #fdecea;
  --ink: #12333b;
  --muted: #5b7a83;
  --bg: #eef6f7;
  --card: #ffffff;
  --line: #dcebee;
  --radius: 16px;
  --shadow: 0 6px 24px rgba(14, 74, 84, 0.08);
  --shadow-lift: 0 12px 32px rgba(14, 74, 84, 0.14);
  --font-display: "Baloo 2", "Nunito", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, sans-serif;
}

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

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.5;
}

h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; }

button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; }

/* ---------- Header / nav ---------- */

.site-header {
  background: linear-gradient(120deg, var(--teal-deep) 0%, #14606d 60%, #17707f 100%);
  color: #fff;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }

.brand-mark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 34px;
  letter-spacing: -2px;
  line-height: 1;
}
.brand-mark .o1 { color: var(--teal); }
.brand-mark .p1 { color: #fff; }
.brand-mark .a1 { color: var(--green); }

.brand-text { display: flex; flex-direction: column; }
.brand-text .brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
}
.brand-text .brand-tag { font-size: 11px; opacity: 0.65; letter-spacing: 0.5px; }

.main-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.main-nav a {
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  padding: 8px 14px;
  border-radius: 999px;
  transition: background 0.15s, color 0.15s;
}
.main-nav a:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.main-nav a.active { background: var(--green); color: #fff; }

/* ---------- Layout ---------- */

.page { max-width: 1100px; margin: 0 auto; padding: 28px 20px 64px; }
.page-narrow { max-width: 860px; }

.page-title { font-size: 30px; font-weight: 800; }
.page-sub { color: var(--muted); margin: 2px 0 22px; font-size: 15px; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 820px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 12px;
  font-weight: 800;
  font-size: 15px;
  padding: 12px 22px;
  transition: transform 0.1s, box-shadow 0.15s, background 0.15s;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-dark); }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: var(--green-dark); }
.btn-ghost { background: transparent; color: var(--teal-dark); border: 2px solid var(--teal); }
.btn-ghost:hover { background: rgba(41, 183, 198, 0.08); }
.btn-danger { background: var(--red); color: #fff; }
.btn-lg { font-size: 17px; padding: 15px 28px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: 13px; border-radius: 9px; }

/* ---------- Forms ---------- */

.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 800; font-size: 13px; margin-bottom: 6px; color: var(--teal-deep); letter-spacing: 0.3px; }
.field input, .field select {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 12px;
  font-size: 16px;
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s;
}
.field input:focus, .field select:focus { border-color: var(--teal); }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.amount-chips { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.chip {
  border: 2px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  font-size: 15px;
  padding: 10px 18px;
  border-radius: 999px;
  transition: all 0.12s;
}
.chip:hover { border-color: var(--teal); }
.chip.selected { background: var(--teal); border-color: var(--teal); color: #fff; }

/* ---------- Tabs ---------- */

.tabs { display: flex; gap: 8px; margin-bottom: 22px; background: #dfeef0; padding: 6px; border-radius: 14px; width: fit-content; }
.tab-btn {
  border: none;
  background: transparent;
  font-weight: 800;
  font-size: 15px;
  color: var(--muted);
  padding: 10px 22px;
  border-radius: 10px;
  transition: all 0.15s;
}
.tab-btn.active { background: #fff; color: var(--teal-deep); box-shadow: 0 2px 8px rgba(14, 74, 84, 0.12); }

/* ---------- Home / role cards ---------- */

.hero { text-align: center; padding: 44px 20px 26px; }
.hero .brand-mark { font-size: 76px; }
.hero h1 { font-size: 34px; margin-top: 8px; letter-spacing: 3px; text-transform: uppercase; color: var(--teal-deep); }
.hero p { color: var(--muted); font-size: 17px; margin-top: 6px; }

.role-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 30px; }
@media (max-width: 820px) { .role-grid { grid-template-columns: 1fr; } }

.role-card {
  background: var(--card);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 34px 26px;
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.15s, box-shadow 0.15s;
  border-top: 6px solid var(--teal);
}
.role-card:nth-child(2) { border-top-color: var(--green); }
.role-card:nth-child(3) { border-top-color: var(--yellow); }
.role-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lift); }
.role-card .role-icon { font-size: 52px; line-height: 1; }
.role-card h3 { font-size: 22px; margin: 14px 0 6px; }
.role-card p { color: var(--muted); font-size: 14px; }

/* ---------- Ticket card ---------- */

.ticket-card {
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-lift);
  max-width: 360px;
  margin: 0 auto;
}
.ticket-head {
  background: linear-gradient(120deg, var(--teal) 0%, var(--green) 100%);
  color: #fff;
  text-align: center;
  padding: 18px 16px 14px;
}
.ticket-head .brand-mark { font-size: 40px; }
.ticket-head .ticket-park { font-size: 12px; letter-spacing: 3px; font-weight: 800; opacity: 0.95; }
.ticket-body { padding: 20px 24px; text-align: center; }
.ticket-qr { display: flex; justify-content: center; margin: 6px 0 12px; }
.ticket-qr img, .ticket-qr canvas { border-radius: 8px; }
.ticket-id { font-family: var(--font-display); font-weight: 800; font-size: 24px; letter-spacing: 2px; color: var(--teal-deep); }
.ticket-holder { font-size: 16px; font-weight: 700; margin-top: 2px; }
.ticket-meta { color: var(--muted); font-size: 13px; margin-top: 2px; }
.ticket-balance {
  margin-top: 14px;
  background: #f0f9e8;
  border: 2px dashed var(--green);
  border-radius: 12px;
  padding: 10px;
}
.ticket-balance .tb-label { font-size: 12px; font-weight: 800; color: var(--green-dark); letter-spacing: 1px; }
.ticket-balance .tb-amount { font-family: var(--font-display); font-size: 28px; font-weight: 800; color: var(--green-dark); }
.ticket-foot {
  border-top: 2px dashed var(--line);
  text-align: center;
  padding: 10px;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.5px;
}

/* ---------- Scanner ---------- */

.scan-box {
  border: 3px dashed var(--teal);
  border-radius: var(--radius);
  background: #f2fbfc;
  padding: 18px;
  text-align: center;
}
.scan-box.scanning { padding: 10px; }
#qr-reader, .qr-reader { width: 100%; max-width: 380px; margin: 0 auto; border-radius: 12px; overflow: hidden; }
#qr-reader video, .qr-reader video { border-radius: 12px; }
.scan-hint { color: var(--muted); font-size: 14px; margin: 10px 0 14px; }
.scan-icon { font-size: 44px; }

.manual-entry { display: flex; gap: 10px; margin-top: 14px; }
.manual-entry input {
  flex: 1;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 12px;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
  outline: none;
}
.manual-entry input:focus { border-color: var(--teal); }

.divider-or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: 2px; margin-top: 16px; }
.divider-or::before, .divider-or::after { content: ""; flex: 1; height: 2px; background: var(--line); }

/* ---------- Customer panel ---------- */

.customer-panel {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(120deg, #eafcf1 0%, #eaf8fb 100%);
  border: 2px solid #bfe8d3;
  border-radius: var(--radius);
  padding: 16px 18px;
  animation: slideIn 0.25s ease;
}
.avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  flex-shrink: 0;
}
.customer-panel .c-name { font-weight: 800; font-size: 17px; }
.customer-panel .c-meta { color: var(--muted); font-size: 13px; }
.customer-panel .c-balance { margin-left: auto; text-align: right; }
.customer-panel .c-balance .b-label { font-size: 11px; font-weight: 800; letter-spacing: 1px; color: var(--muted); }
.customer-panel .c-balance .b-amount { font-family: var(--font-display); font-size: 26px; font-weight: 800; color: var(--green-dark); }
.customer-panel .c-balance .b-amount.low { color: var(--red); }

@keyframes slideIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Pricing toggle ---------- */

.price-toggle { display: inline-flex; background: #dfeef0; border-radius: 999px; padding: 4px; gap: 4px; }
.price-toggle button {
  border: none; background: transparent;
  font-weight: 800; font-size: 13px;
  padding: 8px 18px; border-radius: 999px;
  color: var(--muted);
  transition: all 0.15s;
}
.price-toggle button.active { background: var(--teal-deep); color: #fff; }

/* ---------- Activity grid ---------- */

.activity-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-top: 18px; }
.activity-tile {
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 16px 14px;
  text-align: left;
  transition: all 0.13s;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.activity-tile:hover { border-color: var(--teal); transform: translateY(-2px); box-shadow: var(--shadow); }
.activity-tile:disabled { opacity: 0.45; transform: none; box-shadow: none; }
.activity-tile .a-icon { font-size: 26px; }
.activity-tile .a-name { font-weight: 800; font-size: 14.5px; line-height: 1.25; }
.activity-tile .a-remark { color: var(--muted); font-size: 12px; }
.activity-tile .a-price { font-family: var(--font-display); font-weight: 800; font-size: 20px; color: var(--teal-dark); margin-top: 4px; }

.cat-label { font-size: 12px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin: 20px 0 -6px; }

/* ---------- Modal / confirm sheet ---------- */

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(10, 40, 47, 0.55);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  z-index: 50;
  animation: fadeIn 0.15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #fff;
  border-radius: 20px;
  padding: 28px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lift);
  animation: popIn 0.2s ease;
}
@keyframes popIn { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: none; } }
.modal .m-icon { font-size: 52px; }
.modal h3 { font-size: 22px; margin: 10px 0 4px; }
.modal .m-detail { color: var(--muted); font-size: 15px; margin-bottom: 6px; }
.modal .m-price { font-family: var(--font-display); font-size: 40px; font-weight: 800; color: var(--teal-dark); margin: 8px 0; }
.modal .m-actions { display: flex; gap: 12px; margin-top: 18px; }
.modal .m-actions .btn { flex: 1; }

.modal.success .m-price { color: var(--green-dark); }
.modal.error { border-top: 6px solid var(--red); }

.balance-pill {
  display: inline-block;
  background: #f0f9e8;
  color: var(--green-dark);
  font-weight: 800;
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 14px;
  margin-top: 6px;
}
.balance-pill.low { background: var(--red-soft); color: var(--red); }

/* ---------- Success banner / toast ---------- */

.toast {
  position: fixed;
  bottom: 26px; left: 50%;
  transform: translateX(-50%);
  background: var(--teal-deep);
  color: #fff;
  font-weight: 700;
  padding: 13px 24px;
  border-radius: 999px;
  box-shadow: var(--shadow-lift);
  z-index: 60;
  animation: slideIn 0.2s ease;
}

/* ---------- Admin ---------- */

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
@media (max-width: 900px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }

.stat-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; border-left: 5px solid var(--teal); }
.stat-card-btn { appearance: none; -webkit-appearance: none; font: inherit; border-top: none; border-right: none; border-bottom: none; outline: none; }
.stat-card-btn:focus,
.stat-card-btn:focus-visible { outline: none; box-shadow: var(--shadow); }
.stat-card.stat-teal { border-left-color: var(--teal); }
.stat-card.stat-green { border-left-color: var(--green); }
.stat-card.stat-yellow { border-left-color: var(--yellow); }
.stat-card.stat-purple { border-left-color: #9b59b6; }
.stat-card:nth-child(2) { border-left-color: var(--green); }
.stat-card:nth-child(3) { border-left-color: var(--yellow); }
.stat-card:nth-child(4) { border-left-color: #9b59b6; }
.stat-card .s-label { font-size: 12px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.stat-card .s-value { font-family: var(--font-display); font-size: 30px; font-weight: 800; margin-top: 2px; }
.stat-card .s-sub { font-size: 12px; color: var(--muted); }

.section-title { font-size: 19px; font-weight: 800; margin-bottom: 14px; }

.bar-row { display: grid; grid-template-columns: 170px 1fr 76px; align-items: center; gap: 12px; margin-bottom: 10px; font-size: 14px; }
.bar-row .b-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { background: #e8f2f4; border-radius: 999px; height: 18px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--teal), var(--green)); min-width: 6px; transition: width 0.4s ease; }
.bar-row .b-val { text-align: right; font-weight: 800; color: var(--teal-deep); font-variant-numeric: tabular-nums; }

.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th {
  text-align: left; font-size: 11.5px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--muted); padding: 9px 10px; border-bottom: 2px solid var(--line);
}
.data-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); }
.data-table tr:last-child td { border-bottom: none; }
.data-table .amt-in { color: var(--green-dark); font-weight: 800; }
.data-table .amt-out { color: var(--red); font-weight: 800; }
.data-table .mono { font-family: ui-monospace, monospace; font-size: 13px; color: var(--teal-deep); font-weight: 700; }

.tag { display: inline-block; font-size: 11px; font-weight: 800; padding: 3px 10px; border-radius: 999px; letter-spacing: 0.5px; }
.tag-issue { background: #eaf4ff; color: #2471c8; }
.tag-topup { background: #f0f9e8; color: var(--green-dark); }
.tag-charge { background: #fef4e4; color: #c87d24; }

.table-scroll { max-height: 480px; overflow-y: auto; }

/* ---------- Footer ---------- */

.demo-footer { text-align: center; margin-top: 44px; color: var(--muted); font-size: 13px; }
.demo-footer button { background: none; border: none; color: var(--teal-dark); font-weight: 700; text-decoration: underline; font-size: 13px; }

/* ---------- Utility ---------- */

.hidden { display: none !important; }
.mt { margin-top: 18px; }
.center { text-align: center; }

/* ---------- Print (ticket only) ---------- */

@media print {
  body { visibility: hidden; background: #fff; }
  .ticket-card, .ticket-card * { visibility: visible; }
  .ticket-card { position: absolute; left: 50%; top: 20px; transform: translateX(-50%); box-shadow: none; border: 1px solid #ccc; }
}

/* ---------- Mobile ---------- */

@media (max-width: 560px) {
  .page { padding: 20px 14px 56px; }
  .page-title { font-size: 24px; }
  .card { padding: 18px; }
  .field-row { grid-template-columns: 1fr; }
  .activity-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .activity-tile { padding: 12px 10px; }
  .bar-row { grid-template-columns: 110px 1fr 64px; }
  .customer-panel { flex-wrap: wrap; }
  .customer-panel .c-balance { margin-left: 0; width: 100%; text-align: left; }
}
