/* ================================================================
   YBM Artist Pages — Admin / Dashboard styles
   ================================================================ */
:root {
  --bg: #0a0a0a;
  --surface: #131313;
  --surface-2: #1c1c1c;
  --line: rgba(255,255,255,0.08);
  --line-strong: rgba(255,255,255,0.16);
  --gold: #C9A84C;
  --gold-soft: #b69536;
  --gold-dim: #8b7228;
  --text: #f5f3ee;
  --text-muted: #9a948a;
  --danger: #d9534f;
  --ok: #5fb572;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 14px 40px rgba(0,0,0,0.45);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: 'Inter', system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-soft); }
h1, h2, h3, h4 { font-family: 'Cinzel', serif; font-weight: 600; letter-spacing: 0.02em; margin: 0; }
.brand-serif { font-family: 'Cinzel', serif; }

/* ── Auth pages ── */
.auth-body { min-height: 100vh; background:
    radial-gradient(60% 50% at 15% 20%, rgba(201,168,76,0.18), transparent 60%),
    radial-gradient(60% 50% at 85% 80%, rgba(201,168,76,0.08), transparent 60%),
    var(--bg);
  display: grid; place-items: center; padding: 24px; }
.auth-shell { width: 100%; max-width: 460px; }
.auth-back { display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: 13px; margin-bottom: 18px; }
.auth-back:hover { color: var(--text); }
.auth-card { background: linear-gradient(180deg, var(--surface), var(--surface-2)); border: 1px solid var(--line); border-radius: var(--radius); padding: 40px 32px; box-shadow: var(--shadow); }
.auth-logo { text-align: center; margin-bottom: 28px; }
.logo-mark { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; background: var(--gold); color: #0a0a0a; font-family: 'Cinzel', serif; font-weight: 700; border-radius: 12px; box-shadow: 0 6px 18px rgba(201,168,76,0.35); margin-bottom: 14px; letter-spacing: 0.04em; }
.auth-brand { font-size: 22px; color: var(--gold); }
.auth-sub { color: var(--text-muted); font-size: 14px; margin-top: 8px; }
.btn-google { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 14px 18px; border-radius: 999px; background: #fff; color: #1a1a1a; font-weight: 600; font-size: 15px; border: none; cursor: pointer; transition: transform 0.15s ease, box-shadow 0.15s ease; }
.btn-google:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(0,0,0,0.4); }
.auth-divider { display: flex; align-items: center; gap: 12px; color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; margin: 22px 0 16px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-pw-form { display: flex; flex-direction: column; gap: 10px; }
.auth-pw-label { color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; margin-top: 6px; }
.auth-pw-input { background: var(--surface-2, #111); border: 1px solid var(--line); color: #fff; padding: 12px 14px; border-radius: 10px; font-size: 14px; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.auth-pw-input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,168,76,0.15); }
.btn-pw-submit { margin-top: 14px; width: 100%; padding: 13px 18px; border-radius: 999px; background: var(--gold); color: #0a0a0a; font-weight: 700; font-size: 14px; letter-spacing: 0.04em; text-transform: uppercase; border: none; cursor: pointer; transition: transform 0.15s ease, background 0.15s ease; }
.btn-pw-submit:hover { transform: translateY(-1px); background: var(--gold-soft); }
.auth-pw-error { color: #ff6b6b; font-size: 13px; min-height: 18px; margin-top: 6px; text-align: center; }
.auth-pw-success { color: #5dd39e; font-size: 13px; min-height: 18px; margin-top: 6px; text-align: center; }
.auth-note { color: var(--text-muted); font-size: 12px; text-align: center; margin-top: 18px; line-height: 1.5; }
.spinner { width: 36px; height: 36px; border: 3px solid var(--line-strong); border-top-color: var(--gold); border-radius: 50%; animation: spin 0.9s linear infinite; margin: 16px auto 0; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── App shell ── */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 16px 28px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 100; }
.topbar-left { display: flex; align-items: center; gap: 14px; }
.topbar-logo { display: flex; align-items: center; gap: 10px; color: var(--gold); font-family: 'Cinzel', serif; font-weight: 700; font-size: 18px; }
.topbar-logo .logo-mark { width: 34px; height: 34px; margin: 0; border-radius: 8px; font-size: 13px; }
.role-pill { background: rgba(201,168,76,0.15); color: var(--gold); border: 1px solid rgba(201,168,76,0.4); padding: 4px 10px; border-radius: 999px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.user-chip { display: flex; align-items: center; gap: 10px; color: var(--text-muted); font-size: 14px; }
.user-chip img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line-strong); }
.btn-logout { background: transparent; border: 1px solid var(--line-strong); color: var(--text-muted); padding: 8px 14px; border-radius: 999px; cursor: pointer; font-size: 13px; }
.btn-logout:hover { color: var(--text); border-color: var(--text-muted); }

.layout { flex: 1; display: grid; grid-template-columns: 240px 1fr; min-height: 0; }
.sidebar { background: var(--surface); border-right: 1px solid var(--line); padding: 24px 14px; }
.sidebar h4 { color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; font-family: 'Inter', sans-serif; font-weight: 600; padding: 0 12px; margin-bottom: 8px; }
.sidebar-link { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; color: var(--text-muted); font-size: 14px; margin-bottom: 2px; cursor: pointer; }
.sidebar-link:hover { background: var(--surface-2); color: var(--text); }
.sidebar-link.active { background: rgba(201,168,76,0.12); color: var(--gold); }
.sidebar-section { margin-bottom: 22px; }

.content { padding: 32px 36px; max-width: 1200px; width: 100%; }
.content h2 { font-size: 28px; color: var(--gold); margin-bottom: 6px; }
.content .h-sub { color: var(--text-muted); font-size: 14px; margin-bottom: 28px; }

/* ── Cards ── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; }
.card h3 { font-size: 17px; color: var(--text); margin-bottom: 16px; font-family: 'Inter', sans-serif; font-weight: 600; }
.card-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.card-row > * { flex: 1; min-width: 220px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.stat-card .label { color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }
.stat-card .value { color: var(--gold); font-family: 'Cinzel', serif; font-size: 32px; margin-top: 6px; }

/* ── Forms ── */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.field input, .field textarea, .field select {
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  transition: border-color 0.15s ease;
}
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--gold); }
.field textarea { resize: vertical; min-height: 90px; }
.field .hint { color: var(--text-muted); font-size: 12px; }

.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.toggle-row:last-child { border-bottom: none; }
.toggle-row .lbl { color: var(--text); font-size: 14px; }
.toggle-row .desc { color: var(--text-muted); font-size: 12px; margin-top: 2px; }
.toggle { position: relative; display: inline-block; width: 42px; height: 24px; }
.toggle input { display: none; }
.toggle .slider { position: absolute; inset: 0; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 999px; cursor: pointer; transition: background 0.15s; }
.toggle .slider::before { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; background: #fff; border-radius: 50%; transition: transform 0.15s; }
.toggle input:checked + .slider { background: var(--gold); border-color: var(--gold); }
.toggle input:checked + .slider::before { transform: translateX(18px); }

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 22px; border-radius: 999px; border: none; cursor: pointer; font-weight: 600; font-size: 14px; transition: transform 0.15s ease, box-shadow 0.15s ease; }
.btn-primary { background: var(--gold); color: #0a0a0a; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(201,168,76,0.35); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line-strong); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid rgba(217,83,79,0.4); }
.btn-danger:hover { background: rgba(217,83,79,0.1); }

.save-bar { position: sticky; bottom: 16px; display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; padding: 14px; background: rgba(19,19,19,0.92); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: var(--radius); }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,0.94); border: 1px solid var(--line-strong); padding: 14px 22px; border-radius: 999px; z-index: 9999; font-size: 14px; }
.toast.ok { border-color: rgba(95,181,114,0.5); color: var(--ok); }
.toast.err { border-color: rgba(217,83,79,0.5); color: var(--danger); }

/* ── Tables ── */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; padding: 12px 14px; color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; border-bottom: 1px solid var(--line); }
.tbl td { padding: 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
.tbl tr:hover td { background: var(--surface-2); }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.badge.super { background: rgba(201,168,76,0.15); color: var(--gold); }
.badge.artist { background: rgba(255,255,255,0.06); color: var(--text-muted); }
.badge.pub { background: rgba(95,181,114,0.15); color: var(--ok); }
.badge.draft { background: rgba(255,255,255,0.06); color: var(--text-muted); }

/* ── Template gallery ── */
.tier-tabs { display: flex; gap: 6px; background: var(--surface-2); padding: 6px; border-radius: 999px; margin-bottom: 24px; width: max-content; }
.tier-tab { padding: 8px 18px; border-radius: 999px; color: var(--text-muted); font-size: 13px; cursor: pointer; border: none; background: transparent; font-weight: 600; }
.tier-tab.active { background: var(--gold); color: #0a0a0a; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.tpl-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tpl-card .thumb { aspect-ratio: 16/10; background: linear-gradient(135deg, #1a1a1a, #2a2316); position: relative; overflow: hidden; }
.tpl-card .thumb iframe { width: 100%; height: 100%; border: none; transform: scale(0.5); transform-origin: top left; width: 200%; height: 200%; pointer-events: none; }
.tpl-card .info { padding: 16px; }
.tpl-card .info h4 { font-family: 'Cinzel', serif; color: var(--gold); font-size: 17px; margin-bottom: 4px; font-weight: 600; }
.tpl-card .info p { color: var(--text-muted); font-size: 12px; margin-bottom: 12px; }
.tpl-card .actions { display: flex; gap: 8px; }
.tpl-card .actions .btn { flex: 1; padding: 8px 12px; font-size: 12px; justify-content: center; }
.tpl-card.selected { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.tier-badge { position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,0.85); color: var(--gold); border: 1px solid var(--gold); padding: 3px 8px; border-radius: 999px; font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }

/* ── Mobile hamburger button (hidden on desktop) ── */
.mobile-menu-btn { display: none; background: transparent; border: 1px solid var(--line-strong); color: var(--text); width: 38px; height: 38px; border-radius: 8px; cursor: pointer; padding: 0; align-items: center; justify-content: center; }
.mobile-menu-btn span { display: block; width: 18px; height: 2px; background: currentColor; position: relative; }
.mobile-menu-btn span::before, .mobile-menu-btn span::after { content: ""; position: absolute; left: 0; width: 18px; height: 2px; background: currentColor; }
.mobile-menu-btn span::before { top: -6px; }
.mobile-menu-btn span::after { top: 6px; }
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 95; backdrop-filter: blur(4px); }
.sidebar-backdrop.open { display: block; }

@media (max-width: 880px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: 260px; transform: translateX(-100%); transition: transform 0.25s ease; z-index: 100; padding-top: 80px; box-shadow: 12px 0 30px rgba(0,0,0,0.5); display: block; }
  .sidebar.open { transform: translateX(0); }
  .content { padding: 22px 18px; }
  .topbar { padding: 12px 14px; gap: 8px; }
  .mobile-menu-btn { display: inline-flex; }
  .topbar-logo span:last-child { display: none; }   /* hide "Artist Pages" wordmark */
  .topbar-logo .logo-mark { width: 32px; height: 32px; font-size: 11px; }
  .topbar-left { gap: 8px; flex-shrink: 1; min-width: 0; }
  .topbar-right { gap: 6px; flex-shrink: 0; }
  .topbar-right .user-chip span { display: none; }       /* hide long name */
  .topbar-right .user-chip img { width: 28px; height: 28px; }
  .btn-logout { padding: 6px 10px; font-size: 11px; }
  #viewMyPage .long-text { display: none; }
  #viewMyPage .short-text { display: inline !important; }
  /* "View my page" button shortened */
  #viewMyPage { padding: 6px 10px !important; font-size: 11px !important; white-space: nowrap; }
  .role-pill { font-size: 9px; padding: 3px 8px; }
  .tier-pill { font-size: 9px; padding: 2px 8px; }
  /* Touch-friendlier form */
  .field input, .field textarea, .field select { padding: 13px 14px; font-size: 15px; }
  .toggle-row { padding: 12px 0; }
  .toggle { width: 50px; height: 28px; flex-shrink: 0; }
  .toggle .slider::before { width: 22px; height: 22px; top: 2px; left: 2px; }
  .toggle input:checked + .slider::before { transform: translateX(22px); }
  .save-bar { flex-direction: column; gap: 8px; }
  .save-bar .btn { width: 100%; justify-content: center; }
  /* Template grid card — keep iframe usable on small viewports */
  .tpl-grid { grid-template-columns: 1fr; }
  .tpl-card .thumb { aspect-ratio: 16/9; }
  .tpl-card .thumb iframe { width: 200%; height: 200%; }
  /* Tables → cards on mobile */
  .tbl { display: block; }
  .tbl thead { display: none; }
  .tbl tbody, .tbl tr { display: block; }
  .tbl tr { background: var(--surface-2); border-radius: 10px; padding: 12px; margin-bottom: 10px; border: 1px solid var(--line); }
  .tbl td { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13px; gap: 12px; text-align: right; align-items: center; }
  .tbl td:last-child { border-bottom: none; }
  .tbl td::before { content: attr(data-label); color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; text-align: left; flex-shrink: 0; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-card .value { font-size: 24px; }
  /* Tier tabs scroll horizontally if needed */
  .tier-tabs { overflow-x: auto; white-space: nowrap; max-width: 100%; padding: 4px; }
  .tier-tab { flex-shrink: 0; font-size: 12px; padding: 7px 14px; }
  /* Modals */
  .modal-panel { padding: 22px 18px; }
  .content h2 { font-size: 22px; }
}

/* ── Modal ── */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 9000; display: grid; place-items: center; padding: 24px; backdrop-filter: blur(6px); }
.modal-panel { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 16px; padding: 28px; max-width: 560px; width: 100%; max-height: 88vh; overflow-y: auto; box-shadow: 0 24px 60px rgba(0,0,0,0.6); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.modal-head h3 { font-family: 'Cinzel', serif; color: var(--gold); font-size: 20px; margin: 0; }
.modal-x { background: transparent; border: none; color: var(--text-muted); font-size: 20px; cursor: pointer; padding: 4px 8px; }
.modal-x:hover { color: var(--text); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }

/* New admin modals (createArtistModal, editArtistModal) */
.modal { position: fixed; inset: 0; z-index: 9000; display: grid; place-items: center; padding: 24px; }
.modal[hidden] { display: none; }
.modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(6px); }
.modal .modal-panel { position: relative; max-width: 560px; }
.modal .modal-panel-wide { max-width: 780px; }
.modal-close { background: transparent; border: none; color: var(--text-muted); font-size: 20px; cursor: pointer; padding: 4px 8px; }
.modal-close:hover { color: var(--text); }
.modal-body { padding-top: 6px; }
.modal-body h4 { font-size: 14px; margin: 0 0 8px; letter-spacing: 0.04em; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.badge.comp { background: rgba(93,211,158,0.15); color: #5dd39e; border: 1px solid rgba(93,211,158,0.4); padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.badge.fee-waived { background: rgba(201,168,76,0.15); color: var(--gold); border: 1px solid rgba(201,168,76,0.4); padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }

/* ── Add-on rows ── */
.addon-rows { display: grid; gap: 8px; }
.addon-row { display: flex; align-items: flex-start; gap: 12px; padding: 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; transition: border-color 0.15s; }
.addon-row:hover { border-color: var(--gold-dim); }
.addon-row input[type="checkbox"] { margin-top: 3px; accent-color: var(--gold); width: 18px; height: 18px; }
.addon-name { color: var(--text); font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 10px; }
.addon-price { background: rgba(201,168,76,0.15); color: var(--gold); padding: 2px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.addon-tag { color: var(--text-muted); font-size: 13px; margin-top: 2px; line-height: 1.4; }

/* ── Tier badges ── */
.tier-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.tier-pill.basic    { background: rgba(154,148,138,0.18); color: #c9c2b6; }
.tier-pill.standard { background: rgba(201,168,76,0.18);  color: var(--gold); border: 1px solid rgba(201,168,76,0.4); }
.tier-pill.premium  { background: linear-gradient(135deg, #C9A84C, #e6c875); color: #0a0a0a; }

/* ── Plan card grid (for pricing page) ── */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; margin: 30px 0; }
.plan-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 28px; display: flex; flex-direction: column; }
.plan-card.featured { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 20px 50px rgba(201,168,76,0.15); }
.plan-card .name { font-family: 'Cinzel', serif; color: var(--gold); font-size: 26px; margin: 0; }
.plan-card .price { font-family: 'Cinzel', serif; font-size: 42px; color: var(--text); margin: 12px 0 4px; }
.plan-card .price-unit { color: var(--text-muted); font-size: 13px; }
.plan-card .tagline { color: var(--text-muted); font-size: 14px; margin: 14px 0 18px; min-height: 40px; line-height:1.5; }
.plan-card ul { list-style: none; padding: 0; margin: 0 0 22px; flex: 1; }
.plan-card ul li { padding: 8px 0; color: var(--text); font-size: 14px; border-bottom: 1px dashed var(--line); display: flex; gap: 10px; }
.plan-card ul li::before { content: "✓"; color: var(--gold); font-weight: 700; }

/* ── Locked feature banner ── */
.locked-banner { background: rgba(201,168,76,0.08); border: 1px dashed var(--gold-dim); border-radius: 10px; padding: 14px 16px; color: var(--gold-soft); font-size: 13px; line-height:1.5; display: flex; gap: 12px; align-items: center; }
.locked-banner strong { color: var(--gold); }
.locked-banner a { color: var(--gold); text-decoration: underline; }

/* ── Color palette swatches ── */
.palette-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.palette-swatch { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 10px; cursor: pointer; transition: border-color 0.15s, transform 0.15s; font: inherit; color: var(--text); text-align: left; }
.palette-swatch:hover { border-color: var(--gold-dim); transform: translateY(-1px); }
.palette-swatch.selected { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.palette-swatch .dot { width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; border: 1px solid rgba(255,255,255,0.2); }
.palette-swatch .lbl { font-size: 13px; }
@media (max-width: 880px) {
  .palette-grid { grid-template-columns: repeat(2, 1fr); }
}


/* ── Mobile compatibility (iOS + Android) ── */
* { -webkit-tap-highlight-color: transparent; }
html, body { overscroll-behavior-y: none; }
button, a, [role="button"], .btn, input[type="submit"] { touch-action: manipulation; }
input, textarea, select { font-size: 16px; }
@supports (padding: env(safe-area-inset-bottom)) {
  .save-bar { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .topbar { padding-top: calc(16px + env(safe-area-inset-top)); }
}

/* ── Comp Center cards ── */
.comp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}
.comp-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px 22px 18px;
  overflow: hidden;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.comp-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 80% at 0% 0%, rgba(201,168,76,0.10), transparent 55%);
  pointer-events: none;
}
.comp-card:hover { transform: translateY(-2px); border-color: rgba(201,168,76,0.45); }
.comp-card.comp-premium { border-color: rgba(201,168,76,0.55); box-shadow: 0 0 0 1px rgba(201,168,76,0.15) inset; }
.comp-card__head { position: relative; z-index: 1; margin-bottom: 18px; }
.comp-card__tier-pill {
  display: inline-block;
  background: rgba(201,168,76,0.14);
  color: var(--gold);
  border: 1px solid rgba(201,168,76,0.35);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.comp-card h3 {
  font-family: 'Cinzel', serif;
  color: var(--gold);
  margin: 0 0 8px;
  font-size: 22px;
}
.comp-card__desc {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.55;
  margin: 0;
}
.comp-card__foot { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 6px; }
.comp-card__btn {
  width: 100%;
  background: linear-gradient(135deg, #5dd39e, #3a9d6e);
  color: #0a0a0a;
  border: none;
  padding: 13px 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.comp-card__btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.comp-card__btn:disabled { opacity: 0.6; cursor: not-allowed; }
.comp-card__note {
  display: block;
  text-align: center;
  color: var(--text-muted);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Grant Comp modal — pre-styled artist picker list */
#grantCompArtistSelect option {
  padding: 8px 10px;
  background: var(--surface-2);
  color: var(--text);
}
#grantCompArtistSelect option:checked {
  background: rgba(201,168,76,0.18);
  color: var(--gold);
}

/* ── Auth helpers (signup + login UX polish) ── */
.auth-helper {
  color: var(--text-muted);
  font-size: 12.5px;
  text-align: center;
  margin: 10px 0 0;
  line-height: 1.5;
}
.auth-signup-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 18px 0 4px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(201,168,76,0.05);
  font-size: 13px;
  color: var(--text-muted);
}
.auth-signup-link {
  color: var(--gold) !important;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: color 0.15s ease;
}
.auth-signup-link:hover { color: var(--gold-soft) !important; }
.auth-tos-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 12px;
  margin-bottom: 4px;
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
  cursor: pointer;
}
.auth-tos-row input[type="checkbox"] {
  flex: 0 0 16px;
  margin-top: 2px;
  accent-color: var(--gold);
  width: 16px;
  height: 16px;
}

/* ── Save button "is-saved" green flash ── */
.btn-primary.is-saved,
button[type="submit"].is-saved {
  background: linear-gradient(135deg, #5dd39e, #3a9d6e) !important;
  color: #0a0a0a !important;
  border-color: #3a9d6e !important;
  box-shadow: 0 0 0 2px rgba(93,211,158,0.25) !important;
  transform: translateY(-1px);
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-primary[data-state="saving"],
button[type="submit"][data-state="saving"] {
  opacity: 0.85;
  cursor: progress;
}

/* ── Shopify product rows ── */
.shopify-row + .shopify-row { margin-top: 4px; }
.shopify-row .card-row { margin-bottom: 8px; }
.shopify-row select { width: 100%; }

/* ── Template tier badges + locked overlay ── */
.tpl-tier-badge {
  display: inline-block;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.tpl-tier-badge.badge-basic    { background: rgba(154, 148, 138, 0.22); color: #d4cfc4; border: 1px solid rgba(154,148,138,0.4); }
.tpl-tier-badge.badge-standard { background: rgba(201, 168, 76, 0.18); color: #e6c875; border: 1px solid rgba(201,168,76,0.45); }
.tpl-tier-badge.badge-premium  { background: linear-gradient(135deg, rgba(201,168,76,0.30), rgba(230,200,117,0.20)); color: #f0d785; border: 1px solid #C9A84C; box-shadow: 0 0 14px rgba(201,168,76,0.25); }
.tpl-tier-badge--locked { opacity: 0.85; }

.tpl-card { position: relative; transition: transform 0.18s ease, border-color 0.18s ease; }
.tpl-card.tpl-card--locked .thumb { filter: saturate(0.55) brightness(0.65); }
.tpl-card__lock-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, rgba(0,0,0,0.4), rgba(0,0,0,0.7));
  color: #ffe9b3;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
}
.tpl-card__lock-overlay span { background: rgba(201,168,76,0.92); color: #0a0a0a; padding: 8px 14px; border-radius: 999px; }

/* ── Tour rows ── */
.tour-row + .tour-row { margin-top: 4px; }
.tour-row .card-row { margin-bottom: 8px; }
.tour-row select, .tour-row input { width: 100%; }

/* ── Affiliates panel ── */
.aff-subtab { background: transparent; color: var(--text-muted); border: none; border-bottom: 2px solid transparent; padding: 10px 14px; cursor: pointer; font-weight: 600; font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; transition: all 0.15s; }
.aff-subtab:hover { color: #f5f3ee; }
.aff-subtab.is-active { color: var(--gold); border-bottom-color: var(--gold); }
.btn-sm { padding: 5px 11px !important; font-size: 11px !important; letter-spacing: 0.04em !important; }
.aff-status-pill { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.aff-status-pill.pending { background: rgba(255,180,90,0.15); color: #ffba5a; border: 1px solid rgba(255,180,90,0.4); }
.aff-status-pill.approved { background: rgba(120,220,140,0.13); color: #7be08d; border: 1px solid rgba(120,220,140,0.4); }
.aff-status-pill.rejected { background: rgba(255,107,107,0.15); color: #ff8585; border: 1px solid rgba(255,107,107,0.4); }
.aff-status-pill.suspended { background: rgba(150,150,150,0.15); color: #b0b0b0; border: 1px solid rgba(150,150,150,0.4); }
.pay-pill { display: inline-block; padding: 3px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.pay-pill.unpaid { background: rgba(255,180,90,0.12); color: #ffba5a; }
.pay-pill.pending { background: rgba(100,180,255,0.12); color: #7ec3ff; }
.pay-pill.paid { background: rgba(120,220,140,0.13); color: #7be08d; }
.pay-pill.paid_clawback { background: rgba(255,107,107,0.15); color: #ff8585; }
.ref-status-pill.active { color: #7be08d; }
.ref-status-pill.cancelled, .ref-status-pill.refunded { color: #ff8585; text-decoration: line-through; }
.ref-status-pill.upgraded { color: #7ec3ff; }
