:root {
  --green: #4CAF50;
  --green-dark: #388E3C;
  --green-light: #E8F5E9;
  --kiwi: #8BC34A;
  --kiwi-dark: #558B2F;
  --text: #1a1a1a;
  --muted: #666;
  --border: #e0e0e0;
  --bg: #f5f7f5;
  --white: #fff;
  --shadow: 0 2px 12px rgba(0,0,0,0.07);
  --shadow-lg: 0 6px 24px rgba(0,0,0,0.1);
  --radius: 14px;
  --admin-sidebar: 240px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--green-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
textarea { font-family: inherit; }

/* ── NAVBAR ── */
.navbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  /* safe-area-inset-top pushes content below notch/Dynamic Island on iOS;
     max() keeps a sensible minimum on non-notched devices */
  padding-top: max(10px, env(safe-area-inset-top, 10px));
  min-height: 60px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.brand { font-size: 1.25rem; font-weight: 800; color: var(--kiwi-dark); text-decoration: none; }
.nav-links { display: flex; align-items: center; gap: 16px; }
/* Minimum 44px touch target height on all nav links */
.nav-links a {
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 500;
  position: relative;
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 0 2px;
}
.notif-link { font-size: 1.2rem; }
.notif-badge { position: absolute; top: -6px; right: -10px; background: #f44336; color: #fff; font-size: 0.65rem; padding: 1px 5px; border-radius: 10px; font-weight: 700; }

/* Mobile navbar: tighter horizontal spacing, larger tap zones */
@media (max-width: 640px) {
  .navbar { padding-left: 14px; padding-right: 14px; gap: 8px; }
  .brand { font-size: 1.05rem; }
  .nav-links { gap: 6px; }
  .nav-links a { font-size: 0.82rem; min-height: 44px; padding: 0 4px; }
  .nav-links .btn-sm { padding: 8px 10px; font-size: 0.8rem; min-height: 44px; }
}

/* ── ADMIN LAYOUT ── */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar { width: var(--admin-sidebar); background: #1a2a1a; color: #fff; display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 200; }
.admin-brand { padding: 20px; font-size: 1.1rem; font-weight: 800; color: #8BC34A; border-bottom: 1px solid rgba(255,255,255,0.1); }
.admin-nav { flex: 1; padding: 12px 0; }
.admin-nav a { display: block; padding: 12px 20px; color: rgba(255,255,255,0.75); font-size: 0.9rem; font-weight: 500; transition: all 0.15s; border-left: 3px solid transparent; }
.admin-nav a:hover, .admin-nav a.active { background: rgba(139,195,74,0.15); color: #8BC34A; border-left-color: #8BC34A; text-decoration: none; }
.admin-nav .logout-link { margin-top: auto; color: rgba(255,255,255,0.4); }
.admin-nav .logout-link:hover { color: #f44336; background: rgba(244,67,54,0.1); border-left-color: #f44336; }
.admin-main { margin-left: var(--admin-sidebar); flex: 1; padding: 32px; max-width: calc(100vw - var(--admin-sidebar)); }

/* ── CONTAINER ── */
.container { max-width: 980px; margin: 0 auto; padding: 32px 20px; flex: 1; }
footer { text-align: center; padding: 20px; color: var(--muted); font-size: 0.85rem; border-top: 1px solid var(--border); margin-top: auto; }

/* ── ALERTS ── */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 0.92rem; }
.alert-success { background: #e8f5e9; color: #2e7d32; border-left: 4px solid #4caf50; }
.alert-error { background: #ffebee; color: #c62828; border-left: 4px solid #ef5350; }
.alert-info { background: #e3f2fd; color: #1565c0; border-left: 4px solid #42a5f5; }

/* ── BUTTONS ── */
.btn { display: inline-block; padding: 10px 20px; border-radius: 8px; font-size: 0.92rem; font-weight: 600; cursor: pointer; border: none; transition: all 0.15s; text-align: center; text-decoration: none; line-height: 1.4; }
.btn:hover { opacity: 0.88; text-decoration: none; }
.btn-primary { background: var(--green); color: #fff; }
.btn-secondary { background: var(--kiwi); color: #fff; }
.btn-outline { background: transparent; border: 2px solid var(--green); color: var(--green-dark); }
.btn-warning { background: #FF9800; color: #fff; }
.btn-danger { background: #f44336; color: #fff; }
.btn-success { background: #4CAF50; color: #fff; }
.btn-stamp { background: var(--green-light); color: var(--green-dark); border: 1px solid #a5d6a7; padding: 6px 14px; font-size: 0.85rem; border-radius: 6px; }
.btn-full { display: block; width: 100%; }
.btn-lg { padding: 14px 28px; font-size: 1.05rem; }
.btn-sm { padding: 6px 14px; font-size: 0.82rem; }

/* ── PAGE HEADER ── */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.page-header h1 { font-size: 1.8rem; }
.subtitle { color: var(--muted); font-size: 0.92rem; margin-top: 4px; }
.back-link { font-size: 0.88rem; color: var(--muted); display: inline-block; margin-bottom: 6px; }

/* ── HERO ── */
.hero { text-align: center; padding: 72px 20px 56px; background: linear-gradient(160deg, #f0fdf4 0%, var(--bg) 100%); }
.hero-badge { display: inline-block; background: var(--green-light); color: var(--kiwi-dark); padding: 5px 14px; border-radius: 20px; font-size: 0.85rem; font-weight: 600; margin-bottom: 16px; }
.hero h1 { font-size: 3.5rem; color: var(--kiwi-dark); margin-bottom: 12px; font-weight: 900; }
.hero-subtitle { font-size: 1.15rem; color: var(--muted); margin-bottom: 32px; max-width: 520px; margin-left: auto; margin-right: auto; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 16px; }
.hero-biz { color: var(--muted); font-size: 0.9rem; }

/* ── FEATURES ── */
.features-section { padding: 56px 20px; max-width: 980px; margin: 0 auto; }
.features-section h2 { text-align: center; font-size: 1.8rem; color: var(--kiwi-dark); margin-bottom: 32px; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.feature-card { background: var(--white); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); text-align: center; }
.feature-icon { font-size: 2rem; margin-bottom: 12px; }
.feature-card h3 { font-size: 0.95rem; margin-bottom: 6px; }
.feature-card p { font-size: 0.85rem; color: var(--muted); }

/* ── HOW IT WORKS ── */
.how-section { padding: 40px 20px; max-width: 980px; margin: 0 auto; text-align: center; }
.how-section h2 { font-size: 1.8rem; color: var(--kiwi-dark); margin-bottom: 32px; }
.steps { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.step { background: var(--white); border-radius: var(--radius); padding: 24px 20px; min-width: 140px; box-shadow: var(--shadow); }
.step-num { width: 36px; height: 36px; background: var(--green); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.1rem; margin: 0 auto 12px; }
.step h3 { font-size: 0.9rem; margin-bottom: 4px; }
.step p { font-size: 0.8rem; color: var(--muted); }
.step-arrow { font-size: 1.5rem; color: var(--green); }

/* ── STAT GRID ── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--white); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); text-align: center; }
.stat-card-link { color: var(--text); text-decoration: none; transition: transform 0.15s, box-shadow 0.15s; }
.stat-card-link:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); text-decoration: none; }
.stat-icon { font-size: 1.8rem; margin-bottom: 8px; }
.stat-val { font-size: 2rem; font-weight: 800; color: var(--kiwi-dark); }
.stat-label { font-size: 0.82rem; color: var(--muted); margin-top: 2px; }
.stat-sub { font-size: 0.78rem; color: var(--green); margin-top: 2px; }

/* ── PANEL ── */
.panel { background: var(--white); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.panel h3 { font-size: 1rem; margin-bottom: 16px; color: var(--kiwi-dark); }
.mt20 { margin-top: 20px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 680px) { .two-col { grid-template-columns: 1fr; } }

/* ── QUICK ACTIONS ── */
.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.action-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: var(--bg); border: 1.5px solid var(--border); border-radius: 10px; padding: 16px; font-size: 0.85rem; font-weight: 600; color: var(--text); transition: all 0.15s; text-decoration: none; }
.action-tile div { font-size: 1.5rem; }
.action-tile:hover { background: var(--green-light); border-color: var(--green); text-decoration: none; }

/* ── FORMS ── */
.form-page { display: flex; justify-content: center; align-items: flex-start; padding: 32px 20px; min-height: 60vh; }
.form-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 36px 32px; width: 100%; max-width: 440px; }
.form-card.wide { max-width: 580px; }
.form-logo { font-size: 2.5rem; font-weight: 800; color: var(--kiwi-dark); text-align: center; margin-bottom: 12px; }
.form-card h2 { margin-bottom: 4px; font-size: 1.4rem; color: var(--kiwi-dark); text-align: center; }
.form-subtitle { text-align: center; color: var(--muted); font-size: 0.9rem; margin-bottom: 20px; }
.form-card label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 5px; margin-top: 14px; color: var(--text); }
.form-card input[type=text], .form-card input[type=email], .form-card input[type=password], .form-card input[type=tel], .form-card input[type=number], .form-card input[type=date], .form-card input[type=datetime-local], .form-card select, .form-card textarea { width: 100%; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 0.92rem; transition: border-color 0.15s; background: #fafafa; }
.form-card input:focus, .form-card select:focus, .form-card textarea:focus { outline: none; border-color: var(--green); background: #fff; }
.form-card .btn { margin-top: 20px; }
.form-footer { margin-top: 16px; font-size: 0.88rem; color: var(--muted); text-align: center; }
.muted-sm { color: var(--muted); font-size: 0.82rem; }
.optional { color: var(--muted); font-weight: 400; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .form-row { grid-template-columns: 1fr; } .form-card { padding: 24px 20px; } }

/* ── FILTER BAR ── */
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.filter-bar input, .filter-bar select { padding: 8px 12px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 0.88rem; background: var(--white); }

/* ── DATA TABLE ── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 10px 12px; text-align: left; font-size: 0.82rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 2px solid var(--border); }
.data-table td { padding: 12px; border-bottom: 1px solid var(--border); font-size: 0.9rem; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #fafdf9; }
.action-col { white-space: nowrap; }
.action-col form, .action-col a { margin-right: 4px; }
.table-scroll { overflow-x: auto; }
.table-panel { padding: 0; overflow: hidden; }
.table-panel .data-table { min-width: 760px; }
.stamp-edit-card { margin: 0 auto; }
.stamp-review-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 16px; margin-bottom: 18px; border-radius: 10px; background: var(--bg); }
.stamp-review-grid div { display: flex; flex-direction: column; gap: 4px; }
.form-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mt10 { margin-top: 10px; }
@media (max-width: 520px) { .stamp-review-grid { grid-template-columns: 1fr; } }

/* ── BADGES ── */
.badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 0.78rem; font-weight: 700; }
.badge-green { background: #e8f5e9; color: #2e7d32; }
.badge-red { background: #ffebee; color: #c62828; }
.badge-grey { background: #f5f5f5; color: #666; }
.badge-orange { background: #fff3e0; color: #e65100; }
.badge-purple { background: #f3e5f5; color: #6a1b9a; }

/* ── LOYALTY CARDS ── */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; }
.loyalty-card-link { text-decoration: none; }
.loyalty-card { background: linear-gradient(135deg, color-mix(in srgb, var(--card-color, #4CAF50) 15%, white), color-mix(in srgb, var(--card-color, #4CAF50) 30%, white)); border: 1.5px solid color-mix(in srgb, var(--card-color, #4CAF50) 50%, white); border-radius: var(--radius); padding: 18px; transition: transform 0.15s, box-shadow 0.15s; cursor: pointer; position: relative; }
.loyalty-card-link:hover .loyalty-card { transform: translateY(-2px); box-shadow: var(--shadow-lg); text-decoration: none; }
.loyalty-card.large { max-width: 360px; }
.loyalty-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.card-name { font-weight: 800; font-size: 1rem; color: #1a2a1a; }
.card-badge { background: var(--green); color: #fff; font-size: 0.72rem; padding: 2px 7px; border-radius: 20px; }
.business-label { font-size: 0.78rem; color: var(--muted); }
.loyalty-card-footer { display: flex; justify-content: space-between; font-size: 0.82rem; color: var(--muted); margin-top: 10px; }

/* ── STAMP TRACK ── */
.stamp-track { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.stamp-dot { width: 26px; height: 26px; border-radius: 50%; background: rgba(255,255,255,0.7); border: 2px solid rgba(0,0,0,0.15); transition: all 0.2s; }
.stamp-dot.filled { background: var(--green); border-color: var(--green-dark); box-shadow: 0 2px 6px rgba(76,175,80,0.4); }
.stamp-more { font-size: 0.75rem; color: var(--muted); }
.stamp-mini-track { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 3px; }
.stamp-mini-dot { width: 13px; height: 13px; border-radius: 50%; background: #e0e0e0; border: 1.5px solid #ccc; }
.stamp-mini-dot.filled { background: var(--green); border-color: var(--green-dark); }
.progress-bar-wrap { height: 5px; background: rgba(0,0,0,0.1); border-radius: 3px; margin-top: 10px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--green); border-radius: 3px; transition: width 0.5s ease; }

/* ── POINTS WALLET ── */
.points-wallet { background: linear-gradient(135deg, #2e7d32, #4CAF50); color: #fff; border-radius: var(--radius); padding: 20px 24px; display: flex; align-items: center; gap: 24px; margin-bottom: 24px; }
.wallet-icon { font-size: 2.5rem; }
.wallet-info, .wallet-cards-count { flex: 1; }
.wallet-val { font-size: 2rem; font-weight: 900; }
.wallet-label { font-size: 0.82rem; opacity: 0.8; }

/* ── CARD DETAIL ── */
.card-detail-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
@media (max-width: 640px) { .card-detail-wrap { grid-template-columns: 1fr; } }
.card-detail-right h3 { margin-bottom: 8px; }
.card-stats-row { display: flex; gap: 16px; margin-top: 16px; }
.mini-stat { flex: 1; text-align: center; background: var(--white); border-radius: 10px; padding: 12px; box-shadow: var(--shadow); }
.mini-stat-val { font-size: 1.4rem; font-weight: 800; color: var(--kiwi-dark); }
.mini-stat-label { font-size: 0.75rem; color: var(--muted); }

/* ── QR CODE ── */
.qr-wrap { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); display: inline-block; padding: 14px; }
.qr-img { display: block; width: 180px; height: 180px; }
.qr-hint { font-size: 0.78rem; word-break: break-all; margin-top: 8px; }

/* ── ACTIVITY LIST ── */
.activity-list { list-style: none; }
.activity-list li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 0.88rem; }
.activity-list li:last-child { border-bottom: none; }
.activity-icon { font-size: 1.1rem; }
.activity-list .muted { margin-left: auto; font-size: 0.78rem; }

/* ── REWARD ALERT ── */
.reward-alert { background: #fff8e1; border: 2px solid #ffd54f; border-radius: var(--radius); padding: 20px; margin-bottom: 20px; text-align: center; }
.reward-alert h3 { color: #e65100; margin-bottom: 6px; }
.reward-highlight { font-size: 1.2rem; font-weight: 800; color: var(--kiwi-dark); margin: 8px 0; }

/* ── NOTIFICATIONS ── */
.notif-list { display: flex; flex-direction: column; gap: 12px; }
.notif-item { background: var(--white); border-radius: var(--radius); padding: 16px; display: flex; gap: 14px; align-items: flex-start; box-shadow: var(--shadow); border-left: 4px solid var(--green); }
.notif-item.notif-reward { border-left-color: #FF9800; }
.notif-item.notif-birthday { border-left-color: #e91e63; }
.notif-item.notif-vip { border-left-color: #9c27b0; }
.notif-icon { font-size: 1.6rem; }
.notif-body { flex: 1; }
.notif-title { font-weight: 700; font-size: 0.95rem; margin-bottom: 4px; }
.notif-msg { font-size: 0.9rem; color: var(--text); margin-bottom: 6px; }
.notif-meta { font-size: 0.78rem; }

/* ── CAMPAIGNS ── */
.campaign-list { display: flex; flex-direction: column; gap: 16px; }
.campaign-card { background: var(--white); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); border-left: 4px solid var(--green); }
.campaign-card.inactive { opacity: 0.65; border-left-color: var(--border); }
.campaign-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; flex-wrap: wrap; gap: 8px; }
.campaign-header h3 { font-size: 1rem; }
.campaign-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.campaign-type { font-size: 0.78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; display: block; margin-bottom: 4px; }
.campaign-msg { font-size: 0.92rem; color: var(--muted); margin-bottom: 8px; }
.campaign-discount { font-size: 0.88rem; color: #e65100; font-weight: 600; }
.campaign-dates { font-size: 0.82rem; margin-bottom: 12px; }
.campaign-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ── SIMPLE LIST ── */
.simple-list { list-style: none; }
.simple-list li { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.simple-list li:last-child { border-bottom: none; }
.link-more { display: block; text-align: right; font-size: 0.85rem; margin-top: 10px; color: var(--green-dark); }

/* ── EMPTY STATE ── */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-icon { font-size: 3.5rem; margin-bottom: 16px; }
.empty-state h2 { color: var(--muted); margin-bottom: 8px; }
.empty-state p { color: var(--muted); margin-bottom: 20px; }

/* ── MOBILE WALLET PAGE ── */
.wallet-page { display: grid; grid-template-columns: 300px 1fr; gap: 32px; align-items: start; }
@media (max-width: 680px) { .wallet-page { grid-template-columns: 1fr; } }
.phone-mockup { display: flex; justify-content: center; }
.phone-card { border-radius: 20px; padding: 20px; color: #fff; width: 260px; box-shadow: 0 12px 40px rgba(0,0,0,0.25); }
.phone-card-brand { font-size: 0.75rem; opacity: 0.8; margin-bottom: 4px; }
.phone-card-biz { font-size: 0.85rem; font-weight: 600; margin-bottom: 2px; }
.phone-card-name { font-size: 1.2rem; font-weight: 900; margin-bottom: 16px; }
.phone-card-stamps { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.phone-stamp { width: 28px; height: 28px; border-radius: 50%; background: rgba(255,255,255,0.25); border: 2px solid rgba(255,255,255,0.5); display: flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 700; }
.phone-stamp.filled { background: rgba(255,255,255,0.9); color: #2e7d32; border-color: rgba(255,255,255,0.9); }
.phone-card-footer { display: flex; justify-content: space-between; margin-bottom: 12px; }
.phone-stat { font-size: 1.2rem; font-weight: 800; }
.phone-stat-label { font-size: 0.65rem; opacity: 0.75; }
.phone-qr { display: flex; justify-content: center; }
.wallet-options { }
.wallet-options h3 { margin-bottom: 16px; font-size: 1.1rem; }
.wallet-option { display: flex; align-items: center; gap: 14px; background: var(--white); border-radius: 12px; padding: 16px; box-shadow: var(--shadow); margin-bottom: 12px; }
.wallet-option-icon { font-size: 2rem; }
.wallet-option-info { flex: 1; }
.wallet-option-info p { font-size: 0.82rem; color: var(--muted); margin-top: 2px; }
.wallet-note { background: #fff8e1; border: 1px solid #ffd54f; border-radius: 10px; padding: 14px; font-size: 0.85rem; color: #795548; }

/* ── SUBSCRIPTIONS / ADMIN ── */
.inline-form { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.select-sm { padding: 5px 8px; font-size: 0.82rem; border: 1.5px solid var(--border); border-radius: 6px; }
.input-sm { padding: 5px 8px; font-size: 0.82rem; border: 1.5px solid var(--border); border-radius: 6px; }

/* ── BIRTHDAY BANNER ── */
.birthday-banner { background: linear-gradient(135deg, #e91e63, #f06292); color: #fff; text-align: center; padding: 12px 20px; font-weight: 600; font-size: 0.95rem; }

/* ── SUCCESS / STAMP ── */
.success-icon { font-size: 4rem; margin-bottom: 12px; text-align: center; }
.text-center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 0.82rem; }

/* ── QR CODE PRINT CARD ── */
.qr-print-card { text-align: center; padding: 2rem; border-radius: 16px; }
.qr-business-name { font-size: 1.8rem; font-weight: 800; color: var(--dark); margin-bottom: 0.25rem; }
.qr-tagline { color: var(--muted); font-size: 0.95rem; margin-bottom: 1.5rem; }
.qr-image-wrap { display: flex; justify-content: center; margin-bottom: 1.25rem; }
.qr-img { width: 240px; height: 240px; border: 4px solid var(--border); border-radius: 12px; }
.qr-kiwi-brand { font-size: 1rem; font-weight: 700; color: var(--primary); margin-bottom: 0.25rem; }
.qr-url { font-size: 0.72rem; color: var(--muted); word-break: break-all; }

/* ── CHECKIN FLOW ── */
.checkin-banner { background: #e8f5e9; border: 1.5px solid var(--primary); border-radius: 10px; padding: 0.75rem 1rem; margin-bottom: 1.25rem; text-align: center; }
.checkin-progress-section { background: var(--bg); border-radius: 12px; padding: 1rem; margin-top: 1.25rem; text-align: left; }
.checkin-reward-box { background: linear-gradient(135deg, #4caf50, #2e7d32); color: #fff; border-radius: 14px; padding: 1.25rem; margin: 1rem 0; }

/* ── STAFF BADGE ── */
.staff-badge { background: #e3f2fd; color: #1565c0; font-size: 0.78rem; font-weight: 700; padding: 3px 10px; border-radius: 20px; border: 1.5px solid #90caf9; }

/* ── PERMISSION FORM STYLES ── */
.form-section h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.25rem; }
.perm-group { display: flex; flex-direction: column; gap: 0; border: 1.5px solid var(--border); border-radius: 10px; overflow: hidden; }
.perm-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.perm-row:last-child { border-bottom: none; }
.perm-row:hover { background: #f9fbe7; }
.perm-info p { font-size: 0.8rem; color: var(--muted); margin-top: 2px; }
.perm-toggle { width: 20px; height: 20px; accent-color: var(--primary); cursor: pointer; flex-shrink: 0; }
.perm-tag { background: #e8f5e9; color: #2e7d32; font-size: 0.72rem; font-weight: 600; padding: 2px 8px; border-radius: 20px; border: 1px solid #a5d6a7; white-space: nowrap; }
.perm-presets { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }

/* ── CUSTOMER AVATAR ── */
.cust-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border); flex-shrink: 0; }
.cust-avatar-initials { width: 40px; height: 40px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 1.1rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* ── PROFILE AVATAR UPLOAD ── */
.avatar-upload-section { display: flex; align-items: center; gap: 1.25rem; margin-bottom: 1.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.avatar-preview-wrap { flex-shrink: 0; }
.avatar-preview { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 3px solid var(--primary); }
.avatar-initials { width: 80px; height: 80px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 2rem; font-weight: 800; display: flex; align-items: center; justify-content: center; border: 3px solid var(--primary); }
.hidden { display: none !important; }

/* ── LOGIN ATTEMPTS / PASSWORD RESET ── */
.attempt-warning { background: #fff3e0; border: 1.5px solid #ffb300; border-radius: 8px; padding: 10px 14px; font-size: 0.85rem; color: #e65100; margin-bottom: 1rem; }
.forgot-link { color: var(--muted); font-size: 0.85rem; text-decoration: underline dotted; }
.forgot-link:hover { color: var(--primary); }
.remember-row { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; color: var(--muted); cursor: pointer; margin: 0.5rem 0; font-weight: 400; }
.remember-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); }
.reset-hint-box { background: #e8f5e9; border: 1.5px solid var(--primary); border-radius: 10px; padding: 0.75rem 1rem; margin-bottom: 1.25rem; text-align: center; }
.masked-email { font-size: 1.1rem; font-weight: 700; color: var(--dark); letter-spacing: 0.5px; margin: 4px 0; }

/* ── CARD WATERMARK ── */
.loyalty-card { position: relative; overflow: hidden; }
.card-watermark { position: absolute; right: -8px; bottom: -14px; font-size: 4.5rem; opacity: 0.13; line-height: 1; pointer-events: none; user-select: none; transform: rotate(-8deg); }
.phone-card { position: relative; overflow: hidden; }
.phone-card-watermark { position: absolute; right: -4px; bottom: -10px; font-size: 3.5rem; opacity: 0.18; pointer-events: none; user-select: none; transform: rotate(-8deg); }

/* ── STAMP EMOJI ── */
.stamp-dot { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.stamp-emoji { font-size: 0.85rem; line-height: 1; }
.stamp-dot.filled .stamp-emoji, .stamp-dot.filled-preview .stamp-emoji { display: inline-flex; }

/* ── CARD PREVIEW STRIP ── */
.card-preview-strip { border-radius: 12px; padding: 16px 20px; margin-bottom: 20px; position: relative; overflow: hidden; display: flex; align-items: center; gap: 20px; }
.card-preview-strip .card-watermark { font-size: 5rem; bottom: -18px; right: -6px; }
.card-preview-info { display: flex; align-items: center; gap: 10px; }
.stamp-track.compact { gap: 4px; }
.stamp-track.compact .stamp-dot { width: 16px; height: 16px; }

/* ── CARD DESIGNER LAYOUT ── */
.designer-layout { display: grid; grid-template-columns: 1fr 340px; gap: 32px; align-items: start; max-width: 1100px; margin: 0 auto; }
@media (max-width: 800px) { .designer-layout { grid-template-columns: 1fr; } }

.designer-form { background: var(--white); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.designer-form h2 { color: var(--kiwi-dark); margin-bottom: 6px; }

.designer-section { margin-bottom: 22px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.designer-section:last-of-type { border-bottom: none; margin-bottom: 0; }
.designer-section-title { font-size: 0.9rem; font-weight: 700; color: var(--kiwi-dark); margin: 0 0 12px; }

/* Color pickers */
.color-pair { display: flex; gap: 20px; }
.color-pick-wrap { display: flex; flex-direction: column; gap: 6px; }
.color-pick-wrap input[type=color] { width: 80px; height: 46px; padding: 3px; border-radius: 8px; border: 1.5px solid var(--border); cursor: pointer; }

/* Toggle buttons (bg style, pattern) */
.toggle-group { display: flex; gap: 10px; flex-wrap: wrap; }
.toggle-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 10px 18px; border-radius: 10px; border: 2px solid var(--border); cursor: pointer; background: #fafafa; transition: border-color 0.15s, background 0.15s; font-size: 0.8rem; color: var(--muted); min-width: 72px; }
.toggle-btn input[type=radio] { display: none; }
.toggle-btn span { font-size: 1.3rem; }
.toggle-btn small { font-size: 0.75rem; font-weight: 600; }
.toggle-btn.active, .toggle-btn:hover { border-color: var(--green); background: #e8f5e9; color: var(--kiwi-dark); }

/* Icon grid */
.icon-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
@media (max-width: 600px) { .icon-grid { grid-template-columns: repeat(6, 1fr); } }
.icon-btn { background: #fafafa; border: 2px solid var(--border); border-radius: 8px; padding: 7px 4px; font-size: 1.3rem; cursor: pointer; text-align: center; transition: border-color 0.12s, background 0.12s, transform 0.1s; line-height: 1; }
.icon-btn:hover { border-color: var(--green); background: #e8f5e9; transform: scale(1.1); }
.icon-btn.selected { border-color: var(--green); background: #c8e6c9; transform: scale(1.12); box-shadow: 0 0 0 2px var(--green); }

/* Preview column */
.designer-preview-col { position: sticky; top: 80px; }
.designer-preview-sticky { background: var(--white); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.preview-label { font-size: 0.82rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 14px; text-align: center; }
.preview-card-wrap { margin-bottom: 16px; }
.preview-card { pointer-events: none; }
.preview-legend { font-size: 0.8rem; color: var(--muted); display: flex; align-items: center; gap: 8px; justify-content: center; }
.stamp-dot.filled-preview { background: rgba(255,255,255,0.85); border-color: rgba(255,255,255,0.9); }

/* ── QR CODE DISPLAY ── */
.qr-wrap { cursor: pointer; position: relative; background: #fff; border-radius: 12px; padding: 12px; border: 2px solid var(--border); display: inline-block; width: 100%; box-sizing: border-box; transition: border-color 0.15s, box-shadow 0.15s; }
.qr-wrap:hover { border-color: var(--green); box-shadow: 0 0 0 3px #c8e6c9; }
.qr-img { width: 100%; max-width: 220px; display: block; margin: 0 auto; }
.qr-tap-hint { text-align: center; font-size: 0.75rem; color: var(--muted); margin-top: 6px; }

/* Fullscreen QR overlay */
.qr-fullscreen { position: fixed; inset: 0; z-index: 9999; background: #fff; display: flex; align-items: center; justify-content: center; flex-direction: column; }
.qr-fullscreen.hidden { display: none; }
.qr-fs-inner { text-align: center; padding: 24px; max-width: 420px; width: 100%; }
.qr-fs-card-label { display: flex; flex-direction: column; margin-bottom: 20px; font-size: 1rem; font-weight: 700; color: var(--kiwi-dark); }
.qr-fs-card-label .muted { font-weight: 400; font-size: 0.85rem; }
.qr-fs-img-wrap { background: #fff; border-radius: 16px; padding: 16px; box-shadow: 0 4px 24px rgba(0,0,0,0.12); display: inline-block; }
.qr-fs-img { width: min(70vw, 300px); height: auto; }
.qr-fs-hint { font-size: 1.1rem; font-weight: 700; color: var(--dark); margin: 16px 0 4px; }
.qr-fs-sub { font-size: 0.8rem; }

/* ── BUSINESS QR SCANNER ── */
.scanner-page { max-width: 700px; margin: 0 auto; }
.scanner-header { margin-bottom: 20px; }
.scanner-wrap { position: relative; border-radius: 16px; overflow: hidden; background: #000; aspect-ratio: 4/3; max-height: 420px; }
.scanner-wrap video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanner-overlay { position: absolute; inset: 0; pointer-events: none; display: flex; align-items: center; justify-content: center; }
.scanner-target { width: 220px; height: 220px; border: 3px solid #4caf50; border-radius: 16px; box-shadow: 0 0 0 9999px rgba(0,0,0,0.42); animation: scanner-pulse 2s ease-in-out infinite; }
@keyframes scanner-pulse { 0%, 100% { border-color: #4caf50; box-shadow: 0 0 0 9999px rgba(0,0,0,0.42), 0 0 0 2px #4caf5040; } 50% { border-color: #81c784; box-shadow: 0 0 0 9999px rgba(0,0,0,0.38), 0 0 0 6px #4caf5030; } }
.scanner-status { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(0,0,0,0.6); color: #fff; padding: 10px 16px; display: flex; align-items: center; gap: 8px; font-size: 0.88rem; }
.scanner-dot { width: 10px; height: 10px; border-radius: 50%; background: #666; flex-shrink: 0; }
.scanner-dot.active { background: #4caf50; animation: blink 1.2s ease-in-out infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.scanner-found { text-align: center; padding: 40px 20px; }
.scanner-found .found-icon { font-size: 3.5rem; }
.scanner-found p { font-size: 1.1rem; color: var(--kiwi-dark); margin-top: 12px; }
.scanner-fallback { margin: 20px 0; }
.scanner-tips { margin-top: 20px; }
.scanner-tips ul { padding-left: 18px; }
.scanner-tips li { margin-bottom: 6px; font-size: 0.9rem; color: var(--text); }

/* Scan button */
.btn-scan { background: #0288d1; color: #fff; border: none; font-weight: 700; }
.btn-scan:hover { background: #0277bd; color: #fff; }

/* Stamp confirmation page */
.stamp-confirm-page { max-width: 520px; margin: 0 auto; }
.stamp-confirm-card { background: #fff; border-radius: 16px; box-shadow: var(--shadow); padding: 24px; }
.stamp-customer-row { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.stamp-cust-avatar { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; flex-shrink: 0; font-size: 1rem; }
.stamp-cust-name { font-weight: 700; font-size: 1.05rem; }
.stamp-cust-sub { font-size: 0.82rem; color: var(--muted); }
.stamp-preview-card { margin: 0 0 16px; pointer-events: none; }
.stamp-outcome { display: flex; align-items: center; gap: 14px; background: #f5f5f5; border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; }
.stamp-outcome.reward { background: #fff9e6; border: 1.5px solid #ffb300; }
.stamp-outcome.normal { background: #e8f5e9; border: 1.5px solid #a5d6a7; }
.outcome-icon { font-size: 1.8rem; flex-shrink: 0; }
.stamp-confirm-btn { padding: 14px; font-size: 1.1rem; font-weight: 800; }

/* Scan action tile highlight */
.action-tile-scan { border-color: #0288d1 !important; }
.action-tile-scan div { font-size: 1.8rem; }
.action-tile-scan:hover { background: #e3f2fd; border-color: #0277bd !important; }

/* ── PWA INSTALL BANNER ── */
.install-banner { position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000; background: #fff; border-top: 1.5px solid var(--border); box-shadow: 0 -4px 24px rgba(0,0,0,0.10); padding: 12px 16px; }
.install-banner.hidden { display: none; }
.install-banner-inner { display: flex; align-items: center; gap: 12px; max-width: 600px; margin: 0 auto; }
.install-icon { width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0; }
.install-text { flex: 1; display: flex; flex-direction: column; }
.install-text strong { font-size: 0.9rem; color: var(--dark); }
.install-text span { font-size: 0.78rem; color: var(--muted); }
.install-dismiss { background: none; border: none; font-size: 1.1rem; color: var(--muted); cursor: pointer; padding: 4px 8px; flex-shrink: 0; }
.install-dismiss:hover { color: var(--dark); }

/* Safe area padding for notched phones */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .install-banner { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  footer { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
}

/* Period filter tabs — analytics */
.period-tabs { display: flex; gap: 4px; }
.period-tab { padding: 5px 14px; border-radius: 20px; font-size: 0.82rem; font-weight: 600; text-decoration: none; color: var(--muted); background: #f0f4f0; border: 1.5px solid transparent; transition: all 0.15s; }
.period-tab:hover { background: #e8f5e9; color: var(--kiwi-dark); }
.period-tab.active { background: var(--kiwi-dark); color: #fff; border-color: var(--kiwi-dark); }

/* Campaign send channel selector */
.send-campaign-form { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.send-channels { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.channel-opt { display:flex; align-items:center; gap:5px; padding:5px 10px; border-radius:20px; border:1.5px solid #c8e6c9; background:#f9fff9; font-size:0.82rem; font-weight:600; cursor:pointer; transition:border-color 0.15s, background 0.15s; user-select:none; }
.channel-opt:hover:not(.channel-opt-disabled) { border-color:#4CAF50; background:#e8f5e9; }
.channel-opt input[type=checkbox] { accent-color:#4CAF50; width:14px; height:14px; margin:0; }
.channel-opt-always { background:#e8f5e9; border-color:#4CAF50; color:#2e7d32; cursor:default; }
.channel-opt-disabled { opacity:0.5; cursor:not-allowed; }
.channel-icon { font-size:14px; }
.channel-badge { background:#fff3e0; color:#e65100; font-size:0.72rem; padding:1px 6px; border-radius:10px; font-weight:700; }

/* Plan upgrade banner */
.plan-upgrade-banner { display:flex; align-items:flex-start; gap:12px; background:#fff8e1; border-left:4px solid #f9a825; border-radius:8px; padding:14px 16px; margin-bottom:16px; font-size:0.88rem; color:#5d4037; }
.plan-upgrade-icon { font-size:20px; flex-shrink:0; margin-top:1px; }
.alert-info-banner { background:#e8f5e9; border-left:4px solid #4CAF50; border-radius:8px; padding:12px 16px; margin-bottom:16px; font-size:0.88rem; color:#1b5e20; }
.channel-opt-locked { opacity:0.55; cursor:default; }
.pro-badge { background:#6a1b9a; color:#fff; font-size:0.72rem; padding:1px 6px; border-radius:10px; font-weight:700; }
