/* =============================================
   FRILAS — app.css v2.0 (redesign completo)
   ============================================= */

/* ── TOKENS ── */
:root {
  --bg: #f4f5f9;
  --surface: #ffffff;
  --panel: #ffffff;
  --panel-strong: #f0f4ff;
  --text: #111827;
  --muted: #6b7280;
  --accent: #7c5cff;
  --accent-2: #10d8c4;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --danger: #dc2626;
  --ok: #16a34a;
  --warning: #d97706;
  --sidebar-bg: #18192a;
  --sidebar-text: #c9cde0;
  --sidebar-active: rgba(124, 92, 255, .18);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow: 0 4px 16px rgba(0,0,0,.08), 0 1px 4px rgba(0,0,0,.04);
  --shadow-lg: 0 20px 60px rgba(0,0,0,.12);
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Helvetica, Arial, sans-serif;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); }
a { color: inherit; text-decoration: none; }
p { color: var(--muted); line-height: 1.7; margin: 0 0 12px; }
p:last-child { margin-bottom: 0; }
h1,h2,h3,h4 { margin: 0 0 10px; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 6vw, 4.8rem); line-height: .96; }
h2 { font-size: clamp(1.6rem, 4vw, 3.2rem); line-height: 1.1; }
h3 { font-size: 1.15rem; }
ul { padding-left: 20px; color: var(--muted); line-height: 1.9; }
main { width: 100%; }

/* ── TYPOGRAPHY ── */
.eyebrow {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--accent);
  margin-bottom: 8px;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: var(--radius);
  padding: 11px 20px;
  background: var(--accent);
  color: #fff;
  font-size: .92rem;
  font-weight: 700;
  cursor: pointer;
  transition: filter .15s, transform .1s;
  white-space: nowrap;
  min-height: 42px;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.98); }
.btn.small { padding: 7px 14px; min-height: 34px; font-size: .84rem; border-radius: 8px; }
.btn.ghost {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-sm);
}
.btn.ghost:hover { background: var(--bg); filter: none; }
.btn.danger { background: var(--danger); }
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: .85rem;
  transition: background .12s, color .12s;
}
.btn-icon:hover { background: var(--bg); color: var(--text); }
.btn-icon.danger:hover { background: #fef2f2; color: var(--danger); border-color: #fecaca; }

/* ── SITE HEADER (pública) ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(18px, 5vw, 72px);
  background: rgba(255,255,255,.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1rem;
}
.brand-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  font-size: .9rem;
}
nav { display: flex; align-items: center; gap: 20px; }
nav a { color: var(--muted); font-size: .9rem; transition: color .12s; }
nav a:hover { color: var(--text); }

/* ── HERO ── */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(240px, .7fr);
  gap: 48px;
  align-items: center;
  padding: 72px clamp(18px, 6vw, 96px) 80px;
}
.landing-hero {
  background: linear-gradient(150deg, #fafbff 0%, #f0f4ff 50%, #f5fffe 100%);
  position: relative;
  overflow: hidden;
}
.landing-hero::before {
  content: "";
  position: absolute;
  inset: auto -8% -30% auto;
  width: 52%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124,92,255,.12), rgba(16,216,196,.1));
  filter: blur(6px);
}
.landing-hero > * { position: relative; z-index: 1; }
.hero-copy > p { font-size: 1.1rem; max-width: 640px; }
.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}
.hero-points span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(124,92,255,.08);
  color: #5b3fff;
  font-size: .82rem;
  font-weight: 700;
}
.hero-points span::before { content: "✓"; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

/* Bio showcase */
.bio-showcase {
  position: relative;
  min-height: 480px;
  display: grid;
  place-items: center;
}
.phone-preview { width: min(340px, 100%); text-align: center; }
.bio-card {
  border-radius: 28px;
  padding: 28px 20px;
  background: linear-gradient(160deg, #14151f, #1e1535 55%, #0f1f3e);
  color: #fff;
  box-shadow: 0 28px 80px rgba(0,0,0,.22);
}
.bio-card p { color: #b8c0d4; }
.phone-preview .avatar, .profile-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  margin: 0 auto 16px;
  background: linear-gradient(135deg, #7c5cff, #10d8c4);
  object-fit: cover;
}
.phone-preview span {
  display: block;
  margin: 10px 0;
  padding: 13px 16px;
  border-radius: 12px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.12);
  font-size: .9rem;
  transition: background .15s;
}
.mini-card {
  position: absolute;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,.95);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  font-weight: 800;
  font-size: .85rem;
  backdrop-filter: blur(12px);
}
.mini-card-a { right: 0; top: 64px; }
.mini-card-b { left: 6px; bottom: 60px; }

/* ── PROOF BAND ── */
.proof-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 0;
  background: var(--sidebar-bg);
  color: #fff;
}
.proof-band article {
  padding: 20px 24px;
  border-right: 1px solid rgba(255,255,255,.08);
  text-align: center;
}
.proof-band article:last-child { border-right: 0; }
.proof-band strong { display: block; font-size: 1.25rem; margin-bottom: 4px; }
.proof-band span { color: #94a3b8; font-size: .85rem; }

/* ── SECTIONS ── */
.section { padding: 72px clamp(18px, 6vw, 96px); }
.section-title { text-align: center; max-width: 720px; margin: 0 auto 32px; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0,1fr)); }

