/* ═══════════════════════════════════════════════════
   LINKERS — Design System · Stripe-inspired
   Font: Sora (display) + DM Sans (body)
═══════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

/* ── Variables ─────────────────────────────────── */
:root {
  --bg:          #0a0e1a;
  --bg2:         #0f1526;
  --surface:     #151d30;
  --surface2:    #1a2540;
  --border:      rgba(255,255,255,.07);
  --border2:     rgba(255,255,255,.12);

  --text:        #f1f5f9;
  --text2:       #94a3b8;
  --text3:       #64748b;

  --accent:      #00e5a0;
  --accent2:     #00b87e;
  --accent-dim:  rgba(0,229,160,.10);
  --accent-glow: rgba(0,229,160,.20);

  --blue:        #3b82f6;
  --blue-dim:    rgba(59,130,246,.12);
  --purple:      #a855f7;
  --purple-dim:  rgba(168,85,247,.12);
  --yellow:      #f59e0b;
  --yellow-dim:  rgba(245,158,11,.12);
  --red:         #f43f5e;
  --red-dim:     rgba(244,63,94,.12);

  --radius:      12px;
  --radius-lg:   18px;
  --radius-sm:   8px;
  --shadow:      0 4px 24px rgba(0,0,0,.4);
  --shadow-lg:   0 8px 48px rgba(0,0,0,.6);

  --font-display: 'Sora', sans-serif;
  --font-body:    'DM Sans', sans-serif;
  --font-mono:    'SF Mono', 'Fira Code', monospace;

  --sidebar-w:   240px;
  --topbar-h:    64px;
}

/* ── Reset ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; transition: opacity .15s; }
a:hover { opacity: .8; }

button { cursor: pointer; font-family: var(--font-body); }

input, select, textarea {
  font-family: var(--font-body);
  font-size: .9rem;
  color: var(--text);
  background: var(--surface2);
  border: 1.5px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  outline: none;
  width: 100%;
  transition: border-color .15s, box-shadow .15s;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

select option { background: var(--surface); }

/* ── Layout: sidebar + main ────────────────────── */
.lk-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ────────────────────────────────────── */
.lk-sidebar {
  width: var(--sidebar-w);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform .25s ease;
}

.lk-sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.lk-logo-mark {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--accent), var(--blue));
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 800; color: #0a0e1a;
  font-family: var(--font-display);
  flex-shrink: 0;
}

.lk-logo-text {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
}

.lk-logo-text span { color: var(--accent); }

.lk-nav {
  flex: 1;
  padding: 12px 12px;
  overflow-y: auto;
}

.lk-nav-section {
  font-size: 10px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 16px 8px 6px;
}

.lk-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text2);
  font-size: .88rem;
  font-weight: 500;
  transition: all .15s;
  position: relative;
  margin-bottom: 2px;
}

.lk-nav a:hover {
  background: var(--surface2);
  color: var(--text);
  opacity: 1;
}

.lk-nav a.active {
  background: var(--accent-dim);
  color: var(--accent);
}

.lk-nav a .icon {
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}

.lk-nav a .badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.lk-sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
}

.lk-user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .15s;
}
.lk-user-pill:hover { background: var(--surface2); }

.lk-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent2), var(--blue));
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #0a0e1a;
  font-family: var(--font-display);
  flex-shrink: 0;
  overflow: hidden;
}
.lk-avatar img { width: 100%; height: 100%; object-fit: cover; }

.lk-user-info { flex: 1; min-width: 0; }
.lk-user-name { font-size: .82rem; font-weight: 600; color: var(--text); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lk-user-status { font-size: .72rem; color: var(--text3); }
.lk-user-status.ativo { color: var(--accent); }

/* ── Main content ───────────────────────────────── */
.lk-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Top bar ────────────────────────────────────── */
.lk-topbar {
  height: var(--topbar-h);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
  gap: 16px;
}

.lk-topbar-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}

.lk-topbar-actions { display: flex; align-items: center; gap: 10px; }

.lk-status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
}

.lk-status-pill::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.lk-status-ativo    { background: var(--accent-dim);  color: var(--accent); }
.lk-status-pendente { background: var(--yellow-dim);  color: var(--yellow); }
.lk-status-suspenso { background: var(--red-dim);     color: var(--red);    }

/* ── Page content ───────────────────────────────── */
.lk-content { padding: 28px; flex: 1; max-width: 1200px; width: 100%; }

