/* Business / phone side — dark, mobile-first, large touch targets */

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

:root {
  --bg: #0a0a0a;
  --surface: #141414;
  --surface2: #1e1e1e;
  --border: #2a2a2a;
  --text: #e0e0e0;
  --text-muted: #888;
  --accent: #6ee7b7;
  --accent2: #818cf8;
  --danger: #f87171;
  --success: #4ade80;
  --warning: #fbbf24;
  --radius: 12px;
}

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
.biz-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.biz-header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 12px 20px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.biz-brand {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}
.biz-header nav {
  display: flex;
  gap: 20px;
  font-size: 0.85rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  white-space: nowrap;
  padding-bottom: 12px;
  scrollbar-width: none;
}
.biz-header nav::-webkit-scrollbar { display: none; }
.biz-header nav a { color: var(--text-muted); flex-shrink: 0; }
.biz-header nav a:hover { color: var(--text); text-decoration: none; }

/* Page */
.biz-page { padding: 14px 20px 20px; max-width: 960px; margin: 0 auto; overscroll-behavior: none; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}
.card-accent { border-color: var(--accent); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  min-height: 52px;
  transition: opacity 0.15s, transform 0.1s;
  text-decoration: none !important;
}
.btn:active { opacity: 0.8; transform: scale(0.98); }
.btn-primary { background: var(--accent); color: #0a0a0a; }
.btn-green { background: var(--success); color: #0a0a0a; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-full { width: 100%; display: flex; }
.btn-lg { padding: 18px 24px; font-size: 1.1rem; min-height: 60px; }

/* Forms */
.form-group { margin-bottom: 16px; }
label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
input[type=text], input[type=email], input[type=password],
input[type=date], input[type=tel], textarea, select {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
  padding: 14px 16px;
  outline: none;
  transition: border-color 0.15s;
  -webkit-appearance: none;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
}
textarea { resize: vertical; min-height: 80px; }
.hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}
.alert-error { background: rgba(248,113,113,0.12); border: 1px solid var(--danger); color: var(--danger); }
.alert-success { background: rgba(74,222,128,0.1); border: 1px solid var(--success); color: var(--success); }

/* Headings */
h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 4px; }
h2 { font-size: 1.2rem; font-weight: 600; margin-bottom: 12px; }
h3 { font-size: 1rem; font-weight: 600; margin-bottom: 8px; }
.page-title { margin-bottom: 20px; }
.page-title .sub { color: var(--text-muted); font-size: 0.9rem; }

/* Campaign cards */
.campaign-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 12px;
  display: block;
  color: var(--text);
  transition: border-color 0.15s;
}
.campaign-card:hover { border-color: var(--accent); text-decoration: none; }
.campaign-card .camp-title { font-weight: 600; font-size: 1.05rem; margin-bottom: 4px; }
.campaign-card .camp-offer { color: var(--accent); font-size: 0.9rem; margin-bottom: 8px; }
.campaign-card .camp-stats { display: flex; gap: 16px; font-size: 0.8rem; color: var(--text-muted); }

/* Code list */
.code-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.code-row:last-child { border-bottom: none; }
[data-code-card].rescinded {
  background: rgba(220,38,38,0.07);
  margin: 0 -16px;
  padding: 0 16px;
}
[data-code-card].rescinded:first-child { border-radius: 12px 12px 0 0; }
[data-code-card].rescinded:last-child  { border-radius: 0 0 12px 12px; }
[data-code-card].rescinded:only-child  { border-radius: 12px; }
.code-row.rescinded-child { background: rgba(220,38,38,0.07); border-radius: 8px; }
.code-row.redeemed-child  { background: rgba(74,222,128,0.07);  border-radius: 8px; }