/* Cards de template */
.template-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.template-card {
  min-height: 260px;
  border-radius: var(--radius-xl);
  padding: 20px;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.template-card span {
  width: max-content;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  font-size: .78rem;
  font-weight: 700;
}
.template-card p { color: rgba(255,255,255,.75); }
.template-card.creator  { background: linear-gradient(145deg, #7c5cff, #10d8c4); }
.template-card.business { background: linear-gradient(145deg, #18192a, #f97316); }
.template-card.portfolio{ background: linear-gradient(145deg, #eff6ff, #1e293b); }

/* Split section */
.split-section {
  display: grid;
  grid-template-columns: minmax(240px, .75fr) minmax(0, 1.25fr);
  gap: 40px;
  align-items: start;
  background: var(--surface);
}
.feature-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.feature-list article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.feature-list article h3 { font-size: 1rem; margin-bottom: 6px; }

/* Themes section */
.themes-section { background: #f8faff; }
.theme-card { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px; background: var(--surface); box-shadow: var(--shadow-sm); }
.theme-preview {
  height: 130px;
  border-radius: 10px;
  margin-bottom: 14px;
  padding: 14px;
  display: grid;
  gap: 8px;
}
.theme-preview span { display: block; border-radius: 999px; height: 18px; background: rgba(255,255,255,.65); }
.theme-card.aurora .theme-preview { background: linear-gradient(135deg, #7c5cff, #10d8c4); }
.theme-card.neon   .theme-preview { background: linear-gradient(135deg, #030712, #00d4ff); }
.theme-card.luxe   .theme-preview { background: linear-gradient(135deg, #f8fbff, #e2e8f0); }
.theme-card.luxe .theme-preview span { background: #1e293b; }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
.steps article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.steps strong {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  margin-bottom: 14px;
  font-size: .9rem;
}

/* Testimonials */
.testimonials-section { background: var(--bg); }
blockquote {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
blockquote p { font-size: 1rem; color: var(--text); }
cite { display: block; color: var(--muted); font-style: normal; font-weight: 700; margin-top: 14px; font-size: .88rem; }

/* FAQ */
.faq-list { max-width: 840px; margin: 0 auto; display: grid; gap: 10px; }
.faq-list details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.faq-list summary { cursor: pointer; font-weight: 700; color: var(--text); list-style: none; }
.faq-list summary::after { content: " ▾"; color: var(--accent); }
.faq-list details[open] summary::after { content: " ▴"; }
.faq-list p { margin-top: 10px; }

/* Legal strip */
.legal-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: var(--sidebar-bg);
  color: #fff;
  padding: 40px clamp(18px, 6vw, 96px);
}
.legal-strip p { color: #94a3b8; }
.legal-strip .eyebrow { color: #7c5cff; }

/* ── PRICING ── */
.price-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: box-shadow .2s, transform .2s;
}
.price-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.price-card.featured { border: 2px solid var(--accent); }
.price-card .price-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(124,92,255,.1);
  color: var(--accent);
  font-size: .78rem;
  font-weight: 700;
  margin-bottom: 12px;
}
.price-card strong { display: block; font-size: 2.2rem; margin: 14px 0; }
.price-card small { font-size: .85rem; color: var(--muted); font-weight: 400; }

/* ── AUTH ── */
.auth-wrap {
  min-height: calc(100vh - 66px);
  display: grid;
  place-items: center;
  padding: 32px 18px;
  background: var(--bg);
}
.auth-card {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--shadow-lg);
}
.auth-card h1 { font-size: 1.7rem; margin-bottom: 4px; }
.auth-subtitle { font-size: .9rem; color: var(--muted); margin-bottom: 24px; }
.auth-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  font-weight: 800;
  font-size: .95rem;
}

/* Social login */
.social-btns { display: flex; gap: 10px; margin-bottom: 16px; }
.social-btn {
  flex: 1;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: background .12s;
}
.social-btn:hover { background: var(--bg); }
.social-btn svg { width: 16px; height: 16px; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--muted);
  font-size: .82rem;
}
.auth-divider::before, .auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* Form shared */
.form-field { margin-bottom: 14px; }
.form-field label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .82rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 5px;
}
.form-field label a { color: var(--accent); font-size: .8rem; }
.form-field input, .form-field select, .form-field textarea,
.auth-card input, .auth-card select,
.form input, .form select, .form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  padding: 10px 12px;
  font-size: .9rem;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus,
.auth-card input:focus,
.form input:focus, .form select:focus, .form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124,92,255,.12);
}
.form-field textarea { resize: vertical; }
.btn-full {
  width: 100%;
  padding: 11px;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: var(--radius);
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 4px;
  transition: filter .15s;
}
.btn-full:hover { filter: brightness(1.08); }
.auth-footer { text-align: center; font-size: .85rem; color: var(--muted); margin-top: 18px; }
.auth-footer a { color: var(--accent); font-weight: 600; }

/* ── FLASH ── */
.flash {
  position: fixed;
  top: 78px;
  right: 20px;
  z-index: 99;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  font-size: .9rem;
  max-width: 340px;
  animation: slideIn .25s ease;
}
@keyframes slideIn { from { opacity:0; transform: translateX(20px); } to { opacity:1; transform: none; } }
.flash.success { border-left: 3px solid var(--ok); }
.flash.error   { border-left: 3px solid var(--danger); }

/* captcha */
.captcha-field {
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--panel-strong);
  font-size: .85rem;
}
.captcha-field span {
  display: inline-flex;
  margin: 6px 0 2px;
  padding: 5px 10px;
  border-radius: 8px;
  background: #fff;
  font-weight: 800;
}

/* ── APP SHELL (dashboard) ── */
.app-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 18px 12px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  border-right: 1px solid rgba(255,255,255,.06);
  overflow-y: auto;
}
.sidebar .brand {
  padding: 6px 8px 18px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  color: #fff;
}
.sidebar a:not(.brand) {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--sidebar-text);
  font-size: .9rem;
  transition: background .12s, color .12s;
}
.sidebar a:not(.brand):hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar a.active { background: var(--sidebar-active); color: #a78bfa; font-weight: 600; }
.sidebar a .icon {
  font-size: 1rem;
  opacity: .75;
  flex-shrink: 0;
}
.sidebar-bottom {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.08);
}

/* ── WORKSPACE ── */
.workspace {
  padding: 28px 32px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}
.page-head h1 { font-size: clamp(1.5rem, 4vw, 2.4rem); margin-bottom: 0; }
.page-head .page-head-actions { display: flex; gap: 8px; align-items: center; }

/* ── METRIC CARDS ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.stat .stat-label { font-size: .78rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; }
.stat .stat-value { font-size: 2rem; font-weight: 800; margin-bottom: 4px; }
.stat .stat-delta { font-size: .78rem; color: var(--ok); font-weight: 600; }
.stat .stat-delta.neutral { color: var(--muted); }
.stat .stat-delta.down { color: var(--danger); }

/* ── GLASS CARDS ── */
.glass {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}
.glass h2 { font-size: 1rem; font-weight: 700; margin-bottom: 14px; }

/* ── DASHBOARD GRID ── */
.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; margin-bottom: 20px; }
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.row:last-child { border-bottom: 0; }

/* Bar chart inline */
.bar-track {
  flex: 1;
  height: 5px;
  background: var(--bg);
  border-radius: 3px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
}

/* QR */
.qr {
  width: 148px;
  height: 148px;
  margin: 14px 0;
  border-radius: 12px;
  background: #fff;
  padding: 10px;
  background-size: calc(100% - 20px);
  background-position: center;
  background-repeat: no-repeat;
  border: 1px solid var(--line);
}

/* ── LINKS MANAGER ── */
.links-toolbar {
  display: grid;
  grid-template-columns: 1fr 1.8fr auto auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 18px;
}
.links-toolbar input, .links-toolbar select {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: .88rem;
}
.link-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  margin-bottom: 8px;
  transition: box-shadow .15s;
}
.link-card:hover { box-shadow: var(--shadow); }
.drag-handle { color: var(--muted); cursor: grab; font-size: 1.1rem; flex-shrink: 0; }
.drag-handle:active { cursor: grabbing; }
.link-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.link-info { flex: 1; min-width: 0; }
.link-title { font-size: .92rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-url { font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-badge {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  flex-shrink: 0;
}
.link-badge.active   { background: #f0fdf4; color: #15803d; }
.link-badge.inactive { background: var(--bg); color: var(--muted); }
.link-actions { display: flex; gap: 5px; }

/* Inline edit form (hidden by default, toggled by JS) */
.link-edit-row {
  display: none;
  background: var(--bg);
  border-radius: var(--radius);
  padding: 12px;
  margin-top: 8px;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.link-edit-row.open { display: flex; }
.link-edit-row input, .link-edit-row select {
  flex: 1;
  min-width: 120px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: .86rem;
}

/* ── ANALYTICS ── */
.chart-bars {
  height: 180px;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding-top: 16px;
}
.chart-bars > div {
  flex: 1;
  display: grid;
  align-items: end;
  gap: 4px;
  height: 100%;
  text-align: center;
  color: var(--muted);
  font-size: .7rem;
}
.chart-bars span {
  display: block;
  height: var(--h, 20%);
  border-radius: 6px 6px 3px 3px;
  background: var(--accent);
  opacity: .82;
  transition: opacity .2s;
}
.chart-bars > div:hover span { opacity: 1; }
.period-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg);
  border-radius: var(--radius);
  padding: 3px;
}
.period-tab {
  padding: 5px 12px;
  border-radius: 7px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border: 0;
  background: transparent;
  transition: background .12s, color .12s;
}
.period-tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ── PROFILE EDITOR ── */
.profile-editor-grid {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 20px;
  align-items: start;
}
.form { display: grid; gap: 0; }
.form.wide { max-width: 1100px; }
.form-section { margin-bottom: 20px; }
.form-section-title {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}
.form-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.form-label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 5px;
}
.form-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .82rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 5px;
}
.form-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: .88rem;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124,92,255,.1);
}
textarea.form-input { resize: vertical; }
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .88rem;
  cursor: pointer;
}
.check input { width: auto; }

/* Color picker */
.color-field span {
  display: grid;
  grid-template-columns: 88px 1fr;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
}
.color-field input[type=color] {
  width: 88px !important;
  height: 48px !important;
  padding: 3px !important;
  border: 0 !important;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}
.color-field input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.color-field input[type=color]::-webkit-color-swatch { border: 1px solid var(--line); border-radius: 7px; }
.color-field strong { font-size: .86rem; color: var(--text); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }

/* Live preview */
.live-preview {
  position: sticky;
  top: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 16px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.live-preview-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin-bottom: 12px;
}
.phone-frame {
  width: 140px;
  height: 260px;
  border: 2px solid var(--line-strong);
  border-radius: 26px;
  overflow: hidden;
  margin: 0 auto;
  background: linear-gradient(160deg, #14151f, #1e1535);
  position: relative;
  padding: 14px 10px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}
.phone-frame::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 5px;
  background: rgba(255,255,255,.15);
  border-radius: 3px;
}
.phone-avatar-sm {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c5cff, #10d8c4);
  margin-top: 8px;
}
.phone-username { font-size: 9px; font-weight: 700; color: #fff; }
.phone-bio-sm   { font-size: 7px; color: rgba(255,255,255,.55); text-align: center; }
.phone-btn-sm {
  width: 100%;
  padding: 5px 0;
  background: rgba(124,92,255,.28);
  border: 1px solid rgba(124,92,255,.4);
  border-radius: 7px;
  font-size: 7px;
  color: #c4b5fd;
  text-align: center;
}
.phone-socials-sm {
  display: flex;
  gap: 5px;
}
.phone-socials-sm span {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5.5px;
  color: rgba(255,255,255,.7);
}

/* ── PROFILE PREVIEW IFRAME ── */
.profile-preview {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(260px, 1.2fr);
  gap: 16px;
  margin-bottom: 20px;
  align-items: center;
}
.profile-preview h2 { font-size: 1.1rem; word-break: break-word; }
.profile-preview iframe {
  width: 100%;
  height: 480px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: #fff;
}

/* ── ADMIN ── */
.admin-mode .sidebar .brand { background: transparent; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; font-size: .9rem; }
th { color: var(--muted); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; background: var(--bg); }
.table-wrap { overflow: auto; border-radius: var(--radius-lg); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.actions-cell { display: flex; flex-wrap: wrap; gap: 6px; }
.actions-cell form { display: flex; gap: 6px; }
.actions-cell select {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  font-size: .84rem;
}
.status-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
}
.status-badge.active   { background: #f0fdf4; color: #15803d; }
.status-badge.suspended{ background: #fef2f2; color: #b91c1c; }

/* Inline / legacy forms */
.inline-form { grid-template-columns: 1.1fr 1.8fr 0.7fr auto auto; align-items: end; display: grid; gap: 10px; }
.stack { display: grid; gap: 12px; margin-top: 16px; }
.link-editor { display: grid; grid-template-columns: 80px 1fr 1.5fr 0.7fr auto auto auto; gap: 10px; align-items: center; }

/* ── PUBLIC PROFILE ── */
.public-profile-body { background: #0d1018; }
.public-profile {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
  color: #fff;
}
.public-card {
  width: min(460px, 100%);
  text-align: center;
}
.public-card h1 { font-size: 2rem; }
.public-bio { margin-bottom: 6px; }
.public-description { white-space: normal; margin: 0 auto 16px; max-width: 420px; font-size: .96rem; }
.public-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0;
}
.public-share {
  border: 0;
  border-radius: 999px;
  padding: 9px 14px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  font-size: .88rem;
  box-shadow: 0 10px 24px rgba(0,0,0,.16);
}
.public-share.secondary {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.25);
  color: inherit;
}
.socials { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.socials a {
  font-size: .82rem;
  padding: 7px 9px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  color: rgba(255,255,255,.8);
}
.social-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  font-weight: 900;
  font-size: .78rem;
  color: #fff;
  border: 0;
  background: rgba(255,255,255,.14);
  box-shadow: 0 8px 20px rgba(0,0,0,.12);
}
.social-instagram{ background: linear-gradient(135deg, #f58529, #dd2a7b, #8134af) !important; }
.social-tiktok   { background: #111 !important; }
.social-youtube  { background: #ff0033 !important; }
.social-x        { background: #000 !important; }
.social-linkedin { background: #0a66c2 !important; }

.public-links { display: grid; gap: 10px; margin-top: 20px; }
.public-link {
  display: block;
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  font-weight: 800;
  background: color-mix(in srgb, var(--accent), transparent 14%);
  color: #fff;
  box-shadow: 0 14px 28px rgba(0,0,0,.2);
  text-align: center;
  transition: transform .15s, box-shadow .15s;
}
.public-link:hover { transform: translateY(-2px); box-shadow: 0 20px 36px rgba(0,0,0,.28); }
.public-link.glass { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); backdrop-filter: blur(14px); }
.public-link.solid { background: var(--accent); }
.public-link.outline { background: transparent; border: 2px solid var(--accent); color: var(--accent); }
.powered {
  display: block;
  width: max-content;
  max-width: 100%;
  margin: 24px auto 0;
  color: rgba(255,255,255,.35);
  text-align: center;
  font-size: .82rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Share modal */
.share-modal[hidden] { display: none; }
.share-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(8px);
}
.share-dialog {
  position: relative;
  width: min(400px, 100%);
  padding: 28px;
  border-radius: var(--radius-xl);
  background: #fff;
  color: #111827;
  text-align: center;
  box-shadow: 0 28px 80px rgba(0,0,0,.28);
}
.share-dialog h2 { font-size: 1.4rem; }
.share-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 32px; height: 32px;
  border: 0;
  border-radius: 50%;
  background: #f1f5f9;
  color: #1e293b;
  font-size: 1.2rem;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.share-qr {
  width: 180px; height: 180px;
  margin: 16px auto;
  border-radius: 14px;
  background: #fff;
  padding: 10px;
  border: 1px solid var(--line);
  background-size: calc(100% - 20px);
  background-position: center;
  background-repeat: no-repeat;
}
.share-dialog label { display: grid; gap: 6px; text-align: left; color: var(--muted); font-size: .82rem; font-weight: 700; margin-top: 12px; }
.share-dialog input { width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; color: #172033; background: #f8fafc; font-size: .88rem; }

/* ── THEMES (public profile variants) ── */
.public-profile { background: var(--custom-bg, #10131c); color: var(--custom-text, #fff); }
.public-profile .public-link { background: var(--custom-accent, var(--accent)); color: #fff; }
.public-profile .public-share { background: var(--custom-accent, var(--accent)); }

.public-profile.theme-aurora-glass  { background: radial-gradient(circle at 15% 0, var(--custom-accent,#7c5cff), transparent 28%), linear-gradient(145deg, var(--custom-bg,#10131c), #10d8c4); color: var(--custom-text,#fff); }
.public-profile.theme-noite-neon    { background: radial-gradient(circle at 50% 0, var(--custom-accent,#00d4ff), transparent 24%), linear-gradient(145deg, var(--custom-bg,#030712), #10131c); color: var(--custom-text,#fff); }
.public-profile.theme-minimal-luxe  { background: linear-gradient(145deg, var(--custom-bg,#f8fbff), #e8edf5); color: var(--custom-text,#111827); }
.public-profile.theme-sunset-pop    { background: linear-gradient(145deg, var(--custom-bg,#ff6b6b), #ffd166); color: var(--custom-text,#231f20); }
.public-profile.theme-ocean-blue    { background: radial-gradient(circle at top, var(--custom-accent,#90e0ef), transparent 30%), linear-gradient(145deg, var(--custom-bg,#023e8a), #0096c7); color: var(--custom-text,#fff); }
.public-profile.theme-forest-pro    { background: linear-gradient(145deg, var(--custom-bg,#052e2b), #065f46 55%, #34d399); color: var(--custom-text,#fff); }
.public-profile.theme-candy-creator { background: linear-gradient(145deg, var(--custom-bg,#ff4ecd), #8b5cf6 65%, #38bdf8); color: var(--custom-text,#fff); }
.public-profile.theme-graphite-studio { background: linear-gradient(145deg, var(--custom-bg,#0f172a), #334155); color: var(--custom-text,#fff); }
.public-profile.theme-golden-hour   { background: linear-gradient(145deg, var(--custom-bg,#78350f), #f59e0b 70%, #fde68a); color: var(--custom-text,#fff); }
.public-profile.theme-ruby-dark     { background: radial-gradient(circle at top, var(--custom-accent,#fb7185), transparent 25%), linear-gradient(145deg, var(--custom-bg,#1f0508), #3f0d12); color: var(--custom-text,#fff); }
.public-profile.theme-clean-white   { background: linear-gradient(145deg, var(--custom-bg,#fff), #eff6ff); color: var(--custom-text,#111827); }
.public-profile.theme-purple-haze   { background: linear-gradient(145deg, var(--custom-bg,#312e81), #7c3aed 60%, #c4b5fd); color: var(--custom-text,#fff); }
.public-profile.theme-tropical-fresh{ background: linear-gradient(145deg, var(--custom-bg,#0f766e), #22c55e 60%, #bef264); color: var(--custom-text,#062f2b); }

.public-profile.theme-aurora-glass  .public-card { backdrop-filter: blur(20px); background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22); border-radius: 28px; padding: 28px 20px; }
.public-profile.theme-noite-neon    .public-card { text-align: left; background: rgba(3,7,18,.72); border: 1px solid rgba(0,212,255,.3); border-radius: 18px; padding: 28px 20px; }
.public-profile.theme-noite-neon    .socials { justify-content: flex-start; }
.public-profile.theme-noite-neon    .public-link { border-radius: 8px; text-transform: uppercase; letter-spacing: .04em; }
.public-profile.theme-minimal-luxe  .public-card { box-shadow: none; border-radius: 4px; text-align: left; }
.public-profile.theme-minimal-luxe  .socials { justify-content: flex-start; }
.public-profile.theme-minimal-luxe  .public-link { border-radius: 4px; box-shadow: none; }
.public-profile.theme-minimal-luxe  .profile-avatar { border-radius: 50%; filter: grayscale(1); margin-left: 0; }
.public-profile.theme-sunset-pop    .public-card { transform: rotate(-1deg); border-radius: 28px; }
.public-profile.theme-sunset-pop    .public-link { border-radius: 999px; }
.public-profile.theme-ocean-blue    .public-card { background: rgba(255,255,255,.1); border: 1px solid rgba(202,240,248,.35); border-radius: 22px; padding: 28px 20px; }
.public-profile.theme-graphite-studio .public-card { text-align: left; background: rgba(15,23,42,.85); border-radius: 0; padding: 28px 20px; }
.public-profile.theme-graphite-studio .public-link { border-radius: 0; border-left: 4px solid var(--custom-accent, var(--accent)); }
.public-profile.theme-graphite-studio .socials { justify-content: flex-start; }
.public-profile.theme-golden-hour   .public-link { border-radius: 999px; }
.public-profile.theme-ruby-dark     .public-card { text-align: left; background: rgba(31,5,8,.76); border: 1px solid rgba(253,164,175,.3); border-radius: 20px; padding: 28px 20px; }
.public-profile.theme-ruby-dark     .socials { justify-content: flex-start; }
.public-profile.theme-clean-white   .public-card { text-align: left; background: #fff; border-radius: 16px; padding: 28px 20px; }
.public-profile.theme-clean-white   .socials { justify-content: flex-start; }
.public-profile.theme-purple-haze   .public-card { background: rgba(49,46,129,.48); border-radius: 28px; padding: 28px 20px; }
.public-profile.theme-tropical-fresh .public-card { background: rgba(255,255,255,.36); border-radius: 26px; padding: 28px 20px; }
.public-profile.theme-clean-white .public-card,
.public-profile.theme-minimal-luxe .public-card,
.public-profile.theme-sunset-pop .public-card,
.public-profile.theme-tropical-fresh .public-card { background: rgba(255,255,255,.72); }

/* ── CONTACT / LEGAL ── */
.legal-document { max-width: 960px; }
.legal-head { margin-bottom: 20px; }
.legal-head h1 { font-size: clamp(1.8rem, 5vw, 3.6rem); }
.legal-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-xl); box-shadow: var(--shadow); padding: clamp(20px,4vw,40px); }
.legal-card h2 { font-size: 1.15rem; line-height: 1.25; margin-top: 28px; }
.legal-card h2:first-of-type { margin-top: 14px; }
.legal-card a { color: var(--accent); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .app-shell { grid-template-columns: 200px 1fr; }
}
@media (max-width: 860px) {
  .hero, .split-section, .grid.two, .grid.three,
  .template-grid, .feature-list, .steps, .proof-band,
  .profile-preview, .profile-editor-grid { grid-template-columns: 1fr; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; flex-direction: row; flex-wrap: wrap; padding: 12px; gap: 4px; overflow-x: auto; }
  .sidebar .brand { padding-bottom: 0; border-bottom: 0; margin-bottom: 0; }
  .sidebar-bottom { margin-top: 0; padding-top: 0; border-top: 0; display: contents; }
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  .links-toolbar { grid-template-columns: 1fr 1fr; }
  .inline-form, .link-editor { grid-template-columns: 1fr; }
  .site-header { padding: 12px 18px; }
  .live-preview { display: none; }
}
@media (max-width: 560px) {
  .stats-grid, .dash-grid { grid-template-columns: 1fr; }
  .workspace { padding: 16px; }
  .glass { padding: 14px 16px; }
  .site-header { flex-wrap: wrap; }
  .page-head { flex-wrap: wrap; }
  h1 { font-size: 2.2rem; }
  .hero { padding-top: 32px; }
  .actions .btn { width: 100%; }
  .bio-showcase { min-height: auto; }
  .mini-card { position: static; margin-top: 8px; }
  .profile-preview iframe { height: 380px; }
  .legal-strip { display: grid; }
  .social-btns { flex-direction: column; }
  .auth-card { padding: 24px 18px; }
}
/* =============================================
   MOBILE — versão definitiva
   ============================================= */

/* Nunca vazar horizontalmente */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}

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

/* ── Breakpoint principal: 860px ── */
@media (max-width: 860px) {

  /* App shell: 1 coluna */
  .app-shell {
    grid-template-columns: 1fr;
    overflow-x: hidden;
  }

  /* Sidebar: barra horizontal rolável */
  .sidebar {
    position: relative;
    height: auto;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    padding: 10px 12px;
    gap: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .sidebar::-webkit-scrollbar { display: none; }
  .sidebar .brand { flex-shrink: 0; padding-bottom: 0; border-bottom: 0; margin-bottom: 0; margin-right: 6px; }
  .sidebar a:not(.brand) { padding: 7px 10px; font-size: .8rem; white-space: nowrap; flex-shrink: 0; }
  .sidebar a:not(.brand) .icon { display: none; }
  .sidebar-bottom { margin-top: 0; padding-top: 0; border-top: 0; display: contents; }

  /* Workspace */
  .workspace {
    padding: 14px !important;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
  }

  /* Page head: empilha, botões em linha cheia */
  .page-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    width: 100%;
  }
  .page-head-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
  }
  .page-head-actions > * {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    text-align: center;
    justify-content: center;
  }

  /* Métricas: 2 colunas */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Todos os grids multi-coluna → 1 coluna */
  .dash-grid,
  .grid.two,
  .grid.three,
  .form-grid-2,
  .profile-editor-grid,
  .chart-row,
  .split-section,
  .template-grid,
  .feature-list,
  .steps,
  .proof-band,
  .profile-preview,
  .inline-form,
  .link-editor {
    grid-template-columns: 1fr !important;
  }

  /* Preview lateral some */
  .live-preview { display: none; }

  /* ── LINKS PAGE ── */
  /* Formulário de adicionar link: coluna única */
  .links-toolbar {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    width: 100% !important;
  }
  .links-toolbar > * {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  /* Cards de link */
  .link-card-wrap { width: 100%; max-width: 100%; overflow: hidden; }
  .link-card { width: 100%; max-width: 100%; overflow: hidden; gap: 8px; padding: 10px 12px; }
  .link-url { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .link-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 130px; }

  /* Glass cards */
  .glass { max-width: 100%; overflow: hidden; }

  /* Inputs, selects, textareas, buttons */
  input, select, textarea, button, .btn, .btn-full {
    max-width: 100%;
  }

  /* Hero */
  .hero { grid-template-columns: 1fr !important; padding-top: 32px; }
  .bio-showcase { min-height: auto; }
  .mini-card { position: static; display: inline-block; margin: 4px; }

  /* Proof band 2 colunas */
  .proof-band { grid-template-columns: repeat(2, 1fr) !important; }
  .proof-band article { border-right: 0; border-bottom: 1px solid rgba(255,255,255,.08); }

  /* Site header */
  .site-header { flex-wrap: wrap; gap: 10px; padding: 12px 16px; }
  .site-header nav { flex-wrap: wrap; gap: 8px; }

  /* Auth */
  .auth-card { padding: 24px 16px; }

  /* Admin grids */
  [style*="grid-template-columns: 1fr 320px"],
  [style*="grid-template-columns: 1fr 340px"],
  [style*="grid-template-columns: 1fr 300px"] {
    display: block !important;
  }
}

/* ── Breakpoint estreito: 480px ── */
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr !important; }
  .proof-band { grid-template-columns: 1fr !important; }

  .page-head-actions > * { flex: 1 1 100%; }

  .link-card { gap: 6px; padding: 9px 10px; }
  .link-url { max-width: 90px; }
  .link-title { max-width: 100px; }

  /* Esconder botão analytics no card (fica apertado) */
  .link-actions a.btn-icon { display: none; }

  h1 { font-size: 1.8rem; }

  .actions { flex-direction: column; }
  .actions .btn { width: 100%; justify-content: center; }

  .social-btns { flex-direction: column; }
}

/* ── Add link form ── */
.add-link-form {
  display: grid;
  grid-template-columns: 1fr 1.6fr auto auto auto;
  gap: 10px;
  align-items: center;
}

/* Link edit row form */
.link-edit-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 12px;
  background: var(--bg);
  border-radius: var(--radius);
}
.link-edit-form .form-input { flex: 1; min-width: 120px; }
.link-edit-form .check { white-space: nowrap; font-size: .84rem; }

/* Link card margin */
.link-card-wrap { margin-bottom: 8px; }

/* Mobile: tudo em coluna */
@media (max-width: 860px) {
  .add-link-form {
    grid-template-columns: 1fr !important;
  }
  .add-link-form > * {
    width: 100% !important;
    max-width: 100% !important;
  }
  .link-edit-form { flex-direction: column; }
  .link-edit-form .form-input,
  .link-edit-form select,
  .link-edit-form .btn { width: 100% !important; }
}

/* =============================================
   MOBILE FIXES v2.5 — links + analytics
   ============================================= */
@media (max-width: 860px) {

  /* PAGE HEAD — título e botão em coluna */
  .page-head {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  .page-head > div:first-child { width: 100%; }
  .page-head-actions {
    display: flex !important;
    width: 100% !important;
  }
  .page-head-actions > * {
    flex: 1 !important;
    width: 100% !important;
    text-align: center !important;
    justify-content: center !important;
  }

  /* ADD LINK FORM — coluna única, botão 100% */
  .add-link-form {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    width: 100% !important;
  }
  .add-link-form > * {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  /* LINK CARDS — badge e botões sempre visíveis, sem overflow */
  .link-card {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 10px 12px !important;
    width: 100% !important;
    overflow: hidden !important;
  }
  .link-icon { flex-shrink: 0 !important; }
  .link-info { flex: 1 !important; min-width: 0 !important; overflow: hidden !important; }
  .link-title { font-size: .85rem !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .link-url   { font-size: .75rem !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .link-badge { flex-shrink: 0 !important; font-size: .7rem !important; padding: 2px 6px !important; }
  .link-actions { flex-shrink: 0 !important; display: flex !important; gap: 4px !important; }
  .drag-handle { flex-shrink: 0 !important; }

  /* ANALYTICS — stats em 2 colunas */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* ANALYTICS — period tabs não vaza */
  .period-tabs {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
    width: 100% !important;
  }
  .period-tab {
    flex: 1 !important;
    text-align: center !important;
    white-space: nowrap !important;
  }

  /* ANALYTICS page-head com tabs embaixo do título */
  .page-head .period-tabs {
    width: 100% !important;
  }
}

@media (max-width: 480px) {
  /* Em telas muito pequenas, stats em 1 coluna */
  .stats-grid { grid-template-columns: 1fr !important; }
}

/* ── Themes showcase grid ── */
.themes-showcase-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 16px;
}

.theme-mockup-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: transform .15s, box-shadow .15s;
}
.theme-mockup-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

.theme-mockup-preview {
  padding: 16px 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: 180px;
}

.tmc-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,.25);
  border: 2px solid;
  margin-bottom: 2px;
}
.tmc-name { font-size: .75rem; font-weight: 700; }
.tmc-bio  { font-size: .65rem; }
.tmc-btn  {
  width: 100%;
  padding: 5px 8px;
  border-radius: 7px;
  border: 1px solid;
  font-size: .65rem;
  font-weight: 700;
  text-align: center;
}

.theme-mockup-info {
  padding: 10px 12px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.theme-mockup-info strong { font-size: .85rem; }
.theme-mockup-info span   { font-size: .75rem; color: var(--muted); }

@media (max-width: 1024px) {
  .themes-showcase-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 680px) {
  .themes-showcase-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 400px) {
  .themes-showcase-grid { grid-template-columns: 1fr; }
}

/* =============================================
   AUTH SPLIT LAYOUT
   ============================================= */

/* Remove old auth-wrap centering for split pages */
.auth-split ~ * { display: none; }

.auth-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: calc(100vh - 66px);
}

/* Left panel — gradient brand */
.auth-brand-panel {
  background: linear-gradient(145deg, #10131c, #1e1535);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
}
.auth-brand-inner {
  max-width: 320px;
  width: 100%;
}

/* Right panel — form */
.auth-form-panel {
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
}
.auth-form-inner {
  max-width: 380px;
  width: 100%;
}

/* Auth fields */
.auth-field {
  margin-bottom: 16px;
}
.auth-field label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .82rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}
.auth-field label a {
  color: var(--accent);
  font-size: .8rem;
  font-weight: 600;
}
.auth-field input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-size: .92rem;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  box-sizing: border-box;
}
.auth-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124,92,255,.12);
  background: var(--surface);
}

/* Captcha inside auth */
.auth-form-inner .captcha-field {
  margin-bottom: 16px;
}

/* Full-width submit button */
.btn-full {
  width: 100%;
  padding: 13px;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: var(--radius);
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  transition: filter .15s;
  margin-top: 4px;
}
.btn-full:hover { filter: brightness(1.08); }

/* Mobile: stack vertically */
@media (max-width: 860px) {
  .auth-split {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .auth-brand-panel {
    padding: 32px 24px;
    min-height: auto;
  }
  .auth-brand-inner { max-width: 100%; }
  .auth-form-panel { padding: 32px 24px; }
  .auth-form-inner { max-width: 100%; }
}

/* ── Plans grid ── */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.plan-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: box-shadow .2s, transform .15s;
}
.plan-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.plan-card.plan-current {
  border: 2px solid var(--accent);
}

.plan-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  width: fit-content;
}
.plan-badge-active  { background: #f0fdf4; color: #15803d; }
.plan-badge-upgrade { background: #ede9fe; color: #6d28d9; }

.plan-feature {
  font-size: .85rem;
  display: flex;
  align-items: center;
  gap: 6px;
}
.plan-feature-off { color: var(--muted); text-decoration: line-through; }

@media (max-width: 600px) {
  .plans-grid { grid-template-columns: 1fr; }
}

/* ── Admin mobile ── */
@media (max-width: 860px) {
  /* Admin grids → single column */
  [style*="grid-template-columns: 1fr 280px"],
  [style*="grid-template-columns: 1fr 300px"],
  [style*="grid-template-columns: 1fr 320px"],
  [style*="grid-template-columns: 1fr 340px"],
  [style*="grid-template-columns: 1fr 1fr"],
  [style*="grid-template-columns: 1fr 1.25fr"] {
    display: flex !important;
    flex-direction: column !important;
  }

  /* Admin stats grid 2 cols */
  .admin-mode .stats-grid {
    grid-template-columns: repeat(2,1fr) !important;
  }

  /* Table horizontal scroll */
  .table-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  .table-wrap table {
    min-width: 600px;
  }
}
