/* LOOPPY — design tokens & base */
:root {
  --accent-h: 263; /* violet default */
  --accent-s: 80%;
  --accent-l: 64%;
  --accent: hsl(var(--accent-h) var(--accent-s) var(--accent-l));
  --accent-soft: hsl(var(--accent-h) var(--accent-s) var(--accent-l) / 0.15);
  --accent-glow: hsl(var(--accent-h) var(--accent-s) var(--accent-l) / 0.35);
  --accent-deep: hsl(var(--accent-h) var(--accent-s) 38%);

  /* Dark (default) */
  --bg: #07070a;
  --bg-grad: radial-gradient(ellipse at 70% -10%, hsl(var(--accent-h) 60% 22% / 0.55), transparent 55%), #07070a;
  --surface: #0f0f14;
  --surface-2: #16161e;
  --surface-3: #1d1d27;
  --line: #25252f;
  --line-strong: #33333f;
  --text: #f5f5f7;
  --text-muted: #a0a0b0;
  --text-dim: #6a6a78;
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;
  --vip: #f0b94e;
}
[data-theme="light"] {
  --bg: #f7f6f9;
  --bg-grad: radial-gradient(ellipse at 70% -10%, hsl(var(--accent-h) 80% 90% / 0.6), transparent 55%), #f7f6f9;
  --surface: #ffffff;
  --surface-2: #fbfbfd;
  --surface-3: #f1f0f5;
  --line: #e8e7ee;
  --line-strong: #d6d5dd;
  --text: #0e0e14;
  --text-muted: #5a5a6a;
  --text-dim: #8a8a98;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', 'Helvetica Neue', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
  letter-spacing: -0.01em;
}
.font-display { font-family: 'Instrument Sans', 'Inter', system-ui, sans-serif; letter-spacing: -0.035em; }
.font-mono { font-family: 'JetBrains Mono', 'SF Mono', ui-monospace, monospace; }

/* App shell scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--line-strong); }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 12px; font-weight: 600; font-size: 14px; transition: all .15s ease; cursor: pointer; border: 1px solid transparent; white-space: nowrap; }
.btn-primary { background: var(--accent); color: white; box-shadow: 0 6px 20px -6px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,0.18); }
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--line-strong); }
.btn-soft { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.btn-soft:hover { background: hsl(var(--accent-h) var(--accent-s) var(--accent-l) / 0.22); }
.btn-icon { padding: 9px; border-radius: 10px; }

/* Card */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.card-2 { background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; }

/* Inputs */
.input, .select, .textarea {
  width: 100%; padding: 11px 14px; border-radius: 12px;
  background: var(--surface-2); color: var(--text); font-size: 14px;
  border: 1px solid var(--line); outline: none; transition: border .15s, box-shadow .15s;
  font-family: inherit;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.input::placeholder { color: var(--text-dim); }
.input-icon { position: relative; }
.input-icon .input { padding-left: 40px; }
.input-icon .icon-slot { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-dim); pointer-events: none; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1; }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; }

/* Sidebar item */
.nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--text-muted); font-size: 14px; font-weight: 500; cursor: pointer; transition: all .12s; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); }
.nav-item.active .nav-dot { opacity: 1; }
.nav-dot { width: 4px; height: 18px; border-radius: 2px; background: var(--accent); opacity: 0; transition: opacity .12s; }

/* Stat number */
.stat-num { font-family: 'Instrument Sans', system-ui, sans-serif; font-weight: 600; font-size: 36px; letter-spacing: -0.04em; line-height: 1; }

/* Subtle grid pattern */
.grid-pattern {
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 60% 60% at 50% 40%, black, transparent);
}

/* Glow accents */
.violet-glow { background: radial-gradient(circle at center, var(--accent-glow), transparent 70%); }

/* Mobile frame */
.phone-frame {
  width: 380px; height: 780px; border-radius: 50px;
  background: #050507; padding: 14px;
  box-shadow: 0 40px 80px -20px rgba(0,0,0,0.6), 0 0 0 1px var(--line-strong), inset 0 0 0 2px #18181f;
  position: relative;
}
.phone-screen { width: 100%; height: 100%; border-radius: 38px; overflow: hidden; background: var(--bg); position: relative; }
.phone-notch { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); width: 110px; height: 28px; background: #050507; border-radius: 999px; z-index: 50; }

/* Animations */
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pop { 0% { transform: scale(0.6); opacity: 0; } 60% { transform: scale(1.1); } 100% { transform: scale(1); opacity: 1; } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
.fade-up { animation: fadeUp .35s cubic-bezier(.2,.8,.2,1) both; }
.pop-in { animation: pop .4s cubic-bezier(.2,.8,.2,1) both; }

/* Toast */
.toast { animation: fadeUp .25s ease both; }

/* Confetti */
.confetti-piece { position: absolute; width: 8px; height: 14px; top: -20px; opacity: 0.9; animation: confetti-fall var(--dur, 1.6s) cubic-bezier(.25,.7,.5,1) forwards; }
@keyframes confetti-fall {
  0% { transform: translate3d(0,0,0) rotate(0); opacity: 1; }
  100% { transform: translate3d(var(--dx,0), 100vh, 0) rotate(var(--rot,720deg)); opacity: 0.2; }
}

/* Tag chip */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--line); }
.chip-active { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

/* Table */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); padding: 14px 16px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr.hov:hover td { background: var(--surface-2); }

/* Avatar */
.av { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; color: white; flex-shrink: 0; }

/* Progress */
.prog { height: 8px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.prog-bar { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-deep)); border-radius: 999px; transition: width .4s ease; }

/* Lucide icon sizing reset */
[data-lucide] { stroke-width: 1.75; }
.lu-thick [data-lucide] { stroke-width: 2.25; }

/* utility */
.divider { height: 1px; background: var(--line); }
.kbd { font-family: 'JetBrains Mono', monospace; font-size: 11px; padding: 2px 6px; border-radius: 4px; background: var(--surface-3); border: 1px solid var(--line); color: var(--text-muted); }