/* Shared dropdown menus (nav dots, code-row dots, etc.) */
.dropdown-menu {
  display: none;
  position: fixed;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.8);
  min-width: 150px;
  z-index: 9999;
  overflow: hidden;
}
.dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: #eee;
  font-size: 0.875rem;
  font-family: inherit;
  padding: 11px 16px;
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
}
.dropdown-item:hover { background: #2a2a2a; color: #fff; text-decoration: none; }
.dropdown-item.danger { color: #f87171; }
.dropdown-item.danger:hover { background: rgba(248,113,113,0.1); color: #f87171; }
.dropdown-divider { border-top: 1px solid #2a2a2a; margin: 0; }
.code-mono { font-family: monospace; font-size: 0.9rem; color: var(--accent2); }
.badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.badge-used { background: rgba(248,113,113,0.15); color: var(--danger); }
.badge-active { background: rgba(74,222,128,0.12); color: var(--success); }

/* Scan button */
.scan-btn-wrap {
  background: var(--card-bg);
  border: 2px dashed #2a2a2a;
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  transition: border-color 0.2s;
  margin-bottom: 16px;
}
.scan-btn-wrap:hover { border-color: var(--accent); }
.scan-icon { font-size: 3rem; margin-bottom: 12px; }
.scan-label { font-size: 1.1rem; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.scan-sub { font-size: 0.82rem; color: var(--text-muted); }

/* Scanner (legacy, kept for reference) */
.scanner-wrap {
  position: relative;
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  aspect-ratio: 1 / 1;
  margin-bottom: 16px;
}
#scanner-canvas, #scanner-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.scanner-border {
  position: absolute;
  inset: 0;
  border: 3px solid transparent;
  border-radius: var(--radius);
  pointer-events: none;
  transition: border-color 0.2s;
}
.scanner-border.detected { border-color: var(--success); }
.scanner-corner {
  position: absolute;
  width: 30px;
  height: 30px;
  border-color: var(--accent);
  border-style: solid;
  opacity: 0.8;
}
.scanner-corner.tl { top: 12px; left: 12px; border-width: 3px 0 0 3px; }
.scanner-corner.tr { top: 12px; right: 12px; border-width: 3px 3px 0 0; }
.scanner-corner.bl { bottom: 12px; left: 12px; border-width: 0 0 3px 3px; }
.scanner-corner.br { bottom: 12px; right: 12px; border-width: 0 3px 3px 0; }

/* Deal card in scan result */
.deal-card {
  background: var(--surface2);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}
.deal-card .biz-name { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 2px; }
.deal-card .camp-name { font-size: 1.1rem; font-weight: 700; margin-bottom: 14px; }
.deal-card .recipient-name { font-size: 1.25rem; font-weight: 700; color: var(--accent); margin-bottom: 12px; }
.scan-tiers { display: flex; flex-direction: column; gap: 10px; }
.scan-tier {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
}
.scan-tier.accent { border-color: var(--accent); }
.scan-tier.dim { opacity: 0.55; }
.scan-tier-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 4px; }
.scan-tier-value { font-size: 1.05rem; font-weight: 700; color: var(--text); }
.deal-used-banner {
  background: rgba(248,113,113,0.12);
  border: 1px solid var(--danger);
  border-radius: 8px;
  padding: 12px 16px;
  color: var(--danger);
  font-weight: 600;
  margin-bottom: 16px;
  font-size: 0.9rem;
}

/* Big action area */
.action-row { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }

/* History */
.history-row {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.history-row:last-child { border-bottom: none; }
.history-row .who { font-weight: 600; }
.history-row .detail { font-size: 0.83rem; color: var(--text-muted); }

/* Auth pages */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  width: 100%;
  max-width: 380px;
}
.auth-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 4px; }
.auth-sub { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 28px; }
.auth-footer { margin-top: 20px; text-align: center; font-size: 0.9rem; color: var(--text-muted); }

hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* Confirmation */
.confirm-icon { font-size: 4rem; text-align: center; margin-bottom: 8px; }
.confirm-title { font-size: 1.5rem; font-weight: 700; text-align: center; color: var(--success); margin-bottom: 8px; }
.confirm-detail { color: var(--text-muted); font-size: 0.9rem; text-align: center; }
