* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #f0f2f5;
  --bg2: #ffffff;
  --bg3: #e8eaed;
  --accent: #2ecc71;
  --gold: #f0b429;
  --orange: #27ae60;
  --text: #1a1a2a;
  --text2: #4a4a5a;
  --card: #ffffff;
  --border: #e0e0e0;
  --success: #27ae60;
  --danger: #e74c3c;
  --radius: 14px;
  --purple: #8b5cf6;
  --pink: #ec4899;
  --teal: #06b6d4;
  --green: #2ecc71;
  --muted: #8a8a9a;
}
html, body { height: 100%; }
body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
#app { min-height: 100vh; display: flex; flex-direction: column; }

/* Header */
.header {
  background: #ffffff;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: 56px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.header-left, .header-right { width: 44px; display: flex; align-items: center; }
.header-right { justify-content: flex-end; }
.hamburger-btn, .notif-btn {
  background: none; border: none; color: var(--text); font-size: 1.5rem; cursor: pointer;
  padding: 4px 8px; border-radius: 8px; transition: background 0.2s;
}
.hamburger-btn:hover, .notif-btn:hover { background: var(--bg3); }

.header-brand {
  display: flex; align-items: center; gap: 10px;
}
.header-brand .dd-badge {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.85rem; color: #fff; flex-shrink: 0;
  letter-spacing: -0.5px;
}
.header-brand .brand-text {
  font-size: 1.15rem; font-weight: 700; color: var(--text);
}

/* Legacy .logo class */
.header .logo {
  font-size: 1.3rem; font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--gold));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

/* Side Panel */
.side-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.3); z-index: 200;
  opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.side-overlay.open { opacity: 1; pointer-events: auto; }
