:root {
  --bg: #0f172a;
  --bg-soft: #111827;
  --card-bg: #020617;
  --primary: #38bdf8;
  --primary-soft: rgba(56, 189, 248, 0.1);
  --text: #e5e7eb;
  --muted: #9ca3af;
  --danger: #f97373;
  --success: #4ade80;
  --border: #1f2937;
  --radius: 12px;
  --shadow-soft: 0 18px 40px rgba(15, 23, 42, 0.7);
  --shadow-small: 0 8px 20px rgba(15, 23, 42, 0.8);
}

/* Reset-ish */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #1f2937 0, #020617 45%, #000 100%);
  color: var(--text);
  display: flex;
  align-items: stretch;
  justify-content: center;
}

/* App shell */
.app-shell {
  width: 100%;
  max-width: 450px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.app-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-logo {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: radial-gradient(circle at 30% 30%, #e5e7eb 0, #38bdf8 45%, #020617 100%);
  box-shadow: var(--shadow-small);
  flex-shrink: 0;
}

.app-title-block {
  display: flex;
  flex-direction: column;
}

.app-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.app-subtitle {
  font-size: 0.8rem;
  color: var(--muted);
}

/* Client logo on the right */
.client-logo-slot {
  height: 50px;
  min-width: 140px;
  max-width: 220px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 1;
}

.client-logo-slot.has-logo {
  background: transparent;
}

.client-logo-slot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Card */
.card {
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.85));
  border-radius: var(--radius);
  padding: 18px 16px 16px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top, rgba(56,189,248,0.2) 0, transparent 45%);
  opacity: 0.8;
  pointer-events: none;
}

.card > * {
  position: relative;
  z-index: 1;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
}

.card-pill {
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid rgba(56, 189, 248, 0.4);
}

/* Forms & inputs */
label {
  font-size: 0.8rem;
  color: var(--muted);
  display: block;
  margin-bottom: 4px;
}

input {
  width: 100%;
  padding: 10px 11px;
  border-radius: 9px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

input::placeholder {
  color: rgba(156, 163, 175, 0.7);
}

input:focus {
  border-color: rgba(56, 189, 248, 0.7);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.3);
  background: rgba(15, 23, 42, 0.95);
}

button {
  border: none;
  cursor: pointer;
}

/* Buttons */
.btn {
  width: 100%;
  padding: 9px 12px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #38bdf8, #0ea5e9);
  color: #0b1220;
  box-shadow: 0 12px 30px rgba(8, 47, 73, 0.8);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 40px rgba(8, 47, 73, 0.9);
}

.btn-secondary {
  background: rgba(15, 23, 42, 0.95);
  color: var(--muted);
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.btn-secondary:hover {
  background: rgba(15, 23, 42, 1);
  color: var(--text);
}

.btn-small {
  padding: 7px 10px;
  font-size: 0.8rem;
}

/* Ghost / tiny buttons (for rewards panel etc.) */
.btn-ghost.btn-tiny {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: transparent;
  color: #e5e7eb;
}

.btn-ghost.btn-tiny:hover {
  background: rgba(148, 163, 184, 0.15);
}

/* Messages */
.msg {
  margin-top: 8px;
  font-size: 0.8rem;
}

.msg-error {
  color: var(--danger);
}

.msg-success {
  color: var(--success);
}

/* Dashboard buttons */
.stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

/* Customer list */
.customer-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.customer-card {
  background: rgba(15, 23, 42, 0.96);
  border-radius: 11px;
  padding: 10px 11px;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.customer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.customer-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.customer-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.customer-name {
  font-size: 0.9rem;
  font-weight: 500;
}

.customer-meta {
  font-size: 0.75rem;
  color: var(--muted);
}

/* Mini stamp bar on list cards (right side) */
.mini-stamp-track {
  display: flex;
  gap: 2px;
}

.mini-stamp-slot {
  width: 8px;
  height: 6px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: transparent;
}

.mini-stamp-slot.filled {
  background: var(--primary);
  border-color: var(--primary);
}

/* Customer profile */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.stat-badge {
  padding: 8px 9px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.3);
  font-size: 0.8rem;
}

.stat-label {
  color: var(--muted);
  font-size: 0.7rem;
}

.stat-value {
  margin-top: 2px;
  font-weight: 500;
}

/* Rewards / generic panel */
.panel {
  margin-top: 12px;
  padding: 10px;
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.panel-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #e5e7eb;
}

.panel-body {
  font-size: 0.8rem;
}

/* Utility */
.text-right {
  text-align: right;
}

.text-muted {
  color: var(--muted);
  font-size: 0.8rem;
}

.link {
  color: var(--primary);
  font-size: 0.8rem;
  text-decoration: none;
}

.link:hover {
  text-decoration: underline;
}

.spacer-sm {
  height: 8px;
}

.spacer-md {
  height: 12px;
}

.spacer-lg {
  height: 18px;
}
/* ---- Toolbar row on customers page ---- */
.toolbar-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.toolbar-main {
  flex: 1;
  min-width: 200px;
}

.toolbar-side {
  flex-shrink: 0;
}

/* Small pill for pending count */
.pill-muted {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  margin-left: 4px;
  border-radius: 999px;
  font-size: 0.7rem;
  background: rgba(15, 23, 42, 0.6);
  color: var(--muted);
  border: 1px solid rgba(148, 163, 184, 0.35);
}

/* Simple ghost button style */
.btn-ghost {
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.5);
  color: var(--muted);
}

.btn-ghost:hover {
  border-color: var(--primary);
  color: var(--text);
}

/* Hidden utility */
.hidden {
  display: none !important;
}

/* Panel for pending sign-ups */
.panel {
  margin-top: 8px;
  margin-bottom: 4px;
  padding: 10px 11px;
  border-radius: 10px;
  border: 1px dashed rgba(148, 163, 184, 0.5);
  background: rgba(15, 23, 42, 0.7);
}

.panel-header {
  margin-bottom: 8px;
}

.panel-title {
  font-size: 0.85rem;
  font-weight: 500;
}

.panel-subtitle {
  font-size: 0.72rem;
  color: var(--muted);
}

/* Pending (waiting list) cards */
.pending-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pending-card {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 9px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.9);
}

.pending-main {
  flex: 1;
}

.pending-name {
  font-size: 0.85rem;
  font-weight: 500;
}

.pending-meta {
  font-size: 0.72rem;
  color: var(--muted);
}

.pending-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
}

/* Mini stamp track on each customer row */
.mini-stamp-track {
  display: flex;
  gap: 2px;
  margin-bottom: 4px;
  flex-wrap: nowrap;
}

.stamp-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: transparent;
}

.stamp-dot.filled {
  background: var(--primary);
  border-color: var(--primary);
}