.lk-page-header { margin-bottom: 24px; }
.lk-page-header h1 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
}
.lk-page-header p { color: var(--text2); font-size: .9rem; margin-top: 4px; }
.lk-page-header-row {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 16px; flex-wrap: wrap;
}

/* ── Cards / Stat cards ─────────────────────────── */
.lk-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.lk-card-sm { padding: 16px; border-radius: var(--radius); }

.lk-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.lk-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
  transition: border-color .2s, transform .2s;
}

.lk-stat:hover { border-color: var(--border2); transform: translateY(-1px); }

.lk-stat::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
}

.lk-stat.green::before  { background: linear-gradient(90deg, var(--accent), var(--blue)); }
.lk-stat.blue::before   { background: linear-gradient(90deg, var(--blue), var(--purple)); }
.lk-stat.purple::before { background: linear-gradient(90deg, var(--purple), var(--red)); }
.lk-stat.yellow::before { background: linear-gradient(90deg, var(--yellow), var(--accent)); }

.lk-stat-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  margin-bottom: 14px;
}
.lk-stat.green  .lk-stat-icon { background: var(--accent-dim); }
.lk-stat.blue   .lk-stat-icon { background: var(--blue-dim); }
.lk-stat.purple .lk-stat-icon { background: var(--purple-dim); }
.lk-stat.yellow .lk-stat-icon { background: var(--yellow-dim); }

.lk-stat-label { font-size: .78rem; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: .05em; }
.lk-stat-value { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; color: var(--text); letter-spacing: -1px; margin-top: 4px; }
.lk-stat-sub   { font-size: .78rem; color: var(--text3); margin-top: 4px; }

/* ── Buttons ────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: .87rem;
  font-weight: 600;
  border: none;
  transition: all .15s;
  white-space: nowrap;
  cursor: pointer;
  font-family: var(--font-body);
}

.btn-primary {
  background: var(--accent);
  color: #0a0e1a;
}
.btn-primary:hover { background: var(--accent2); transform: translateY(-1px); box-shadow: 0 4px 16px var(--accent-glow); }

.btn-outline {
  background: transparent;
  color: var(--text2);
  border: 1.5px solid var(--border2);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

.btn-danger {
  background: var(--red-dim);
  color: var(--red);
  border: 1.5px solid rgba(244,63,94,.25);
}
.btn-danger:hover { background: var(--red); color: #fff; }

.btn-sm { padding: 6px 12px; font-size: .8rem; border-radius: 7px; }
.btn-lg { padding: 12px 26px; font-size: 1rem; border-radius: var(--radius); }
.btn-full { width: 100%; justify-content: center; }

.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

/* ── Tables ─────────────────────────────────────── */
.lk-table-wrap { overflow-x: auto; }
.lk-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .87rem;
}
.lk-table th {
  text-align: left;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text3);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.lk-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text2);
  vertical-align: middle;
}
.lk-table tr:last-child td { border-bottom: none; }
.lk-table tr:hover td { background: rgba(255,255,255,.025); }

/* ── Badges ─────────────────────────────────────── */
.lk-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .74rem;
  font-weight: 700;
}

/* ── Form elements ──────────────────────────────── */
.lk-form-group { margin-bottom: 18px; }
.lk-label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.lk-hint { font-size: .78rem; color: var(--text3); margin-top: 5px; }

.lk-input-group { position: relative; }
.lk-input-group input { padding-left: 40px; }
.lk-input-group .lk-input-icon {
  position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text3); font-size: 15px;
  pointer-events: none;
}

/* ── Link card (meu-link) ───────────────────────── */
.lk-link-card {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface2) 100%);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 28px;
  position: relative;
  overflow: hidden;
}

.lk-link-card::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow), transparent 70%);
  pointer-events: none;
}

.lk-link-display {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg2);
  border: 1.5px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-top: 12px;
}

.lk-link-display code {
  flex: 1;
  font-family: var(--font-mono);
  font-size: .88rem;
  color: var(--accent);
  word-break: break-all;
}

/* ── Commission timeline ────────────────────────── */
.lk-timeline { display: flex; flex-direction: column; gap: 0; }
.lk-timeline-item {
  display: flex; gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}
.lk-timeline-item:last-child { border-bottom: none; }
.lk-timeline-dot {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
  background: var(--surface2);
  border: 1.5px solid var(--border2);
}

