/* ──────────────────────────────────────────────
   BadgePress — Design System
   Dark UI · electric purple + warm amber accents
   ────────────────────────────────────────────── */

:root {
  --bg: #0b0d14;
  --bg-elev: #12151f;
  --panel: rgba(22, 25, 37, 0.78);
  --panel-solid: #161925;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #eef0f6;
  --text-dim: #9aa0b4;
  --text-faint: #6b7189;
  --primary: #7c3aed;
  --primary-2: #a78bfa;
  --primary-glow: rgba(124, 58, 237, 0.45);
  --accent: #f59e0b;
  --success: #10b981;
  --danger: #ef4444;
  --safe: #22c55e;
  --cut: #ffffff;
  --bleed: #ef4444;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
}

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

[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(124, 58, 237, 0.18), transparent 60%),
    radial-gradient(900px 500px at 110% 10%, rgba(245, 158, 11, 0.10), transparent 60%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary-2); }

/* ── Header ── */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(11, 13, 20, 0.7);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.brand-logo {
  width: 36px; height: 36px; border-radius: 50%;
  background: conic-gradient(from 210deg, var(--primary), var(--accent), var(--primary));
  box-shadow: 0 0 0 3px rgba(255,255,255,0.08), 0 0 24px var(--primary-glow);
  position: relative;
}
.brand-logo::after {
  content: ''; position: absolute; inset: 7px; border-radius: 50%;
  background: var(--bg); border: 2px dashed rgba(255,255,255,0.35);
}
.brand-name { font-weight: 800; font-size: 1.2rem; letter-spacing: -0.02em; }
.brand-name span { color: var(--primary-2); }
.header-meta { display: flex; gap: 18px; align-items: center; color: var(--text-dim); font-size: 0.85rem; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px; font-size: 0.78rem; font-weight: 600;
  background: rgba(124, 58, 237, 0.14); color: var(--primary-2); border: 1px solid rgba(124, 58, 237, 0.3);
}
.pill.amber { background: rgba(245, 158, 11, 0.12); color: #fbbf24; border-color: rgba(245, 158, 11, 0.3); }
.pill.green { background: rgba(16, 185, 129, 0.12); color: #34d399; border-color: rgba(16, 185, 129, 0.3); }
.pill.red { background: rgba(239, 68, 68, 0.12); color: #f87171; border-color: rgba(239, 68, 68, 0.3); }
.pill.gray { background: rgba(255,255,255,0.06); color: var(--text-dim); border-color: var(--border); }

/* ── Layout ── */
.designer-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 380px;
  gap: 20px;
  padding: 20px 28px 40px;
  max-width: 1600px;
  margin: 0 auto;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  padding: 18px;
}
.panel + .panel { margin-top: 16px; }
.panel { scroll-margin-top: 72px; } /* jumps land below the sticky header */
.panel-title {
  margin: 0 0 14px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  font-weight: 700;
  display: flex; align-items: center; justify-content: space-between;
}
.sidebar { display: flex; flex-direction: column; }

/* ── Form controls ── */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field label, .label { font-size: 0.78rem; color: var(--text-dim); font-weight: 600; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }

input[type="text"], input[type="email"], input[type="number"], input[type="password"], input[type="url"],
select, textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  padding: 9px 11px;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 120px; font-family: var(--mono); font-size: 0.82rem; line-height: 1.5; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow);
}
input[type="color"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 38px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: transparent; padding: 3px; cursor: pointer;
}
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: none; border-radius: 6px; }
input[type="range"] { width: 100%; accent-color: var(--primary); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text); font: inherit; font-size: 0.86rem; font-weight: 600;
  cursor: pointer; transition: transform .12s, background .15s, border-color .15s, box-shadow .15s;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { background: rgba(255, 255, 255, 0.09); border-color: rgba(255,255,255,0.25); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), #5b21b6);
  border-color: transparent; box-shadow: 0 8px 24px var(--primary-glow);
}
.btn-primary:hover { background: linear-gradient(135deg, #8b5cf6, var(--primary)); }
.btn-accent { background: linear-gradient(135deg, var(--accent), #d97706); border-color: transparent; color: #1b1205; }
.btn-danger { color: #fca5a5; border-color: rgba(239, 68, 68, 0.35); }
.btn-danger:hover { background: rgba(239, 68, 68, 0.12); }
.btn-block { width: 100%; }
.btn-lg { padding: 14px 18px; font-size: 1rem; border-radius: 12px; }
.btn-sm { padding: 6px 10px; font-size: 0.78rem; }
.btn.active { border-color: var(--primary); background: rgba(124, 58, 237, 0.2); color: #ddd6fe; }

.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tool-grid .btn { flex-direction: column; padding: 12px 8px; font-size: 0.78rem; gap: 6px; }
.tool-grid .btn .ico { font-size: 1.25rem; line-height: 1; }

/* ── Segmented toggle ── */
.segmented {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: rgba(0,0,0,0.35); border: 1px solid var(--border); border-radius: 11px; padding: 4px; gap: 4px;
}
.segmented button {
  background: transparent; border: none; color: var(--text-dim);
  padding: 8px 10px; border-radius: 8px; font: inherit; font-size: 0.82rem; font-weight: 600; cursor: pointer;
  transition: background .15s, color .15s;
}
.segmented button.active { background: var(--primary); color: #fff; box-shadow: 0 4px 14px var(--primary-glow); }

/* ── Canvas stage ── */
.stage {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.stage-toolbar {
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: center;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 8px;
  backdrop-filter: blur(12px);
}
.canvas-shell {
  position: relative;
  width: min(100%, 560px);
  aspect-ratio: 1 / 1;
  padding: 30px;
  border-radius: 24px;
  background:
    linear-gradient(45deg, rgba(255,255,255,0.025) 25%, transparent 25%, transparent 75%, rgba(255,255,255,0.025) 75%),
    linear-gradient(45deg, rgba(255,255,255,0.025) 25%, transparent 25%, transparent 75%, rgba(255,255,255,0.025) 75%),
    var(--bg-elev);
  background-size: 22px 22px; background-position: 0 0, 11px 11px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow), inset 0 0 80px rgba(0,0,0,0.4);
}
.canvas-holder { position: relative; width: 100%; height: 100%; }
.canvas-holder .canvas-container { margin: 0 auto; }
.canvas-holder .lower-canvas { border-radius: 50%; }
.canvas-holder .lower-canvas { box-shadow: 0 18px 60px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.06); }

.template-overlay {
  position: absolute; inset: 0; pointer-events: none; z-index: 5;
  transition: opacity .25s;
}
.template-overlay.hidden { opacity: 0; }
.template-overlay text {
  font-family: var(--font); font-size: 9px; font-weight: 700; letter-spacing: 0.08em;
  paint-order: stroke; stroke: rgba(0, 0, 0, 0.75); stroke-width: 2.5px; stroke-linejoin: round;
}

.legend { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; font-size: 0.78rem; color: var(--text-dim); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 18px; height: 0; border-top: 2px dashed; display: inline-block; }
.legend .l-safe i { border-color: var(--safe); }
.legend .l-cut i { border-top-style: solid; border-color: var(--cut); }
.legend .l-bleed i { border-color: var(--bleed); }

.hint { font-size: 0.78rem; color: var(--text-faint); line-height: 1.5; margin: 0; }
.hint strong { color: var(--text-dim); }

/* ── Layers ── */
.layer-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow: auto; }
.layer-list li {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px;
  background: rgba(255,255,255,0.03); border: 1px solid var(--border); font-size: 0.82rem; cursor: pointer;
}
.layer-list li.selected { border-color: var(--primary); background: rgba(124,58,237,0.14); }
.layer-list li .tag { margin-left: auto; font-size: 0.68rem; color: var(--accent); font-weight: 700; }
.layer-list .empty { color: var(--text-faint); cursor: default; justify-content: center; }

/* ── Pricing ── */
.qty-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.qty-col { display: flex; flex-direction: column; gap: 6px; }
.packs-col { flex: 1; min-width: 200px; }
.qty-pill {
  display: flex; align-items: center; gap: 4px; padding: 4px;
  background: rgba(0,0,0,0.3); border: 1px solid var(--border-strong); border-radius: 999px;
}
.qty-pill input {
  width: 64px; text-align: center; font-size: 1.15rem; font-weight: 800;
  background: transparent; border: none; padding: 4px 0; -moz-appearance: textfield;
}
.qty-pill input::-webkit-outer-spin-button, .qty-pill input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-pill input:focus { box-shadow: none; }
.qty-round {
  width: 34px; height: 34px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--primary); color: #fff; font-size: 1.25rem; font-weight: 700; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px var(--primary-glow); transition: transform .1s, background .15s;
}
.qty-round:hover { background: #8b5cf6; }
.qty-round:active { transform: scale(0.92); }
.pack-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.pack-btn {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 6px 2px; border-radius: 9px; cursor: pointer; font: inherit;
  background: rgba(255,255,255,0.04); border: 1px solid var(--border-strong); color: var(--text);
  transition: border-color .15s, background .15s, transform .1s;
}
.pack-btn:hover { border-color: rgba(255,255,255,0.3); }
.pack-btn:active { transform: translateY(1px); }
.pack-btn .pack-n { font-weight: 800; font-size: 0.95rem; }
.pack-btn .pack-p { font-size: 0.66rem; color: var(--text-faint); }
.pack-btn.active { border-color: var(--primary); background: rgba(124,58,237,0.22); box-shadow: 0 0 0 1px var(--primary) inset; }
.pack-btn.active .pack-p { color: #ddd6fe; }
.price-main { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; font-size: 1.05rem; padding: 2px 0 4px; }
#unitPrice { font-weight: 700; color: var(--text); }
#unitPrice.flash { animation: priceFlash .6s ease-out; }
@keyframes priceFlash { 0% { color: var(--success); transform: scale(1.12); } 100% { color: var(--text); transform: none; } }
.price-line #unitPrice { display: inline-block; }
.qty-control { display: grid; grid-template-columns: 44px 1fr 44px; gap: 8px; }
.qty-control input { text-align: center; font-size: 1.15rem; font-weight: 700; }
.qty-control .btn { font-size: 1.2rem; padding: 0; }
.tier-table { width: 100%; border-collapse: separate; border-spacing: 0 4px; font-size: 0.84rem; margin: 12px 0 4px; }
.tier-table td { padding: 7px 10px; background: rgba(255,255,255,0.025); }
.tier-table td:first-child { border-radius: 8px 0 0 8px; }
.tier-table td:last-child { border-radius: 0 8px 8px 0; text-align: right; font-weight: 700; }
.tier-table tr.active td { background: rgba(124,58,237,0.2); color: #ede9fe; }
.tier-table tr.active td:first-child { box-shadow: inset 3px 0 0 var(--primary); }

.price-summary { border-top: 1px dashed var(--border-strong); margin-top: 12px; padding-top: 12px; }
.price-line { display: flex; justify-content: space-between; font-size: 0.88rem; color: var(--text-dim); padding: 3px 0; }
.price-line.savings { color: var(--success); }
.price-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 8px; }
.price-total .amount { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.02em; }
.price-total .label { font-size: 0.85rem; }
.free-ship-bar { margin-top: 10px; font-size: 0.78rem; color: var(--text-dim); }
.progress { height: 6px; border-radius: 99px; background: rgba(255,255,255,0.07); overflow: hidden; margin-top: 6px; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 99px; transition: width .3s; }

/* ── Payment methods ── */
.pay-options { display: grid; gap: 8px; }
.pay-option {
  display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 11px; cursor: pointer;
  border: 1px solid var(--border-strong); background: rgba(0,0,0,0.25); transition: border-color .15s, background .15s;
}
.pay-option:hover { border-color: rgba(255,255,255,0.3); }
.pay-option input { accent-color: var(--primary); }
.pay-option.selected { border-color: var(--primary); background: rgba(124,58,237,0.12); }
.pay-option .pay-name { font-weight: 700; font-size: 0.9rem; }
.pay-option .pay-sub { font-size: 0.74rem; color: var(--text-dim); }
.pay-option .badge-rec { margin-left: auto; }
.pay-option.disabled { opacity: .45; cursor: not-allowed; }

/* ── Batch ── */
.batch-panel[hidden] { display: none; }
.batch-count { font-size: 0.8rem; color: var(--text-dim); margin-top: 6px; }
.batch-count strong { color: var(--accent); }
.batch-steps { margin: 0 0 14px; padding-left: 18px; font-size: 0.78rem; color: var(--text-dim); line-height: 1.5; }
.batch-steps li { margin-bottom: 3px; }
.batch-steps strong { color: var(--text); }
.batch-seq { margin-top: 14px; padding-top: 10px; border-top: 1px dashed var(--border-strong); }
.batch-seq summary { cursor: pointer; font-size: 0.8rem; font-weight: 600; color: var(--text-dim); }
.batch-seq .hint { margin-top: 8px; }
.seq-grid { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 8px; margin-top: 10px; }
.seq-grid .field { margin-bottom: 8px; min-width: 0; }
.variant-preview { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.variant-preview .vp-label {
  flex: 1; text-align: center; font-size: 0.8rem; font-family: var(--mono);
  background: rgba(0,0,0,0.3); border: 1px solid var(--border); border-radius: 8px; padding: 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── Toasts / alerts ── */
.toast-wrap { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 200; }
.toast {
  background: var(--panel-solid); border: 1px solid var(--border-strong); border-left: 4px solid var(--primary);
  padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow); font-size: 0.86rem; max-width: 360px;
  animation: toastIn .25s ease-out;
}
.toast.error { border-left-color: var(--danger); }
.toast.success { border-left-color: var(--success); }
@keyframes toastIn { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

.alert { padding: 11px 13px; border-radius: 10px; font-size: 0.82rem; line-height: 1.45; }
.alert.warn { background: rgba(245, 158, 11, 0.1); border: 1px solid rgba(245, 158, 11, 0.3); color: #fcd34d; }
.alert.info { background: rgba(124, 58, 237, 0.1); border: 1px solid rgba(124, 58, 237, 0.3); color: #ddd6fe; }

/* ── Loading overlay ── */
.loading-overlay {
  position: fixed; inset: 0; background: rgba(5, 6, 10, 0.75); backdrop-filter: blur(6px);
  display: flex; flex-direction: column; gap: 18px; align-items: center; justify-content: center; z-index: 300;
}
.loading-overlay[hidden] { display: none; }
.spinner {
  width: 56px; height: 56px; border-radius: 50%;
  border: 4px solid rgba(255,255,255,0.1); border-top-color: var(--primary); border-right-color: var(--accent);
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Thank you page ── */
.center-page { max-width: 720px; margin: 50px auto; padding: 0 20px; }
/* Seller details at the bottom of the shop pages */
.site-footer { padding: 18px 20px 24px; border-top: 1px solid var(--border); color: var(--text-dim); font-size: 0.8rem; text-align: center; }
.site-footer a { color: var(--text-dim); }
.site-footer a:hover { color: var(--text); }
.site-footer [data-seller="footer-email"]::before { content: ' - '; }
.footer-links { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-left: 18px; }
@media (max-width: 720px) { .footer-links { display: flex; margin: 8px 0 0; } }
.order-terms { margin-top: 8px; text-align: center; }
.order-terms a, .legal a { color: var(--primary-2); }

/* ── Terms, privacy, shipping ── */
.legal-page { max-width: 820px; }
.legal { padding: 32px 36px; line-height: 1.65; }
.legal h1 { margin: 0 0 4px; }
.legal h2 { margin: 28px 0 8px; font-size: 1.08rem; }
.legal p, .legal li { color: var(--text-dim); font-size: 0.94rem; }
.legal strong { color: var(--text); }
.legal ul { padding-left: 20px; margin: 8px 0; }
.legal li + li { margin-top: 4px; }
.legal .seller-card { list-style: none; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: rgba(255, 255, 255, 0.025); }
.legal-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; margin: 8px 0; }
.legal-table th, .legal-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; color: var(--text-dim); }
.legal-table th { color: var(--text); font-weight: 700; }
@media (max-width: 720px) { .legal { padding: 20px 18px; } }
.confirm-card { text-align: center; padding: 40px 32px; }
.confirm-badge {
  width: 180px; height: 180px; border-radius: 50%; margin: 0 auto 24px; overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 0 6px rgba(255,255,255,0.05), 0 0 60px var(--primary-glow);
  background: var(--bg-elev);
}
.confirm-badge img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.16); }
.order-id { font-family: var(--mono); font-size: 1.4rem; font-weight: 700; color: var(--accent); letter-spacing: 0.04em; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: var(--accent); animation: pulse 1.4s infinite; }
.status-dot.paid { background: var(--success); animation: none; }
@keyframes pulse { 50% { opacity: .35; } }
.summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; text-align: left; margin-top: 24px; }
.summary-grid > div { background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: 10px; padding: 12px; min-width: 0; overflow-wrap: anywhere; }
.summary-grid .k { font-size: 0.72rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.08em; }
.summary-grid .v { font-weight: 700; margin-top: 4px; }

/* ── Admin ── */
.admin-wrap { max-width: 1400px; margin: 0 auto; padding: 24px 28px 60px; }
.login-card { max-width: 380px; margin: 12vh auto; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat .k { font-size: 0.74rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
.stat .v { font-size: 2rem; font-weight: 800; margin-top: 6px; letter-spacing: -0.02em; }
.stat .v small { font-size: 0.9rem; color: var(--text-faint); font-weight: 600; }
.stat .hint { margin-top: 4px; }
.backup-status { margin: 0 0 14px; font-size: 0.82rem; color: var(--text-faint); }
.backup-status.problem { padding: 10px 14px; border: 1px solid rgba(239, 68, 68, 0.3); border-radius: var(--radius-sm); background: rgba(239, 68, 68, 0.12); color: #f87171; font-weight: 600; }
/* Grid cells line up: no stacking gap between panels in a row */
.stats .panel + .panel, .stats-breakdowns .panel + .panel { margin-top: 0; }

/* ── Admin statistics ── */
.day-chart { display: flex; align-items: flex-end; gap: 3px; height: 160px; padding-top: 12px; }
.day-chart .bar { flex: 1 1 0; min-width: 2px; position: relative; background: var(--primary); border-radius: 3px 3px 0 0; opacity: 0.85; }
.day-chart .bar:hover { opacity: 1; background: var(--primary-2); }
.day-chart .bar.empty { height: 2px; background: var(--border-strong); }
.day-chart .bar.paid::after { content: ''; position: absolute; top: -10px; left: 50%; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: #34d399; }
.day-chart-axis { display: flex; justify-content: space-between; margin: 6px 0 8px; color: var(--text-faint); font-size: 0.75rem; }
.stats-breakdowns { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin: 20px 0; }
.breakdown-row { position: relative; display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; font-size: 0.86rem; }
.breakdown-row small { color: var(--text-faint); font-weight: 600; }
.breakdown-row .share { position: absolute; left: 0; bottom: 0; height: 2px; border-radius: 2px; background: var(--primary); opacity: 0.7; }
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.table-wrap { overflow-x: auto; }
table.orders { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
table.orders th {
  text-align: left; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint);
  padding: 10px 12px; border-bottom: 1px solid var(--border-strong); white-space: nowrap;
}
table.orders td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.orders tr:hover td { background: rgba(255,255,255,0.02); }
.thumb { width: 54px; height: 54px; border-radius: 50%; background: var(--bg-elev); overflow: hidden; border: 1px solid var(--border-strong); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.mono { font-family: var(--mono); }
.addr { color: var(--text-dim); font-size: 0.78rem; line-height: 1.45; margin-top: 3px; }
.dl-group { display: flex; gap: 6px; flex-wrap: wrap; }
.empty-state { text-align: center; color: var(--text-faint); padding: 50px 0; }
/* ── Admin settings ── */
.settings-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; position: sticky; top: 64px; z-index: 20; background: rgba(11,13,20,0.85); backdrop-filter: blur(10px); padding: 12px 0; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 16px; margin-bottom: 16px; align-items: start; }
.settings-grid .panel + .panel { margin-top: 0; }
.setting-row { margin-bottom: 14px; }
.setting-row label { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; color: var(--text); font-weight: 600; margin-bottom: 5px; }
.setting-row .hint { margin-top: 4px; }
.setting-row .err { color: #f87171; font-size: 0.78rem; margin-top: 4px; }
.setting-row.has-err input, .setting-row.has-err select { border-color: var(--danger); }
.setting-row.danger { border: 1px solid rgba(239,68,68,0.35); background: rgba(239,68,68,0.06); border-radius: 10px; padding: 10px; }
.src-badge { font-size: 0.62rem; font-weight: 700; padding: 1px 6px; border-radius: 99px; text-transform: uppercase; letter-spacing: 0.05em; }
.src-admin { background: rgba(124,58,237,0.2); color: #ddd6fe; }
.src-env { background: rgba(245,158,11,0.15); color: #fbbf24; }
.src-default { background: rgba(255,255,255,0.06); color: var(--text-faint); }
.reset-link { margin-left: auto; font-size: 0.72rem; color: var(--text-faint); cursor: pointer; background: none; border: none; text-decoration: underline; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: 0.86rem; }
.switch input { width: 18px; height: 18px; accent-color: var(--primary); }
@media (max-width: 720px) { .settings-grid { grid-template-columns: 1fr; } .settings-head { position: static; } }
.action-bar { justify-content: flex-start; padding: 10px 12px; border-radius: 11px; background: rgba(124,58,237,0.08); border: 1px solid rgba(124,58,237,0.25); }
.action-bar .btn:disabled { opacity: .4; }
table.orders input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }

/* ── Mobile order bar (phones only, see checkout.js) and quick text style bar (designer.js) ── */
.mobile-order-bar { display: none; }
.quick-style { display: none; }

/* ── Responsive ── */
/* minmax(0, …) columns: Fabric's 500 px canvas wrapper must not hold a column open on small screens */
.stage { min-width: 0; width: 100%; }
@media (max-width: 1280px) {
  .designer-layout { grid-template-columns: 270px minmax(0, 1fr) 340px; padding: 16px; gap: 16px; }
}
@media (max-width: 1080px) {
  .designer-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .stage { grid-column: 1 / -1; order: -1; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .designer-layout { grid-template-columns: minmax(0, 1fr); padding: 10px; gap: 12px; }
  .designer-layout + .site-footer { padding-bottom: 96px; } /* room for the fixed order bar */
  .app-header { padding: 10px 14px; }
  .header-meta .hide-sm { display: none; }
  .canvas-shell { padding: 8px; border-radius: 16px; }
  .stage { gap: 12px; }
  .stage-toolbar { width: 100%; gap: 6px; }
  .stage-toolbar .btn { flex: 1 1 auto; }
  .panel { padding: 14px; }
  .panel + .panel { margin-top: 12px; }
  .summary-grid { grid-template-columns: 1fr; }
  .admin-wrap { padding: 16px; }
  /* iOS zooms into inputs smaller than 16 px */
  input[type="text"], input[type="email"], input[type="number"], input[type="password"], input[type="url"],
  select, textarea { font-size: 16px; }
  .toast-wrap { left: 12px; right: 12px; bottom: 84px; }
  .toast { max-width: none; }

  .mobile-order-bar {
    display: flex; align-items: center; gap: 12px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    background: rgba(11, 13, 20, 0.92); backdrop-filter: blur(14px);
    border-top: 1px solid var(--border-strong);
    transition: transform .2s ease-out;
  }
  .mobile-order-bar.away { transform: translateY(110%); }
  .mobile-order-bar .mob-total { display: flex; flex-direction: column; flex: 1; min-width: 0; }
  .mobile-order-bar .mob-total strong { font-size: 1.15rem; }
  .mobile-order-bar .btn { padding: 12px 20px; }

  .quick-style {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px; width: 100%;
    padding: 8px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  }
  .quick-style select { flex: 1 1 150px; min-width: 0; padding-top: 7px; padding-bottom: 7px; }
  .quick-style input[type="color"] { flex: 0 0 48px; width: 48px; height: 40px; }
  .quick-style .btn { flex: 1 0 auto; }
  .qs-size { display: flex; align-items: center; gap: 4px; }
  .qs-size span { min-width: 2.2em; text-align: center; font-family: var(--mono); font-size: 0.85rem; color: var(--text-dim); }
}
@media (max-width: 520px) {
  /* Guide labels stay readable when the canvas is shown at ~70 % */
  .template-overlay text { font-size: 13px; }
}
/* Fingers need bigger targets than a mouse */
@media (pointer: coarse) {
  .btn-sm { padding: 9px 12px; }
  .segmented button { padding: 11px 10px; }
  .layer-list li { padding-top: 10px; padding-bottom: 10px; }
}
