@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@500;600;700;800&display=swap');

: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;
  --font-body: "DM Sans", "Segoe UI", sans-serif;
  --font-display: "Manrope", "DM Sans", sans-serif;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --focus-ring: rgba(76, 175, 80, 0.22);
}
* { 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; }
.brand { display: inline-flex; align-items: center; gap: 9px; flex: 0 0 auto; white-space: nowrap; }
.viro-brand-logo { display: block; flex: 0 0 auto; height: auto; object-fit: contain; }
.viro-brand-logo-nav { width: 42px; height: 42px; border-radius: 50%; }
.viro-brand-logo-admin { width: 44px; height: 44px; border-radius: 50%; }
.viro-brand-logo-form { width: 112px; height: 112px; border-radius: 50%; margin: 0 auto 16px; }
.viro-brand-logo-hero { width: min(220px, 54vw); height: auto; border-radius: 50%; margin: 0 auto 22px; }
.viro-brand-logo-qr { width: 132px; height: auto; border-radius: 50%; margin: 0 auto 8px; }
.viro-brand-logo-wallet { width: 54px; height: 54px; border-radius: 50%; }
.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; flex-wrap: wrap; }
  .brand { font-size: 1.05rem; }
  .nav-links { gap: 6px; flex-wrap: wrap; max-width: 100%; }
  .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: 16px 20px; font-size: 1.1rem; font-weight: 800; color: #8BC34A; border-bottom: 1px solid rgba(255,255,255,0.1); display: flex; align-items: center; gap: 10px; }
