:root {
  --primary: #0f766e;
  --primary-dark: #115e59;
  --primary-soft: #ccfbf1;
  --accent: #f97316;
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --danger: #dc2626;
  --success: #16a34a;
  --warn: #d97706;
  --radius: 12px;
  --shadow-1: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-2: 0 10px 30px -12px rgba(15, 23, 42, 0.20);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
code {
  background: #f1f5f9;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ============================================================================
   LANDING / LOGIN
============================================================================ */
.landing {
  min-height: 100vh;
  background:
    radial-gradient(ellipse at top left, rgba(15,118,110,0.08), transparent 60%),
    radial-gradient(ellipse at bottom right, rgba(249,115,22,0.06), transparent 60%),
    var(--bg);
}

.landing-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 28px;
  max-width: 1100px;
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-mark {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 18px;
  box-shadow: var(--shadow-1);
}
.brand-mark.small { width: 32px; height: 32px; font-size: 15px; border-radius: 8px; }
.brand-text {
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.01em;
}
.help-link { color: var(--muted); font-size: 14px; }

.landing-hero {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 28px 60px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: center;
}
@media (min-width: 860px) {
  .landing-hero { grid-template-columns: 1.1fr 0.9fr; padding-top: 60px; }
}
.hero-copy h1 {
  font-size: 34px;
  line-height: 1.15;
  margin: 0 0 16px;
  letter-spacing: -0.02em;
  font-weight: 700;
}
@media (min-width: 860px) {
  .hero-copy h1 { font-size: 44px; }
}
.hero-copy .lead {
  font-size: 17px;
  color: var(--muted);
  line-height: 1.55;
  margin: 0 0 24px;
  max-width: 520px;
}
.hero-cta {
  background: var(--surface);
  border-radius: 14px;
  padding: 20px;
  box-shadow: var(--shadow-2);
  max-width: 420px;
}
#login { min-height: 64px; }  /* keeps layout stable while iframe loads */

/* Hero illustration — a little mock phone */
.hero-art { display: flex; justify-content: center; }
.phone {
  width: 240px;
  height: 380px;
  background: #111827;
  border-radius: 28px;
  padding: 14px;
  box-shadow: var(--shadow-2);
  position: relative;
}
.phone::before {
  content: "";
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  width: 60px; height: 6px; background: #374151; border-radius: 4px;
}
.phone-screen {
  width: 100%; height: 100%;
  background: #fff;
  border-radius: 18px;
  padding: 20px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ps-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.ps-slot {
  border: 2px dashed var(--border);
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
}
.ps-save {
  background: var(--primary); color: #fff;
  padding: 8px; border-radius: 6px;
  text-align: center; font-size: 12px; font-weight: 600;
}

.landing-steps {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 28px 60px;
}
.landing-steps h2 {
  font-size: 22px;
  margin: 0 0 20px;
  letter-spacing: -0.01em;
}
.steps {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .steps { grid-template-columns: repeat(3, 1fr); }
}
.step {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-1);
}
.step-num {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.step-title { font-weight: 600; margin-bottom: 6px; }
.step-body { color: var(--muted); font-size: 14px; line-height: 1.5; }

.landing-foot {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 28px 24px;
}

/* ============================================================================
   APP (after login)
============================================================================ */
.screen { min-height: 100vh; padding: 16px; max-width: 640px; margin: 0 auto; }

/* Top bar */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 4px 16px;
  gap: 12px;
}
.topbar-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.merchant-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
.tenant-slug { font-size: 12px; }

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  background: var(--surface);
  padding: 4px;
  border-radius: 12px;
  box-shadow: var(--shadow-1);
}
.tab {
  flex: 1;
  padding: 10px 8px;
  background: transparent;
  border: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}
.tab.active { background: var(--primary); color: #fff; }

/* Cards */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-1);
}
.card h3 { margin: 0 0 12px; font-size: 16px; }
.card-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px; flex-wrap: wrap; gap: 8px;
}
.card-header h3 { margin: 0; }
.actions { display: flex; gap: 8px; }
.help-card { background: #f8fafc; border: 1px dashed var(--border); box-shadow: none; }

.progress-chip {
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
}

/* Onboarding */
.onboard { border-left: 3px solid var(--primary); }
.onboard-list { list-style: none; margin: 0; padding: 0; }
.onboard-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; font-size: 14px;
  color: var(--text);
}
.ob-dot {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--border); background: #fff;
  flex-shrink: 0;
}
.onboard-list li.done { color: var(--muted); text-decoration: line-through; }
.onboard-list li.done .ob-dot {
  border-color: var(--success);
  background: var(--success);
  position: relative;
}
.onboard-list li.done .ob-dot::after {
  content: ""; position: absolute;
  left: 3px; top: 1px; width: 4px; height: 8px;
  border: solid white; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Form */
.label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 4px;
  margin-top: 12px;
}
input[type="text"], input[type="number"], textarea, input[type="file"] {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  -webkit-appearance: none;
  font-family: inherit;
}
textarea { resize: vertical; font-size: 14px; }
input:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15,118,110,0.15);
}
.row { display: flex; gap: 12px; }
.col { flex: 1; min-width: 0; }