/* ── Empty state ────────────────────────────────── */
.lk-empty {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 60px 20px;
  text-align: center;
}
.lk-empty-icon { font-size: 44px; margin-bottom: 16px; opacity: .5; }
.lk-empty h3 { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.lk-empty p  { color: var(--text2); font-size: .9rem; max-width: 340px; }

/* ── Alert / Toast ──────────────────────────────── */
.lk-alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  border-left: 3px solid;
}
.lk-alert.success { background: rgba(0,229,160,.08); border-color: var(--accent); color: var(--accent); }
.lk-alert.danger  { background: var(--red-dim);  border-color: var(--red);   color: var(--red); }
.lk-alert.info    { background: var(--blue-dim); border-color: var(--blue);  color: var(--blue); }
.lk-alert.warning { background: var(--yellow-dim); border-color: var(--yellow); color: var(--yellow); }

/* Toast container */
#lk-toasts {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 9999;
}

.lk-toast {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 18px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: .87rem;
  font-weight: 500;
  color: var(--text);
  min-width: 260px; max-width: 380px;
  animation: toastIn .25s ease;
  cursor: pointer;
}

.lk-toast.success { border-left: 3px solid var(--accent); }
.lk-toast.danger  { border-left: 3px solid var(--red); }
.lk-toast.info    { border-left: 3px solid var(--blue); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Loader ─────────────────────────────────────── */
.lk-spin {
  width: 18px; height: 18px;
  border: 2px solid var(--border2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .6s linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Divider ────────────────────────────────────── */
.lk-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

/* ── Grid helpers ───────────────────────────────── */
.lk-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.lk-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.lk-flex   { display: flex; align-items: center; gap: 12px; }
.lk-flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* ── Tabs ───────────────────────────────────────── */
.lk-tabs { display: flex; gap: 2px; background: var(--surface2); border-radius: var(--radius-sm); padding: 4px; margin-bottom: 20px; }
.lk-tab {
  flex: 1; text-align: center; padding: 8px 16px;
  border-radius: 6px; font-size: .85rem; font-weight: 600;
  color: var(--text3); border: none; background: transparent;
  cursor: pointer; transition: all .15s;
}
.lk-tab.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.3); }

/* ── Progress bar ───────────────────────────────── */
.lk-progress-bar {
  height: 6px;
  background: var(--surface2);
  border-radius: 3px;
  overflow: hidden;
}
.lk-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--blue));
  border-radius: 3px;
  transition: width .5s ease;
}

/* ── Mobile ─────────────────────────────────────── */
.lk-menu-toggle {
  display: none;
  background: none; border: none; color: var(--text2); font-size: 22px; padding: 4px;
}

.lk-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.6); z-index: 90;
}

@media (max-width: 768px) {
  .lk-menu-toggle { display: flex; align-items: center; }
  .lk-sidebar { transform: translateX(-100%); }
  .lk-sidebar.open { transform: translateX(0); }
  .lk-overlay.open { display: block; }
  .lk-main { margin-left: 0; }
  .lk-content { padding: 16px; }
  .lk-stat-grid { grid-template-columns: 1fr 1fr; }
  .lk-grid-2, .lk-grid-3 { grid-template-columns: 1fr; }
  .lk-topbar { padding: 0 16px; }
}

@media (max-width: 480px) {
  .lk-stat-grid { grid-template-columns: 1fr; }
}

/* ── Scrollbar ──────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border2); }

/* ── Login page ─────────────────────────────────── */
.lk-login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

.lk-login-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(0,229,160,.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(59,130,246,.06) 0%, transparent 50%);
  pointer-events: none;
}

.lk-login-card {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 24px;
  padding: 44px 40px;
  width: 100%; max-width: 440px;
  position: relative;
  box-shadow: var(--shadow-lg);
}

.lk-login-logo {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 32px;
}

.lk-login-logo .mark {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--accent), var(--blue));
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 800; color: #0a0e1a;
  font-family: var(--font-display);
}

.lk-login-logo .name {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 800;
  color: var(--text); letter-spacing: -0.5px;
}

.lk-login-logo .name span { color: var(--accent); }

.lk-otp-inputs {
  display: flex; gap: 10px;
  justify-content: center;
  margin: 20px 0;
}

.lk-otp-inputs input {
  width: 52px; height: 58px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.5rem; font-weight: 700;
  border-radius: 12px;
  padding: 0;
}

.step { display: none; }
.step.active { display: block; }

/* ── Referral landing page ──────────────────────── */
.lk-referral-hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: var(--bg);
}

/* ── Notification dot ───────────────────────────── */
.lk-notif-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--red);
  position: absolute;
  top: -2px; right: -2px;
}