.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 > .viro-brand-logo-form { margin-top: 0; }
.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; }
.customer-card-item { min-width: 0; }
.customer-card-item .loyalty-card-link { display: block; }
.card-website-link { display: inline-block; margin: 9px 4px 0; font-size: 0.85rem; font-weight: 600; }
.card-website-on-card { display: inline-block; margin-top: 12px; padding: 6px 10px; border-radius: 8px; background: rgba(255,255,255,0.83); color: #1a2a1a; font-size: 0.83rem; font-weight: 700; text-decoration: underline; }
.card-website-on-card:hover { color: #1b5e20; }
.card-website-on-card[hidden] { display: none; }

/* ── 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-brand { display: flex; align-items: center; gap: 8px; min-height: 54px; margin-bottom: 10px; opacity: 1; font-weight: 700; }
.phone-card-brand .viro-brand-logo-wallet { width: 48px; height: 48px; }
.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-kiwi-brand { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.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; }

/* ── VIRO refinement: clear type, calm surfaces, dependable controls ── */
html { color-scheme: light; }
body {
  font-family: var(--font-body);
  line-height: 1.55;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, .brand, .admin-brand, .stat-val, .wallet-val {
  font-family: var(--font-display);
  letter-spacing: -0.025em;
}
h1, h2, h3, h4 { line-height: 1.22; }
button, input, select, textarea { font: inherit; }
img { max-width: 100%; }
a, button, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 3px;
  box-shadow: 0 0 0 5px var(--focus-ring);
}

.navbar {
  background: var(--surface);
  box-shadow: 0 3px 16px rgba(25, 55, 30, 0.055);
}
.brand { letter-spacing: -0.04em; }
.nav-links a { transition: color .16s ease, background .16s ease; }
.nav-links a:not(.btn):hover { color: var(--green-dark); text-decoration: none; }
.btn { box-shadow: 0 1px 2px rgba(20, 45, 24, .08); }
.btn-primary, .btn-success { background: var(--green-dark); }
.btn-primary:hover, .btn-success:hover { background: #2f7834; opacity: 1; }
.btn-outline { border-width: 1.5px; }

.container { width: 100%; }
.page-header h1 { font-weight: 800; }
.subtitle, .muted, .muted-sm { line-height: 1.5; }
.panel, .stat-card, .feature-card, .step, .form-card, .designer-form,
.designer-preview-sticky, .mini-stat, .wallet-option, .notif-item, .campaign-card {
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--border) 76%, transparent);
}
.panel, .stat-card, .form-card, .designer-form, .designer-preview-sticky {
  box-shadow: var(--shadow);
}
.panel h3, .form-card h2, .form-logo, .designer-form h2,
.designer-section-title, .features-section h2, .how-section h2 {
  color: var(--kiwi-dark);
}
.stat-card { text-align: left; }
.stat-grid .stat-card { min-height: 132px; }
.stat-val { font-variant-numeric: tabular-nums; }
.quick-actions { gap: 10px; }
.action-tile { min-height: 92px; }
.action-tile:hover { color: var(--green-dark); transform: translateY(-1px); }

/* Image presentation: protect intrinsic proportions and give uploads a finished edge */
.cust-avatar, .stamp-cust-avatar, .avatar-preview, .install-icon {
  object-fit: cover;
  background: var(--green-light);
}
.cust-avatar, .stamp-cust-avatar { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--border); }
.avatar-preview { box-shadow: 0 4px 16px rgba(24, 54, 28, .12); }
.avatar-initials, .cust-avatar-initials {
  background: linear-gradient(145deg, var(--green), var(--kiwi-dark));
}
.qr-img, .qr-fs-img {
  object-fit: contain;
  image-rendering: crisp-edges;
}
.qr-wrap, .qr-fs-img-wrap {
  background: #fff;
  box-shadow: 0 8px 28px rgba(25, 50, 28, .09);
}
.qr-img { border-radius: 6px; }
.loyalty-card {
  box-shadow: 0 5px 16px rgba(24, 49, 25, .09);
  background-image: linear-gradient(135deg,
    color-mix(in srgb, var(--card-color, #4CAF50) 13%, #fff),
    color-mix(in srgb, var(--card-color, #4CAF50) 29%, #f7faf6));
}
.card-name { font-family: var(--font-display); letter-spacing: -.02em; }
.stamp-dot, .stamp-mini-dot { flex-shrink: 0; }
.points-wallet { box-shadow: 0 12px 26px rgba(32, 102, 40, .2); }

.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, .filter-bar input, .filter-bar select,
.select-sm, .input-sm {
  color: var(--text);
  background: var(--bg);
}
.form-card input::placeholder, .form-card textarea::placeholder { color: var(--muted); opacity: .82; }
.form-card input:focus, .form-card select:focus, .form-card textarea:focus {
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.data-table th { white-space: nowrap; }
.data-table tr:hover td { background: color-mix(in srgb, var(--green-light) 55%, var(--surface)); }
.table-scroll { scrollbar-color: var(--kiwi) var(--bg); }
.empty-state { color: var(--text); }
.alert, .reward-alert, .wallet-note, .attempt-warning, .reset-hint-box,
.checkin-banner, .plan-upgrade-banner, .alert-info-banner { line-height: 1.5; }
.admin-sidebar {
  background: #1d301f;
  box-shadow: 5px 0 24px rgba(15, 34, 17, .12);
}
.admin-brand { font-family: var(--font-display); letter-spacing: -.03em; }
.admin-nav a { min-height: 46px; display: flex; align-items: center; }
.admin-nav a:hover, .admin-nav a.active { background: rgba(139,195,74,.13); }
.admin-main { min-width: 0; }
.scanner-wrap { box-shadow: 0 12px 30px rgba(16, 32, 18, .18); }
.scanner-target { border-radius: 14px; }
.qr-fullscreen { background: #f7faf7; }
.stamp-confirm-card { background: var(--surface); }
.install-banner { background: var(--surface); }
.period-tab { background: var(--bg); }
.channel-opt { color: var(--text); }

/* Responsive navigation stays usable without changing its semantic structure. */
@media (max-width: 900px) {
  .navbar { align-items: flex-start; }
  .nav-links {
    max-width: calc(100vw - 180px);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    white-space: nowrap;
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .admin-main { padding: 26px 22px; }
}
@media (max-width: 640px) {
  .navbar { align-items: center; }
  .brand { gap: 6px; font-size: .98rem; }
  .viro-brand-logo-nav { width: 36px; height: 36px; }
  .nav-links { max-width: calc(100vw - 180px); gap: 10px; }
  .nav-links a { flex-shrink: 0; }
  .container { padding: 24px 16px; }
  .hero { padding: 52px 18px 42px; }
  .hero h1 { font-size: clamp(2.25rem, 11vw, 3.2rem); }
  .page-header { align-items: stretch; }
  .page-header > div:last-child { justify-content: flex-start; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat-card { padding: 16px; }
  .stat-val { font-size: 1.7rem; }
  .quick-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .points-wallet { gap: 14px; padding: 18px; flex-wrap: wrap; }
  .card-preview-strip { flex-wrap: wrap; gap: 12px; }
  .designer-form { padding: 22px 18px; }
}
@media (max-width: 760px) {
  .admin-sidebar {
    position: sticky;
    top: 0;
    width: 100%;
    height: auto;
    min-height: 0;
    z-index: 200;
  }
  .admin-layout { flex-direction: column; }
  .admin-brand { padding: 12px 16px; }
  .admin-nav {
    display: flex;
    overflow-x: auto;
    padding: 4px 8px 8px;
    gap: 2px;
    scrollbar-width: thin;
  }
  .admin-nav a {
    flex: 0 0 auto;
    padding: 9px 12px;
    min-height: 42px;
    border-left: 0;
    border-bottom: 2px solid transparent;
    border-radius: 8px;
    font-size: .82rem;
    white-space: nowrap;
  }
  .admin-nav a:hover, .admin-nav a.active { border-bottom-color: #8BC34A; }
  .admin-nav .logout-link { margin-top: 0; }
  .admin-main { margin-left: 0; max-width: 100%; padding: 22px 16px; }
}
@media (max-width: 420px) {
  .nav-links { max-width: calc(100vw - 105px); gap: 7px; }
  .nav-links a { font-size: .78rem; }
  .nav-links .btn-sm { padding: 7px 9px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .stat-label { font-size: .76rem; }
  .wallet-val { font-size: 1.7rem; }
}

/* ── Dark theme: cool forest surfaces, soft text, preserved VIRO green ── */
html[data-theme="dark"] {
  color-scheme: dark;
  --text: #e5eee5;
  --muted: #a9b8aa;
  --border: #344638;
  --bg: #121a14;
  --white: #1c281f;
  --surface: #1c281f;
  --surface-raised: #223126;
  --green: #78c77d;
  --green-dark: #91d596;
  --green-light: #263b2a;
  --kiwi: #9bcf63;
  --kiwi-dark: #acd879;
  --shadow: 0 3px 14px rgba(0, 0, 0, .2);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, .3);
  --focus-ring: rgba(120, 199, 125, .24);
  background: var(--bg);
}
html[data-theme="dark"] body { background: var(--bg); color: var(--text); }
html[data-theme="dark"] a { color: #a9dfa9; }
html[data-theme="dark"] .navbar,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .feature-card,
html[data-theme="dark"] .step,
html[data-theme="dark"] .form-card,
html[data-theme="dark"] .designer-form,
html[data-theme="dark"] .designer-preview-sticky,
html[data-theme="dark"] .mini-stat,
html[data-theme="dark"] .wallet-option,
html[data-theme="dark"] .notif-item,
html[data-theme="dark"] .campaign-card,
html[data-theme="dark"] .stamp-confirm-card,
html[data-theme="dark"] .install-banner {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}
html[data-theme="dark"] .navbar { box-shadow: 0 3px 16px rgba(0,0,0,.2); }
html[data-theme="dark"] .brand,
html[data-theme="dark"] .page-header h1,
html[data-theme="dark"] .panel h3,
html[data-theme="dark"] .form-card h2,
html[data-theme="dark"] .form-logo,
html[data-theme="dark"] .designer-form h2,
html[data-theme="dark"] .designer-section-title,
html[data-theme="dark"] .features-section h2,
html[data-theme="dark"] .how-section h2,
html[data-theme="dark"] .mini-stat-val,
html[data-theme="dark"] .stat-val,
html[data-theme="dark"] .reward-highlight { color: var(--kiwi-dark); }
html[data-theme="dark"] .nav-links a { color: var(--text); }
html[data-theme="dark"] .nav-links a:not(.btn):hover { color: var(--kiwi-dark); }
html[data-theme="dark"] footer { border-color: var(--border); }
html[data-theme="dark"] .admin-sidebar { background: #101a13; }
html[data-theme="dark"] .admin-main { color: var(--text); }
html[data-theme="dark"] .admin-nav a { color: #bdcbbd; }
html[data-theme="dark"] .admin-nav a:hover,
html[data-theme="dark"] .admin-nav a.active { color: #b6e487; background: rgba(139,195,74,.14); }
html[data-theme="dark"] .form-card input[type=text],
html[data-theme="dark"] .form-card input[type=email],
html[data-theme="dark"] .form-card input[type=password],
html[data-theme="dark"] .form-card input[type=tel],
html[data-theme="dark"] .form-card input[type=number],
html[data-theme="dark"] .form-card input[type=date],
html[data-theme="dark"] .form-card input[type=datetime-local],
html[data-theme="dark"] .form-card select,
html[data-theme="dark"] .form-card textarea,
html[data-theme="dark"] .filter-bar input,
html[data-theme="dark"] .filter-bar select,
html[data-theme="dark"] .select-sm,
html[data-theme="dark"] .input-sm {
  color: var(--text);
  background: #142017;
  border-color: var(--border);
}
html[data-theme="dark"] .form-card input:focus,
html[data-theme="dark"] .form-card select:focus,
html[data-theme="dark"] .form-card textarea:focus { background: #18251b; }
html[data-theme="dark"] select option { color: var(--text); background: var(--surface); }
html[data-theme="dark"] .data-table th { color: #b7c6b8; border-color: var(--border); }
html[data-theme="dark"] .data-table td { border-color: var(--border); }
html[data-theme="dark"] .data-table tr:hover td { background: #26372a; }
html[data-theme="dark"] .stamp-review-grid,
html[data-theme="dark"] .action-tile,
html[data-theme="dark"] .checkin-progress-section,
html[data-theme="dark"] .period-tab { background: #17231a; }
html[data-theme="dark"] .action-tile { border-color: var(--border); color: var(--text); }
html[data-theme="dark"] .action-tile:hover,
html[data-theme="dark"] .toggle-btn.active,
html[data-theme="dark"] .toggle-btn:hover { background: #263b2a; border-color: var(--green); color: #c2e99a; }
html[data-theme="dark"] .alert-success { background: #1c3924; color: #c4ebc5; border-left-color: #78c77d; }
html[data-theme="dark"] .alert-error { background: #402426; color: #ffc4c2; border-left-color: #ed8179; }
html[data-theme="dark"] .alert-info { background: #1e3340; color: #c1e5f7; border-left-color: #74b8da; }
html[data-theme="dark"] .badge-green, html[data-theme="dark"] .perm-tag { background: #24402a; color: #c1e9bf; border-color: #47744d; }
html[data-theme="dark"] .badge-red { background: #45282b; color: #ffd0cc; }
html[data-theme="dark"] .badge-grey { background: #303b32; color: #d3ddd3; }
html[data-theme="dark"] .badge-orange { background: #49371f; color: #ffda9c; }
html[data-theme="dark"] .badge-purple { background: #3b2b43; color: #e6c5f3; }
html[data-theme="dark"] .loyalty-card {
  background-image: linear-gradient(135deg,
    color-mix(in srgb, var(--card-color, #4CAF50) 36%, #1a281d),
    color-mix(in srgb, var(--card-color, #4CAF50) 47%, #26342a));
  border-color: color-mix(in srgb, var(--card-color, #4CAF50) 68%, #243329);
}
html[data-theme="dark"] .card-name { color: #f0f6ed; }
html[data-theme="dark"] .business-label,
html[data-theme="dark"] .loyalty-card-footer,
html[data-theme="dark"] .stamp-more { color: #d0ddcf; }
html[data-theme="dark"] .card-website-on-card { background: rgba(18, 30, 20, .9); color: #e5eee5; }
html[data-theme="dark"] .stamp-dot { background: rgba(17, 29, 19, .58); border-color: rgba(225, 240, 225, .3); }
html[data-theme="dark"] .stamp-mini-dot { background: #344638; border-color: #536656; }
html[data-theme="dark"] .progress-bar-wrap { background: rgba(230,245,230,.16); }
html[data-theme="dark"] .qr-wrap { background: #f9fbf8; border-color: var(--border); }
html[data-theme="dark"] .qr-fullscreen { background: #131c15; }
html[data-theme="dark"] .qr-fs-img-wrap { background: #fff; }
html[data-theme="dark"] .qr-fs-card-label, html[data-theme="dark"] .qr-fs-hint { color: #d9edcf; }
html[data-theme="dark"] .reward-alert { background: #40361f; border-color: #9c7931; color: #f5e6b7; }
html[data-theme="dark"] .reward-alert h3 { color: #ffd27b; }
html[data-theme="dark"] .wallet-note { background: #40361f; border-color: #9c7931; color: #f0dfa9; }
html[data-theme="dark"] .attempt-warning,
html[data-theme="dark"] .plan-upgrade-banner { background: #40331f; border-color: #967331; color: #f4d69a; }
html[data-theme="dark"] .reset-hint-box,
html[data-theme="dark"] .checkin-banner,
html[data-theme="dark"] .alert-info-banner { background: #203827; color: #c8ebc9; border-color: #527e56; }
html[data-theme="dark"] .staff-badge { background: #203744; color: #c8e9f8; border-color: #4b7488; }
html[data-theme="dark"] .perm-group { border-color: var(--border); }
html[data-theme="dark"] .perm-row { border-color: var(--border); }
html[data-theme="dark"] .perm-row:hover { background: #26372a; }
html[data-theme="dark"] .toggle-btn,
html[data-theme="dark"] .icon-btn { background: #17231a; color: var(--text); border-color: var(--border); }
html[data-theme="dark"] .icon-btn.selected { background: #31482f; }
html[data-theme="dark"] .stamp-outcome { background: #29342b; }
html[data-theme="dark"] .stamp-outcome.reward { background: #40361f; border-color: #967331; }
html[data-theme="dark"] .stamp-outcome.normal { background: #203827; border-color: #527e56; }
html[data-theme="dark"] .channel-opt { background: #1c2c20; border-color: #3d6642; }
html[data-theme="dark"] .channel-opt:hover:not(.channel-opt-disabled),
html[data-theme="dark"] .channel-opt-always { background: #263d2b; color: #d0efd0; }
html[data-theme="dark"] .channel-badge { background: #40331f; color: #f4d69a; }
html[data-theme="dark"] .period-tab:hover { background: #263b2a; color: #d0efb4; }
html[data-theme="dark"] .period-tab.active { background: #4d7d3d; border-color: #4d7d3d; color: #fff; }
html[data-theme="dark"] .campaign-discount { color: #ffc678; }
html[data-theme="dark"] .link-more { color: #a9dfa9; }
html[data-theme="dark"] .qr-business-name,
html[data-theme="dark"] .masked-email,
html[data-theme="dark"] .install-text strong { color: var(--text); }
html[data-theme="dark"] .install-dismiss:hover { color: var(--text); }

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

/* ── Theme controls ── */
.theme-switcher {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface, var(--white));
  color: var(--text);
}
.theme-switcher-label {
  display: block;
  color: var(--muted);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .075em;
  line-height: 1.25;
  text-transform: uppercase;
}
.theme-choices {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
}
.theme-choice {
  flex: 1 1 0;
  min-width: 0;
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font: 600 .82rem/1.2 var(--font-body, sans-serif);
  text-align: center;
  cursor: pointer;
  transition: color .15s ease, background-color .15s ease, border-color .15s ease;
}
.theme-choice:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--green-light) 72%, var(--surface, #fff));
}
.theme-choice.active {
  color: var(--green-dark);
  background: var(--surface, var(--white));
  border-color: color-mix(in srgb, var(--green) 35%, var(--border));
  box-shadow: 0 1px 3px rgba(25, 55, 30, .1);
}
.theme-choice:focus-visible {
  position: relative;
  z-index: 1;
  outline: 3px solid var(--green);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px var(--focus-ring);
}
.dashboard-appearance,
.profile-appearance {
  min-width: 0;
  margin: 0 0 20px;
}
.profile-appearance {
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.admin-sidebar .theme-switcher {
  margin: 0 12px 14px;
  border-color: rgba(255,255,255,.15);
  background: rgba(255,255,255,.055);
  color: #f1f6ef;
}
.admin-sidebar .theme-switcher-label { color: #c0d0bd; }
.admin-sidebar .theme-choices {
  border-color: rgba(255,255,255,.17);
  background: rgba(0,0,0,.18);
}
.admin-sidebar .theme-choice { color: #d2ddd0; }
.admin-sidebar .theme-choice:hover {
  color: #fff;
  background: rgba(139,195,74,.15);
}
.admin-sidebar .theme-choice.active {
  color: #192718;
  background: #a6d66f;
  border-color: #a6d66f;
}
.admin-sidebar .theme-choice:focus-visible {
  outline-color: #b7e884;
  box-shadow: 0 0 0 5px rgba(183,232,132,.24);
}

/* Compact customer shortcuts stay in document flow, never over the wallet. */
.customer-quick-nav { display: none; }

@media (max-width: 640px) {
  .theme-switcher { padding: 10px; }
  .theme-choice { padding-inline: 6px; font-size: .78rem; }
  .dashboard-appearance,
  .profile-appearance { margin-bottom: 16px; }
  .customer-quick-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
    min-width: 0;
    margin: 0 0 18px;
    padding: 5px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--surface, var(--white));
    box-shadow: var(--shadow);
  }
  .customer-quick-nav a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 42px;
    padding: 7px 5px;
    border: 1px solid transparent;
    border-radius: 9px;
    color: var(--muted);
    font-size: .8rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    overflow-wrap: anywhere;
  }
  .customer-quick-nav a:hover {
    color: var(--green-dark);
    background: var(--green-light);
    text-decoration: none;
  }
  .customer-quick-nav a[aria-current="page"] {
    color: var(--green-dark);
    background: var(--green-light);
    border-color: color-mix(in srgb, var(--green) 38%, var(--border));
  }
  .customer-quick-nav a:focus-visible {
    position: relative;
    z-index: 1;
    outline: 3px solid var(--green);
    outline-offset: 1px;
    box-shadow: 0 0 0 4px var(--focus-ring);
  }
}

html[data-theme="dark"] .theme-switcher {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
}
html[data-theme="dark"] .theme-switcher-label { color: #b8c8b9; }
html[data-theme="dark"] .theme-choices {
  background: #142017;
  border-color: var(--border);
}
html[data-theme="dark"] .theme-choice { color: #b8c8b9; }
html[data-theme="dark"] .theme-choice:hover {
  color: #e8f3e6;
  background: #263b2a;
}
html[data-theme="dark"] .theme-choice.active {
  color: #e4f4d5;
  background: #2d4931;
  border-color: #5c8a5c;
  box-shadow: 0 1px 4px rgba(0,0,0,.26);
}
html[data-theme="dark"] .theme-choice:focus-visible,
html[data-theme="dark"] .customer-quick-nav a:focus-visible {
  outline-color: #a7de78;
  box-shadow: 0 0 0 5px rgba(167,222,120,.24);
}
html[data-theme="dark"] .admin-sidebar .theme-switcher {
  background: rgba(255,255,255,.055);
  border-color: rgba(255,255,255,.15);
}
html[data-theme="dark"] .customer-quick-nav {
  background: var(--surface);
  border-color: var(--border);
}
html[data-theme="dark"] .customer-quick-nav a { color: #b8c8b9; }
html[data-theme="dark"] .customer-quick-nav a:hover,
html[data-theme="dark"] .customer-quick-nav a[aria-current="page"] {
  color: #d8f0c1;
  background: #263b2a;
  border-color: #4b704c;
}

html[data-theme="dark"] .btn-primary,
html[data-theme="dark"] .btn-success {
  background: #326d3e;
  color: #fff;
}
html[data-theme="dark"] .btn-primary:hover,
html[data-theme="dark"] .btn-success:hover { background: #285b33; }
html[data-theme="dark"] .loyalty-card[style] .loyalty-card-header,
html[data-theme="dark"] .loyalty-card[style] .loyalty-card-footer {
  background: rgba(13, 28, 16, .72);
  border-radius: 8px;
  padding: 6px 8px;
}
html[data-theme="dark"] .loyalty-card[style] .card-name,
html[data-theme="dark"] .loyalty-card[style] .business-label,
html[data-theme="dark"] .loyalty-card[style] .loyalty-card-footer,
html[data-theme="dark"] .loyalty-card[style] .loyalty-card-footer .muted { color: #fff; }

@media (max-width: 640px) {
  .customer-navbar .nav-links { display: none; }
}

/* Date-filtered activity reports */
.report-controls { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-bottom: 22px; }
.report-filter { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; }
.report-filter label { display: grid; gap: 5px; font-size: .82rem; font-weight: 700; color: var(--text); }
.report-filter input { min-height: 42px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; color: var(--text); background: var(--surface); }
.report-filter .btn { min-height: 42px; }
.report-stats { margin-bottom: 22px; }
.report-history > .muted { margin-bottom: 14px; font-size: .88rem; }
.report-table { min-width: 760px; }
.report-table td { overflow-wrap: anywhere; }