.side-panel {
  position: fixed; top: 0; left: 0; bottom: 0; width: 280px; z-index: 201;
  background: #ffffff; transform: translateX(-100%); transition: transform 0.3s ease;
  display: flex; flex-direction: column; overflow-y: auto;
  box-shadow: 2px 0 12px rgba(0,0,0,0.1);
}
.side-panel.open { transform: translateX(0); }
.side-panel-header {
  padding: 24px 20px 16px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.side-panel-header .avatar { width: 48px; height: 48px; font-size: 1.2rem; flex-shrink: 0; }
.side-panel-header .sp-info h3 { font-size: 1rem; color: var(--text); }
.side-panel-header .sp-info .badge { margin-top: 4px; }
.side-menu { flex: 1; padding: 8px 0; }
.side-menu a {
  display: flex; align-items: center; gap: 12px; padding: 12px 20px;
  color: var(--text2); text-decoration: none; font-size: 0.95rem; transition: all 0.2s;
}
.side-menu a:hover { background: var(--bg); color: var(--text); }
.side-menu a.active { background: rgba(46,204,113,0.08); color: var(--accent); border-left: 3px solid var(--accent); font-weight: 600; }
.side-menu a .menu-icon { font-size: 1.1rem; width: 24px; text-align: center; }
.side-menu-divider { height: 1px; background: var(--border); margin: 8px 20px; }
.side-menu-label { padding: 8px 20px 4px; font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.side-logout {
  padding: 12px 20px; border-top: 1px solid var(--border);
}
.side-logout button {
  width: 100%; padding: 10px; border-radius: 8px; border: 1px solid var(--border);
  background: transparent; color: var(--danger); font-size: 0.9rem; cursor: pointer;
  font-family: inherit; transition: all 0.2s;
}
.side-logout button:hover { background: rgba(231,76,60,0.06); }

/* Legacy nav hidden */
.navbar { display: none; }

/* Page */
.page { flex: 1; padding: 20px; max-width: 600px; margin: 0 auto; width: 100%; }
.page-wide { max-width: 900px; }

/* Page title block */
.page-title { margin-bottom: 20px; }
.page-title h2 { font-size: 1.6rem; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.page-title p { color: var(--text2); font-size: 0.9rem; }

/* Cards */
.card {
  background: var(--card); border-radius: var(--radius); padding: 24px;
  margin-bottom: 16px; border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.card h2 { margin-bottom: 16px; font-size: 1.2rem; color: var(--text); }
.card h3 { margin-bottom: 12px; font-size: 1rem; color: var(--accent); }

/* Gradient Hero Cards */
.hero-card {
  border-radius: 16px; padding: 28px 24px; margin-bottom: 20px;
  position: relative; overflow: hidden; border: none;
}
.hero-card.hero-welcome {
  background: linear-gradient(135deg, #2ecc71 0%, #27ae60 50%, #f0b429 100%);
  color: #fff;
}
.hero-card.hero-purple {
  background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
  color: #fff;
}
.hero-card.hero-brown {
  background: linear-gradient(135deg, #f0b429 0%, #e6a817 100%);
  color: #fff;
}
.hero-card .hero-icon {
  width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; margin-bottom: 12px;
}
.hero-card .hero-label { font-size: 0.9rem; opacity: 0.9; margin-bottom: 4px; }
.hero-card .hero-value { font-size: 2rem; font-weight: 800; }
.hero-card .hero-title { font-size: 1.4rem; font-weight: 800; margin-bottom: 6px; }
.hero-card .hero-subtitle { font-size: 0.95rem; opacity: 0.9; margin-bottom: 16px; line-height: 1.4; }
.hero-card .btn-white {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; color: #1a1a2a; font-weight: 700; font-size: 0.9rem;
  padding: 10px 20px; border-radius: 8px; border: none; cursor: pointer;
  text-decoration: none;
}
.hero-card .btn-white:hover { opacity: 0.9; }

/* 2x2 Stat Grid */
.stat-grid-2x2 {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px; margin-bottom: 20px;
}
.stat-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; display: flex; justify-content: space-between; align-items: flex-start;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.stat-card .stat-info .stat-label {
  font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.stat-card .stat-info .stat-value {
  font-size: 1.5rem; font-weight: 800; color: var(--text);
}
.stat-card .stat-icon {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
}
.stat-icon.orange-icon { background: rgba(46,204,113,0.15); color: #2ecc71; }
.stat-icon.blue-icon { background: rgba(6,182,212,0.15); color: #06b6d4; }
.stat-icon.pink-icon { background: rgba(240,180,41,0.15); color: #f0b429; }
.stat-icon.green-icon { background: rgba(139,92,246,0.15); color: #8b5cf6; }

/* Section header with View All */
.section-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.section-header h3 { color: var(--text); font-size: 1.1rem; font-weight: 700; margin: 0; }
.section-header a {
  color: var(--muted); font-size: 0.85rem; text-decoration: none;
}
.section-header a:hover { color: var(--text); }

/* Feed Post Card */
.feed-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.feed-card .feed-author {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.feed-card .feed-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem; font-weight: 700; color: #fff; flex-shrink: 0;
}
.feed-card .feed-meta { flex: 1; }
.feed-card .feed-meta .feed-name { font-weight: 600; font-size: 0.9rem; color: var(--text); }
.feed-card .feed-meta .feed-date { font-size: 0.75rem; color: var(--muted); }
.feed-card .feed-title { font-weight: 700; font-size: 1rem; margin-bottom: 4px; color: var(--text); }
.feed-card .feed-body { font-size: 0.9rem; color: var(--text2); line-height: 1.5; margin-bottom: 10px; }
.feed-card .feed-actions {
  display: flex; gap: 16px; align-items: center; padding-top: 8px;
  border-top: 1px solid var(--border);
}
.feed-card .feed-actions button,
.feed-card .feed-actions span {
  font-size: 0.85rem; color: var(--muted); display: flex; align-items: center; gap: 4px;
}
.feed-card .feed-actions button { background: none; border: none; cursor: pointer; font-family: inherit; }
.feed-card .feed-actions button:hover { color: var(--text); }

/* Toggle Pill Tabs */
.pill-tabs {
  display: flex; gap: 8px; margin-bottom: 16px;
}
.pill-tab {
  padding: 8px 20px; border-radius: 24px; border: 1.5px solid var(--border);
  background: transparent; color: var(--text2); cursor: pointer;
  font-size: 0.85rem; font-weight: 600; font-family: inherit; transition: all 0.2s;
  display: inline-flex; align-items: center; gap: 6px;
}
.pill-tab.active {
  border-color: var(--accent); color: var(--accent); background: rgba(46,204,113,0.08);
}

/* Challenge Card */
.challenge-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.challenge-card .ch-header {
  display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px;
}
.challenge-card .ch-icon {
  width: 42px; height: 42px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
}
.challenge-card .ch-info { flex: 1; }
.challenge-card .ch-title { font-weight: 700; font-size: 1rem; margin-bottom: 2px; color: var(--text); }
.challenge-card .ch-desc { font-size: 0.8rem; color: var(--text2); }
.challenge-card .ch-progress-bar {
  height: 8px; background: var(--bg3); border-radius: 4px; overflow: hidden; margin: 10px 0 6px;
}
.challenge-card .ch-progress-fill {
  height: 100%; background: linear-gradient(90deg, var(--accent), var(--gold));
  border-radius: 4px; transition: width 0.3s;
}
.challenge-card .ch-footer {
  display: flex; justify-content: space-between; align-items: center; margin-top: 8px;
}
.challenge-card .ch-badge {
  font-size: 0.75rem; padding: 3px 10px; border-radius: 12px; font-weight: 600;
}
.ch-badge.points-badge { background: rgba(240,180,41,0.15); color: #c8960e; }
.ch-badge.time-badge { background: rgba(139,94,246,0.15); color: var(--purple); }

/* Course Card */
.course-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; margin-bottom: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.course-card .course-image {
  height: 140px; background: var(--bg3); display: flex; flex-direction: column;
  align-items: center; justify-content: center; color: var(--muted);
  position: relative;
}
.course-card .course-image .lock-icon { font-size: 2.5rem; margin-bottom: 6px; opacity: 0.6; }
.course-card .course-image .lock-text { font-size: 0.8rem; }
.course-card .course-body { padding: 14px; }
.course-card .course-tags { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.course-card .course-tag {
  font-size: 0.7rem; padding: 3px 10px; border-radius: 12px; font-weight: 600;
}
.course-tag.tag-orange { background: rgba(46,204,113,0.12); color: #27ae60; }
.course-tag.tag-gray { background: rgba(138,138,154,0.12); color: var(--muted); }
.course-card .course-title { font-weight: 700; font-size: 1rem; margin-bottom: 4px; color: var(--text); }
.course-card .course-desc { font-size: 0.8rem; color: var(--text2); margin-bottom: 10px; line-height: 1.4; }
.course-card .course-meta { font-size: 0.8rem; color: var(--muted); display: flex; gap: 12px; }

/* Dropdown filter buttons */
.filter-row { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-btn {
  padding: 8px 16px; border-radius: 8px; border: 1px solid var(--border);
  background: #ffffff; color: var(--text); cursor: pointer; font-size: 0.85rem;
  font-family: inherit; display: flex; align-items: center; gap: 6px;
}

/* Support Form */
.support-form .form-group label {
  color: var(--accent); font-size: 0.8rem; font-weight: 600;
}
.btn-gradient-orange {
  width: 100%; padding: 14px; border-radius: 10px; border: none;
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  color: #fff; font-size: 1rem; font-weight: 700; cursor: pointer;
  font-family: inherit; transition: opacity 0.2s;
}
.btn-gradient-orange:hover { opacity: 0.9; }

/* Check-in viewfinder */
.checkin-viewfinder {
  width: 120px; height: 120px; border-radius: 50%;
  background: var(--bg3); margin: 0 auto 20px;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.checkin-viewfinder::before,
.checkin-viewfinder::after {
  content: ''; position: absolute; width: 100%; height: 100%;
  border-radius: 50%;
}
.checkin-viewfinder .vf-corners {
  width: 130px; height: 130px; position: absolute;
  border: 3px solid transparent;
  border-top-color: var(--accent); border-right-color: var(--gold);
  border-bottom-color: var(--accent); border-left-color: var(--gold);
  border-radius: 50%;
  animation: viewfinderSpin 8s linear infinite;
}
@keyframes viewfinderSpin { to { transform: rotate(360deg); } }
.checkin-viewfinder .vf-icon { font-size: 2.5rem; z-index: 1; }

/* Scan input centered */
.checkin-input-centered {
  width: 100%; max-width: 360px; margin: 0 auto; display: block;
  padding: 14px 18px; font-size: 1rem; text-align: center;
  border-radius: 10px; border: 1.5px solid var(--border);
  background: #ffffff; color: var(--text);
  font-family: inherit; transition: border 0.2s;
}
.checkin-input-centered:focus { outline: none; border-color: var(--accent); }
.checkin-helper {
  text-align: center; color: var(--muted); font-size: 0.8rem;
  margin-top: 8px; max-width: 300px; margin-left: auto; margin-right: auto;
}

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 0.85rem; color: var(--text2); font-weight: 500; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 12px 14px; border-radius: 8px; border: 1px solid var(--border);
  background: #ffffff; color: var(--text); font-size: 1rem; font-family: inherit; transition: border 0.2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--accent); }

/* Checkbox label inline */
.form-group label input[type="checkbox"] { width: auto; margin-right: 8px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 24px; border-radius: 8px; font-size: 0.95rem; font-weight: 600;
  border: none; cursor: pointer; transition: all 0.2s; font-family: inherit; gap: 8px;
}
.btn-primary { background: linear-gradient(135deg, #2ecc71, #27ae60); color: #fff; }
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-secondary { background: #ffffff; color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost { background: transparent; color: var(--text2); border: none; padding: 6px 12px; font-size: 0.85rem; cursor: pointer; border-radius: 8px; }
.btn-ghost:hover { background: var(--bg3); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn-orange {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  color: #fff; font-weight: 600;
}
.btn-orange:hover { opacity: 0.9; }

/* Tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
th { color: var(--muted); font-weight: 500; font-size: 0.8rem; text-transform: uppercase; }
tr:hover { background: rgba(46,204,113,0.04); }

/* Badge */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
}
.badge-admin { background: #2ecc71; color: #fff; }
.badge-coach { background: #f0b429; color: #1a1a2a; }
.badge-parent { background: #8b5cf6; color: #fff; }
.badge-adult_member { background: var(--bg3); color: var(--text); }
.badge-kid { background: #06b6d4; color: #fff; }

/* Auth page */
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; background: var(--bg); }
.auth-card { width: 100%; max-width: 420px; }
.auth-title { text-align: center; margin-bottom: 24px; }
.auth-title .auth-dd-badge {
  width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.4rem; color: #fff;
  margin: 0 auto 12px;
}
.auth-title h1 {
  font-size: 1.8rem; color: var(--text); font-weight: 800;
}
.auth-title p { color: var(--muted); margin-top: 4px; }
.auth-toggle { text-align: center; margin-top: 16px; color: var(--muted); font-size: 0.9rem; }
.auth-toggle a { color: var(--accent); cursor: pointer; text-decoration: none; }

/* Signature canvas */
.sig-canvas { width: 100%; height: 200px; background: #fff; border-radius: 8px; cursor: crosshair; touch-action: none; border: 1px solid var(--border); }

/* QR code */
.qr-container { text-align: center; }
.qr-container img { max-width: 300px; border-radius: 12px; }

/* Profile */
.profile-header { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 700; color: #fff; flex-shrink: 0;
}
.profile-info h2 { font-size: 1.3rem; color: var(--text); }
.profile-info p { color: var(--text2); font-size: 0.9rem; }

.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px; margin: 16px 0;
}
.stat-item { text-align: center; padding: 16px; background: var(--bg); border-radius: 8px; }
.stat-item .value { font-size: 1.5rem; font-weight: 700; color: var(--accent); }
.stat-item .label { font-size: 0.8rem; color: var(--muted); margin-top: 4px; }

/* Barcode */
.barcode-display {
  text-align: center; padding: 16px; background: #fff; border-radius: 8px;
  color: #000; font-family: monospace; font-size: 1.5rem; letter-spacing: 3px; font-weight: 700;
  border: 1px solid var(--border);
}

/* Tabs */
.tabs { display: flex; gap: 4px; margin-bottom: 20px; overflow-x: auto; }
.tab {
  padding: 8px 16px; border-radius: 8px; border: none; background: var(--bg);
  color: var(--text2); cursor: pointer; font-size: 0.85rem; font-family: inherit;
  transition: all 0.2s; white-space: nowrap;
}
.tab.active { background: var(--accent); color: #fff; font-weight: 600; }

/* Alerts */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 0.9rem; }
.alert-success { background: rgba(39, 174, 96, 0.1); border: 1px solid var(--success); color: var(--success); }
.alert-error { background: rgba(231, 76, 60, 0.1); border: 1px solid var(--danger); color: var(--danger); }

/* Loading */
.spinner { display: inline-block; width: 20px; height: 20px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Search */
.search-bar {
  width: 100%; padding: 10px 14px; border-radius: 8px; border: 1px solid var(--border);
  background: #ffffff; color: var(--text); font-size: 0.95rem; margin-bottom: 16px; font-family: inherit;
}
.search-bar:focus { outline: none; border-color: var(--accent); }

/* Member list item */
.member-item { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 8px; cursor: pointer; transition: background 0.2s; }
.member-item:hover { background: var(--bg); }
.member-item .avatar { width: 40px; height: 40px; font-size: 1rem; }
.member-item-info { flex: 1; }
.member-item-info h4 { font-size: 0.95rem; color: var(--text); }
.member-item-info p { font-size: 0.8rem; color: var(--muted); }

/* Waiver */
.waiver-text {
  max-height: 300px; overflow-y: auto; padding: 16px; background: var(--bg);
  border-radius: 8px; margin-bottom: 16px; font-size: 0.9rem; line-height: 1.6; color: var(--text2);
}
.waiver-text h4 { color: var(--text); margin: 12px 0 6px; }

/* Schedule grid */
.schedule-grid { display: grid; gap: 12px; }
.schedule-day { margin-bottom: 8px; }
.schedule-day h4 { color: var(--accent); margin-bottom: 8px; text-transform: capitalize; font-size: 0.9rem; }
.schedule-class {
  background: #ffffff; border-radius: 8px; padding: 12px; margin-bottom: 8px;
  border-left: 3px solid var(--accent); display: flex; justify-content: space-between; align-items: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.schedule-class .sc-info h5 { font-size: 0.9rem; margin-bottom: 2px; color: var(--text); }
.schedule-class .sc-info p { font-size: 0.8rem; color: var(--muted); }
.schedule-class .sc-action .btn { font-size: 0.8rem; padding: 6px 12px; }

/* Check-in legacy */
.checkin-input {
  width: 100%; padding: 16px; font-size: 1.3rem; text-align: center; border-radius: 12px;
  border: 2px solid var(--border); background: #ffffff; color: var(--text);
  font-family: monospace; letter-spacing: 2px; transition: border 0.2s;
}
.checkin-input:focus { outline: none; border-color: var(--accent); }
.checkin-result {
  text-align: center; padding: 24px; margin-top: 16px; border-radius: 12px;
  animation: fadeIn 0.3s ease;
}
.checkin-result.success { background: rgba(39,174,96,0.1); border: 1px solid var(--success); }
.checkin-result.error { background: rgba(231,76,60,0.1); border: 1px solid var(--danger); }
.checkin-result .avatar { margin: 0 auto 12px; width: 80px; height: 80px; font-size: 2rem; }
.checkin-result h3 { margin-bottom: 4px; color: var(--text); }
.checkin-result p { color: var(--text2); }
@keyframes fadeIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }

/* Booking card */
.booking-card {
  background: #ffffff; border-radius: 8px; padding: 14px; margin-bottom: 8px;
  display: flex; justify-content: space-between; align-items: center;
  border: 1px solid var(--border); box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.booking-card .bc-info h4 { font-size: 0.9rem; color: var(--text); }
.booking-card .bc-info p { font-size: 0.8rem; color: var(--muted); }

/* Responsive */
@media (max-width: 480px) {
  .header { padding: 10px 14px; }
  .page { padding: 14px; }
  .card { padding: 18px; }
  .stat-grid-2x2 { gap: 8px; }
  .stat-card { padding: 12px; }
  .stat-card .stat-info .stat-value { font-size: 1.3rem; }
}

/* Themed Toast */
.toast-container { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); z-index: 9999; pointer-events: none; }
.toast { background: #ffffff; border: 1px solid var(--accent); color: var(--text); padding: 14px 24px; border-radius: 12px; margin-bottom: 8px; font-size: 14px; box-shadow: 0 4px 20px rgba(46,204,113,0.2); animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards; pointer-events: auto; max-width: 340px; text-align: center; }
.toast.success { border-color: #2ecc71; box-shadow: 0 4px 20px rgba(46,204,113,0.2); }
.toast.error { border-color: #e74c3c; box-shadow: 0 4px 20px rgba(231,76,60,0.2); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-20px); } }

/* Themed Confirm Modal */
.confirm-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 9998; display: flex; align-items: center; justify-content: center; animation: fadeIn 0.2s ease; }
.confirm-modal { background: #ffffff; border: 1px solid var(--border); border-radius: 16px; padding: 28px 24px; max-width: 340px; width: 90%; text-align: center; box-shadow: 0 8px 32px rgba(0,0,0,0.15); }
.confirm-modal p { color: var(--text); font-size: 16px; margin-bottom: 24px; }
.confirm-modal .btn-row { display: flex; gap: 12px; justify-content: center; }
.confirm-modal .btn-cancel { background: var(--bg); color: var(--muted); border: 1px solid var(--border); padding: 10px 24px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.confirm-modal .btn-confirm { background: linear-gradient(135deg, #2ecc71, #27ae60); color: white; border: none; padding: 10px 24px; border-radius: 8px; cursor: pointer; font-size: 14px; }

/* Phase 3+4 additions */
.btn-link { background: none; border: none; cursor: pointer; font-size: 0.85rem; padding: 2px 4px; }
.btn-link:hover { opacity: 0.8; }

.notif-badge {
  position: absolute;
  top: -4px; right: -4px;
  background: #dc143c;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 16px; height: 16px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
}
.notif-btn { position: relative; }

/* Leaderboard entry */
.lb-entry {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 8px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.lb-rank { font-size: 1.3rem; min-width: 36px; text-align: center; }
.lb-info { flex: 1; }
.lb-info strong { font-size: 0.95rem; color: var(--text); }
.lb-info .lb-sub { font-size: 0.8rem; color: var(--muted); }
.lb-points { font-size: 1.1rem; font-weight: 800; color: var(--accent); }

/* ==================== Merch Store ==================== */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.product-card { background: #fff; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); transition: transform 0.15s; }
.product-card:hover { transform: translateY(-2px); }
.filter-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { padding: 6px 16px; border-radius: 20px; border: none; background: #e9ecef; cursor: pointer; font-size: 0.85rem; font-weight: 600; transition: all 0.15s; }
.pill.active { background: var(--green, #27ae60); color: #fff; }
.qty-btn { width: 32px; height: 32px; border-radius: 50%; border: 1px solid #ddd; background: #fff; cursor: pointer; font-size: 1.1rem; display: flex; align-items: center; justify-content: center; }
.qty-btn:hover { background: #f0f0f0; }
.qty-btn.remove { border-color: #e74c3c; color: #e74c3c; }
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 1000; display: flex; align-items: center; justify-content: center; }
.modal-overlay label { display: block; font-weight: 600; margin: 10px 0 4px; font-size: 0.85rem; }
.form-select { width: 100%; padding: 8px 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 0.9rem; }

/* ==================== XP System ==================== */
.xp-level-badge { display: inline-block; background: linear-gradient(135deg, #f0b429, #e6a817); color: #fff; padding: 2px 8px; border-radius: 12px; font-size: 0.7rem; font-weight: 700; margin-left: 4px; }
.xp-hero-bar { margin: 12px 0 16px; }
.xp-hero-level { font-size: 1rem; font-weight: 800; }
.xp-bar-track { height: 8px; background: rgba(255,255,255,0.3); border-radius: 4px; overflow: hidden; margin: 6px 0 4px; }
.xp-bar-fill { height: 100%; background: linear-gradient(90deg, #fff, #f0b429); border-radius: 4px; transition: width 0.5s ease; }
.xp-hero-text { font-size: 0.8rem; opacity: 0.9; }

/* XP Toast */
.xp-toast-popup {
  background: linear-gradient(135deg, #2ecc71, #27ae60); color: #fff; padding: 8px 18px;
  border-radius: 20px; font-weight: 800; font-size: 1rem; margin-bottom: 8px;
  animation: xpFloat 2s ease forwards; pointer-events: none; text-align: center;
  box-shadow: 0 4px 12px rgba(46,204,113,0.4);
}
@keyframes xpFloat {
  0% { opacity: 0; transform: translateY(20px) scale(0.8); }
  20% { opacity: 1; transform: translateY(0) scale(1.1); }
  40% { transform: translateY(-10px) scale(1); }
  100% { opacity: 0; transform: translateY(-40px) scale(0.9); }
}

/* ==================== Badges ==================== */
.badges-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.badge-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 20px 12px; text-align: center; transition: transform 0.2s; }
.badge-card.unlocked { border-color: #f0b429; box-shadow: 0 2px 12px rgba(240,180,41,0.2); }
.badge-card.locked { opacity: 0.5; filter: grayscale(0.8); }
.badge-card .badge-emoji { font-size: 2.5rem; margin-bottom: 8px; }
.badge-card .badge-name { font-weight: 700; font-size: 0.85rem; margin-bottom: 4px; }
.badge-card .badge-desc { font-size: 0.75rem; color: var(--text2); }

/* ==================== Kids Theme ==================== */
.kids-theme { }
.kids-hero {
  background: linear-gradient(135deg, #4FC3F7, #AB47BC);
  border-radius: 20px; padding: 28px 24px; text-align: center; color: #fff;
  margin-bottom: 20px; position: relative; overflow: hidden;
}
.kids-hero::before {
  content: ''; position: absolute; top: -50%; right: -20%;
  width: 200px; height: 200px; border-radius: 50%;
  background: rgba(255,255,255,0.1);
}
.kids-avatar { font-size: 3rem; margin-bottom: 8px; }
.kids-welcome { font-size: 1.6rem; font-weight: 800; margin-bottom: 12px; }
.kids-level-display { text-align: center; }
.kids-level-text { font-size: 1.2rem; font-weight: 800; }
.kids-xp-bar { height: 12px; background: rgba(255,255,255,0.3); border-radius: 6px; overflow: hidden; margin: 8px auto; max-width: 250px; }
.kids-xp-fill { height: 100%; background: linear-gradient(90deg, #66BB6A, #FFA726); border-radius: 6px; transition: width 0.5s; }
.kids-xp-text { font-size: 0.85rem; opacity: 0.9; }

.kids-daily-quest {
  background: #fff; border: 2px solid #FFA726; border-radius: 16px; padding: 16px;
  display: flex; align-items: center; gap: 14px; margin-bottom: 16px;
  animation: questPulse 3s ease infinite;
}
@keyframes questPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255,167,38,0.3); } 50% { box-shadow: 0 0 0 8px rgba(255,167,38,0); } }
.kids-quest-icon { font-size: 2rem; }
.kids-quest-text strong { font-size: 1rem; color: #FFA726; }
.kids-quest-text p { font-size: 0.85rem; color: var(--text2); margin-top: 2px; }

.kids-stats-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.kids-stat {
  background: #fff; border-radius: 16px; padding: 16px 10px; text-align: center;
  border: 1px solid var(--border); box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.kids-stat-icon { font-size: 1.5rem; margin-bottom: 4px; }
.kids-stat-value { font-size: 1.5rem; font-weight: 800; color: #AB47BC; }
.kids-stat-label { font-size: 0.7rem; color: var(--text2); text-transform: uppercase; }

.kids-badges-section { margin-bottom: 20px; }
.kids-badges-section h3 { margin-bottom: 10px; }
.kids-badges-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px; }
.kids-badge-chip { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; background: rgba(255,215,0,0.15); border: 2px solid rgba(255,215,0,0.4); font-size: 1.5rem; flex-shrink: 0; }
.kids-badge-mini {
  background: #fff; border: 1px solid #f0b429; border-radius: 12px; padding: 8px 14px;
  display: flex; align-items: center; gap: 6px; font-size: 0.8rem; font-weight: 600;
  white-space: nowrap; flex-shrink: 0;
}

.kids-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.kids-action-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 18px 12px; border-radius: 16px; font-size: 1rem; font-weight: 700;
  text-decoration: none; color: #fff; text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15); transition: transform 0.15s;
}
.kids-action-btn:hover { transform: translateY(-2px); }
.kids-btn-blue { background: linear-gradient(135deg, #4FC3F7, #29B6F6); }
.kids-btn-green { background: linear-gradient(135deg, #66BB6A, #43A047); }
.kids-btn-purple { background: linear-gradient(135deg, #AB47BC, #8E24AA); }
.kids-btn-orange { background: linear-gradient(135deg, #FFA726, #FB8C00); }
.kids-btn-pink { background: linear-gradient(135deg, #EC407A, #D81B60); }

/* Kids Belt Journey */
.kids-belt-path {
  display: flex; align-items: center; overflow-x: auto; padding: 20px 0;
  gap: 0; margin-bottom: 20px;
}
.kids-belt-node { display: flex; flex-direction: column; align-items: center; min-width: 70px; flex-shrink: 0; }
.kids-belt-circle {
  width: 50px; height: 50px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 1.2rem; margin-bottom: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15); transition: transform 0.3s;
}
.kids-belt-node.current .kids-belt-circle { transform: scale(1.2); box-shadow: 0 4px 16px rgba(0,0,0,0.25); animation: currentBeltPulse 2s ease infinite; }
@keyframes currentBeltPulse { 0%, 100% { box-shadow: 0 4px 16px rgba(0,0,0,0.25); } 50% { box-shadow: 0 4px 24px rgba(255,167,38,0.5); } }
.kids-belt-node.future { opacity: 0.4; }
.kids-belt-name { font-size: 0.7rem; font-weight: 600; text-align: center; }
.kids-belt-connector { width: 30px; height: 3px; background: #ddd; flex-shrink: 0; margin-top: -20px; }
.kids-belt-connector.active { background: #66BB6A; }

.kids-belt-quest {
  background: #fff; border: 2px dashed #AB47BC; border-radius: 16px; padding: 16px;
  display: flex; align-items: center; gap: 12px; font-size: 0.95rem; color: var(--text);
}

/* Kids Leaderboard */
.kids-rank-hero {
  background: linear-gradient(135deg, #FFA726, #FB8C00); color: #fff;
  border-radius: 16px; padding: 20px; text-align: center; margin-bottom: 16px;
}
.kids-rank-pos { font-size: 2rem; font-weight: 800; }
.kids-rank-text { font-size: 0.95rem; margin-top: 4px; }
.kids-lb-entry {
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  padding: 12px; margin-bottom: 8px; display: flex; align-items: center; gap: 12px;
}
.kids-lb-entry.kids-lb-me { border-color: #FFA726; background: rgba(255,167,38,0.05); }
.kids-lb-rank { font-size: 1.2rem; min-width: 40px; text-align: center; }
.kids-lb-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, #4FC3F7, #AB47BC);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 0.9rem;
}
.kids-lb-info { flex: 1; }
.kids-lb-xp { font-weight: 800; color: #AB47BC; font-size: 1rem; }

.kids-encourage { color: #66BB6A; font-weight: 600; margin-bottom: 16px; font-size: 1.1rem; }

/* Confetti animation for celebrations */
@keyframes confetti-fall {
  0% { transform: translateY(-100%) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}
.confetti-piece {
  position: fixed; width: 10px; height: 10px; top: 0;
  animation: confetti-fall 3s ease forwards;
  z-index: 9999; pointer-events: none;
}

/* ================================================================
   DESKTOP LAYOUT - 768px+
   Sidebar always visible; content centred in remaining space (Facebook-style)
   ================================================================ */
@media (min-width: 768px) {

  /* Offset the full app so sidebar doesn't overlap content */
  #app { padding-left: 280px; }

  .hamburger-btn { display: none !important; }

  .side-panel {
    transform: translateX(0) !important;
    transition: none;
  }

  .side-overlay { display: none !important; }

  /* Header spans only the content area */
  .header {
    left: 280px;
    right: 0;
    width: auto;
  }

  /* Pages centre within the content area */
  .page,
  .page-wide {
    margin-left: auto;
    margin-right: auto;
  }

  .page {
    max-width: 960px;
    padding: 28px 32px;
  }

  .page-wide {
    max-width: 1300px;
    padding: 28px 32px;
  }

  .auth-card { max-width: 480px; }
  .confirm-modal { max-width: 480px; }
  .header-right { width: auto; gap: 8px; }
  .side-panel-header { padding: 28px 24px 20px; }

  .dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  .dashboard-grid .hero-card { grid-column: 1 / -1; }

  .card-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
  }
}

@media (min-width: 1100px) {
  .page { max-width: 1100px; }
  .page-wide { max-width: 1440px; }
}