/* Image grid (4 slots) */
.image-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 6px;
}
.img-slot {
  position: relative;
  aspect-ratio: 1/1;
  border: 2px dashed var(--border);
  border-radius: 10px;
  background: #f1f5f9;
  color: var(--muted);
  cursor: pointer;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  text-align: center;
  padding: 8px;
  transition: border-color 0.15s, transform 0.05s;
}
.img-slot:active { transform: scale(0.98); }
.img-slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.img-slot .slot-label { font-weight: 600; font-size: 14px; color: var(--text); }
.img-slot .slot-hint { font-size: 11px; opacity: 0.75; margin-top: 2px; }
.img-slot .slot-cam { font-size: 22px; margin-bottom: 4px; }
.img-slot.has-image { border-style: solid; border-color: var(--primary); }
.img-slot .slot-label-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
  color: #fff;
  padding: 16px 8px 6px;
  font-size: 11px; text-align: center; font-weight: 600;
}
.img-slot .slot-retake {
  position: absolute; top: 6px; right: 6px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  cursor: pointer;
  z-index: 2;
}
.img-slot.uploading::after {
  content: "Uploading…";
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.5);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
}
.img-slot.error {
  border-color: var(--danger);
  color: var(--danger);
}

/* Buttons */
.btn {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  margin-top: 16px;
  transition: background 0.15s, transform 0.05s;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn.primary:disabled { background: #94a3b8; cursor: not-allowed; transform: none; }
.btn.ghost {
  background: #f1f5f9;
  color: var(--text);
  padding: 8px 12px;
  font-size: 13px;
  margin: 0;
  width: auto;
}
.btn.ghost:hover { background: #e2e8f0; }
.btn.ghost.danger { background: #fee2e2; color: var(--danger); }
.btn.ghost.danger:hover { background: #fecaca; }
.btn-text {
  background: none; border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
}

/* Status */
.status { margin-top: 12px; font-size: 13px; min-height: 18px; }
.status.success { color: var(--success); }
.status.error { color: var(--danger); }
.status.warn { color: var(--warn); }

/* Recent list */
.recent-list { list-style: none; margin: 0; padding: 0; }
.recent-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.recent-list li:last-child { border-bottom: none; }
.recent-list .thumb-strip {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}
.recent-list .thumb-strip img {
  width: 32px; height: 32px; border-radius: 4px;
  object-fit: cover; background: #f1f5f9;
}
.recent-list .thumb-strip .empty-thumb {
  width: 32px; height: 32px; border-radius: 4px;
  background: #f1f5f9;
  border: 1px dashed var(--border);
}
.recent-list .info { flex: 1; min-width: 0; }
.recent-list .info .pname {
  font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.recent-list .info .pmeta { color: var(--muted); font-size: 12px; }
.recent-list .pushed { color: var(--success); font-size: 11px; }

/* Bulk list */
.filter-row {
  display: flex; gap: 14px; margin: 10px 0;
  font-size: 13px; color: var(--muted);
}
.filter-row label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }

.bulk-list {
  list-style: none; margin: 0; padding: 0;
  max-height: 440px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: 8px;
  background: #fff;
}
.bulk-list li {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; cursor: pointer;
}
.bulk-list li:last-child { border-bottom: none; }
.bulk-list li:hover { background: #f8fafc; }
.bulk-list .name { font-weight: 500; }
.bulk-list .meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.bulk-list .status-pill {
  font-size: 11px; padding: 3px 10px; border-radius: 999px;
  white-space: nowrap; font-weight: 600;
}
.bulk-list .status-pill.none { background: #f1f5f9; color: var(--muted); }
.bulk-list .status-pill.done { background: #dcfce7; color: var(--success); }

.tips { margin: 0; padding-left: 20px; color: var(--muted); font-size: 13px; line-height: 1.7; }

.app-foot { text-align: center; padding: 24px 16px 12px; }

/* ============================================================================
   TOASTS
============================================================================ */
.toast-root {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: calc(100% - 32px);
  max-width: 420px;
}
.toast {
  background: #0f172a;
  color: #fff;
  padding: 12px 16px;
  border-radius: 10px;
  box-shadow: var(--shadow-2);
  font-size: 14px;
  display: flex; align-items: center; gap: 10px;
  animation: toastIn 0.25s ease-out;
  pointer-events: auto;
}
.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }
.toast.warn    { background: var(--warn); }
.toast .toast-icon { font-size: 18px; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}
