@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Sora:wght@400;600;700&display=swap');

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

:root {
  --brand-dark:    #0D0D14;
  --brand-deep:    #13131F;
  --brand-card:    #1A1A2E;
  --brand-border:  #2A2A40;
  --brand-purple:  #7C6AF7;
  --brand-violet:  #A78BFA;
  --brand-glow:    #6D5FE0;
  --brand-gold:    #F0C060;
  --brand-rose:    #F472B6;
  --text-primary:  #F1F0FF;
  --text-secondary:#A09EB8;
  --text-muted:    #5E5C78;
  --success:       #34D399;
  --warning:       #FBBF24;
  --danger:        #F87171;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
}

html, body {
  height: 100%;
  font-family: 'Inter', sans-serif;
  background: var(--brand-dark);
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

a { color: var(--brand-purple); text-decoration: none; }
a:hover { color: var(--brand-violet); }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--brand-deep); }
::-webkit-scrollbar-thumb { background: var(--brand-border); border-radius: 3px; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 24px; border-radius: var(--radius-md);
  font-family: 'Inter', sans-serif; font-size: 14px; font-weight: 500;
  cursor: pointer; border: none; transition: all 0.18s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--brand-purple);
  color: #fff;
}
.btn-primary:hover { background: var(--brand-glow); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--brand-border);
}
.btn-ghost:hover { background: var(--brand-card); color: var(--text-primary); }

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(248,113,113,0.3);
}
.btn-danger:hover { background: rgba(248,113,113,0.08); }

.btn-sm { padding: 7px 16px; font-size: 13px; }
.btn-lg { padding: 14px 32px; font-size: 15px; }
.btn-full { width: 100%; justify-content: center; }

/* ── Cards ── */
.card {
  background: var(--brand-card);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.card-sm { padding: 16px; }
.card-lg { padding: 32px; }

/* ── Form Elements ── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 13px; font-weight: 500; color: var(--text-secondary); letter-spacing: 0.02em; text-transform: uppercase; }
.form-input {
  background: var(--brand-deep);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-md);
  padding: 11px 16px;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  transition: border-color 0.15s;
  width: 100%;
}
.form-input:focus { outline: none; border-color: var(--brand-purple); }
.form-input::placeholder { color: var(--text-muted); }
select.form-input { cursor: pointer; }

/* ── Badges ── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 100px;
  font-size: 12px; font-weight: 500;
}
.badge-purple { background: rgba(124,106,247,0.15); color: var(--brand-violet); }
.badge-gold   { background: rgba(240,192,96,0.15);  color: var(--brand-gold); }
.badge-green  { background: rgba(52,211,153,0.12);  color: var(--success); }
.badge-rose   { background: rgba(244,114,182,0.12); color: var(--brand-rose); }
.badge-muted  { background: var(--brand-border);    color: var(--text-secondary); }
.badge-danger { background: rgba(248,113,113,0.12); color: var(--danger); }

/* ── Score Ring (reusable) ── */
.score-ring-wrap { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.score-ring-wrap svg { transform: rotate(-90deg); }
.score-ring-label {
  position: absolute; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.score-ring-label .score-num { font-family: 'Sora', sans-serif; font-weight: 700; }
.score-ring-label .score-sub { font-size: 11px; color: var(--text-muted); }

/* ── Navigation sidebar ── */
.sidebar {
  width: 240px; height: 100vh;
  background: var(--brand-deep);
  border-right: 1px solid var(--brand-border);
  display: flex; flex-direction: column;
  padding: 0; flex-shrink: 0;
  position: fixed; left: 0; top: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
}
.sidebar-logo {
  padding: 26px 24px 20px;
  border-bottom: 1px solid var(--brand-border);
  margin-bottom: 12px;
  position: sticky; top: 0;
  background: var(--brand-deep);
  z-index: 2;
}
.sidebar-logo .wordmark { font-family: 'Sora', sans-serif; font-size: 18px; font-weight: 700; }
.sidebar-logo .wordmark span { color: var(--brand-purple); }
.sidebar-logo .tagline { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.nav-section-label {
  font-size: 10px; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-muted);
  padding: 16px 24px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 24px; color: var(--text-secondary);
  font-size: 14px; font-weight: 400;
  cursor: pointer; transition: all 0.15s;
  border-left: 2px solid transparent;
  text-decoration: none;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.7; }
.nav-item:hover { color: var(--text-primary); background: rgba(124,106,247,0.06); }
.nav-item.active {
  color: var(--brand-violet);
  background: rgba(124,106,247,0.1);
  border-left-color: var(--brand-purple);
  font-weight: 500;
}
.nav-item.active svg { opacity: 1; }

.sidebar-footer {
  margin-top: auto;
  padding: 14px 20px 18px;
  border-top: 1px solid var(--brand-border);
  position: sticky; bottom: 0;
  background: var(--brand-deep);
  z-index: 2;
}
/* Bigger, more prominent account area (photo + name + sign-out) */
#sidebarAvatar { width: 46px; height: 46px; font-size: 17px; }
#sidebarName { font-size: 15px !important; }
#sidebarRole { font-size: 12px !important; }
.sidebar-footer > div:first-child { gap: 12px !important; margin-bottom: 14px !important; }
.sidebar-footer .btn { padding: 12px 18px; font-size: 14px; }

/* ── Page layout with sidebar ── */
.app-layout { display: flex; min-height: 100vh; }
.main-content { margin-left: 240px; flex: 1; padding: 40px; min-height: 100vh; }

/* ── Page header ── */
.page-header { margin-bottom: 32px; }
.page-header h1 { font-size: 26px; margin-bottom: 4px; }
.page-header p { color: var(--text-secondary); font-size: 15px; }

/* ── Stat cards grid ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 32px; }
.stat-card {
  background: var(--brand-card); border: 1px solid var(--brand-border);
  border-radius: var(--radius-lg); padding: 20px 24px;
}
.stat-card .stat-label { font-size: 12px; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; }
.stat-card .stat-value { font-family: 'Sora', sans-serif; font-size: 28px; font-weight: 700; }
.stat-card .stat-sub { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
.stat-card .stat-icon { width: 36px; height: 36px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }

/* ── Table ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; padding: 10px 16px; text-align: left; border-bottom: 1px solid var(--brand-border); }
tbody td { padding: 14px 16px; border-bottom: 1px solid rgba(42,42,64,0.5); color: var(--text-secondary); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(124,106,247,0.04); color: var(--text-primary); }

/* ── Progress bar ── */
.progress-bar { height: 6px; background: var(--brand-border); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 3px; transition: width 0.4s ease; }
.fill-purple { background: var(--brand-purple); }
.fill-gold   { background: var(--brand-gold); }
.fill-green  { background: var(--success); }
.fill-rose   { background: var(--brand-rose); }

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

/* ── Avatar ── */
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; flex-shrink: 0;
  background: rgba(124,106,247,0.2); color: var(--brand-violet);
}
.avatar-lg { width: 52px; height: 52px; font-size: 18px; }
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }

/* ── Glow accent backgrounds ── */
.glow-purple { box-shadow: 0 0 40px rgba(124,106,247,0.12); }
.accent-line { width: 36px; height: 3px; background: var(--brand-purple); border-radius: 2px; margin-bottom: 16px; }

/* ── Utility ── */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.text-muted { color: var(--text-secondary); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.font-medium { font-weight: 500; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.w-full { width: 100%; }

/* ── Animations ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.4s ease forwards; }
.fade-up-2 { animation: fadeUp 0.4s 0.08s ease both; }
.fade-up-3 { animation: fadeUp 0.4s 0.16s ease both; }

@keyframes pulse-ring {
  0%   { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .sidebar { width: 200px; }
  .main-content { margin-left: 200px; padding: 24px; }
}
@media (max-width: 680px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; padding: 16px; }
}

/* ══ Toasts (themed notifications, shared app-wide) ══ */
#vl-toast-wrap {
  position: fixed; top: 18px; right: 18px; z-index: 10050;
  display: flex; flex-direction: column; gap: 10px;
  max-width: 360px; pointer-events: none;
}
.vl-toast {
  pointer-events: auto;
  display: flex; align-items: flex-start; gap: 11px;
  background: var(--brand-card);
  border: 1px solid var(--brand-border);
  border-left: 3px solid var(--brand-purple);
  border-radius: var(--radius-md);
  padding: 13px 15px;
  box-shadow: 0 12px 34px rgba(0,0,0,0.45);
  color: var(--text-primary); font-size: 14px; line-height: 1.45;
  cursor: pointer;
  opacity: 0; transform: translateX(16px);
  transition: opacity .22s ease, transform .22s ease;
}
.vl-toast.vl-in  { opacity: 1; transform: translateX(0); }
.vl-toast.vl-out { opacity: 0; transform: translateX(16px); }
.vl-toast .vl-toast-ico { flex-shrink: 0; width: 18px; height: 18px; margin-top: 1px; }
.vl-toast-msg { flex: 1; word-break: break-word; }
.vl-toast.vl-success { border-left-color: var(--success); }
.vl-toast.vl-error   { border-left-color: var(--danger); }
.vl-toast.vl-warning { border-left-color: var(--warning); }
.vl-toast.vl-info    { border-left-color: var(--brand-purple); }
.vl-toast.vl-success .vl-toast-ico { color: var(--success); }
.vl-toast.vl-error   .vl-toast-ico { color: var(--danger); }
.vl-toast.vl-warning .vl-toast-ico { color: var(--warning); }
.vl-toast.vl-info    .vl-toast-ico { color: var(--brand-violet); }
@media (max-width: 820px) {
  #vl-toast-wrap { left: 12px; right: 12px; top: 64px; max-width: none; }
}

/* ══ Themed confirm dialog (shared app-wide) ══ */
#vl-confirm-bg {
  position: fixed; inset: 0; z-index: 10060;
  background: rgba(13,13,20,0.82); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
#vl-confirm-bg.vl-open { display: flex; }
.vl-confirm-panel {
  background: var(--brand-card);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-lg);
  padding: 26px 26px 22px; width: 420px; max-width: 100%;
  box-shadow: 0 24px 60px rgba(0,0,0,0.55);
  animation: fadeUp .25s ease;
}
.vl-confirm-panel h4 { font-family: 'Sora', sans-serif; font-size: 18px; margin-bottom: 8px; color: var(--text-primary); }
.vl-confirm-panel p  { color: var(--text-secondary); font-size: 14px; line-height: 1.55; margin-bottom: 22px; }
.vl-confirm-actions  { display: flex; gap: 10px; justify-content: flex-end; }

/* ══ Custom dropdown skin (auto-applied to select.form-input app-wide) ══ */
.cdrop { position: relative; }
.cdrop-trigger {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--brand-deep); border: 1px solid var(--brand-border); border-radius: var(--radius-md);
  padding: 11px 16px; font-family: 'Inter', sans-serif; font-size: 15px; color: var(--text-primary);
  cursor: pointer; text-align: left; transition: border-color .15s;
}
.cdrop-trigger:hover { border-color: var(--brand-purple); }
.cdrop.open .cdrop-trigger { border-color: var(--brand-purple); }
.cdrop-trigger .cdrop-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cdrop-trigger .cdrop-label.placeholder { color: var(--text-muted); }
.cdrop-trigger .chev { flex-shrink: 0; color: var(--text-muted); transition: transform .15s; }
.cdrop.open .cdrop-trigger .chev { transform: rotate(180deg); }
.cdrop-menu {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60;
  background: var(--brand-card); border: 1px solid var(--brand-border); border-radius: var(--radius-md);
  padding: 6px; max-height: 264px; overflow-y: auto; box-shadow: 0 14px 34px rgba(0,0,0,0.5); display: none;
}
.cdrop.open .cdrop-menu { display: block; }
.cdrop-item {
  padding: 10px 12px; border-radius: var(--radius-sm); font-size: 14px; color: var(--text-secondary);
  cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cdrop-item:hover { background: rgba(124,106,247,0.14); color: var(--text-primary); }
.cdrop-item.selected { color: var(--text-primary); }
.cdrop-item.selected::after { content: '✓'; color: var(--brand-purple); font-weight: 700; font-size: 13px; }
.cdrop-empty { padding: 14px 12px; color: var(--text-muted); font-size: 13px; text-align: center; }

/* ══════════════════════════════════════════════════════════════════
   Premium polish — global micro-interactions & finishing touches
   ══════════════════════════════════════════════════════════════════ */
html { scroll-behavior: smooth; }
::selection { background: rgba(124,106,247,0.32); color: #fff; }

/* Smooth page entrance */
@keyframes vlPageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
body { animation: vlPageIn .38s ease both; }

/* Clean keyboard focus ring (accessible, not on mouse clicks) */
:focus-visible { outline: 2px solid var(--brand-purple); outline-offset: 2px; border-radius: 6px; }
button:focus:not(:focus-visible), a:focus:not(:focus-visible) { outline: none; }

/* Buttons: tactile press + primary glow */
.btn { transition: all .18s ease, transform .07s ease; }
.btn:active { transform: translateY(1px) scale(.995); }
.btn-primary:hover { box-shadow: 0 8px 24px rgba(124,106,247,0.35); }

/* Inputs & dropdowns: soft focus glow */
.form-input:focus { box-shadow: 0 0 0 3px rgba(124,106,247,0.14); }
.cdrop.open .cdrop-trigger { box-shadow: 0 0 0 3px rgba(124,106,247,0.14); }

/* Stat cards: subtle lift on hover */
.stat-card { transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease; }
.stat-card:hover { transform: translateY(-2px); border-color: rgba(124,106,247,0.4); box-shadow: 0 12px 30px rgba(0,0,0,0.28); }

/* Nav items: smoother transitions */
.nav-item { transition: color .15s, background .15s, border-color .15s; }

/* Reusable loading shimmer + spinner (for polished loading states) */
@keyframes vlShimmer { 0% { background-position: -340px 0; } 100% { background-position: 340px 0; } }
.vl-skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.09) 37%, rgba(255,255,255,0.04) 63%);
  background-size: 680px 100%; animation: vlShimmer 1.3s infinite linear; border-radius: var(--radius-md);
}
@keyframes vlSpin { to { transform: rotate(360deg); } }
.vl-spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2.5px solid var(--brand-border); border-top-color: var(--brand-purple);
  animation: vlSpin .7s linear infinite; display: inline-block; vertical-align: middle;
}

/* ══ Onboarding tour (picture tutorial) ══ */
#vl-tour-bg { position: fixed; inset: 0; z-index: 10070; background: rgba(10,10,16,0.8); backdrop-filter: blur(6px); display: none; align-items: center; justify-content: center; padding: 20px; }
#vl-tour-bg.vl-open { display: flex; }
.vl-tour-card { background: var(--brand-card); border: 1px solid var(--brand-border); border-radius: var(--radius-xl); width: 540px; max-width: 100%; max-height: 92vh; overflow-y: auto; box-shadow: 0 30px 80px rgba(0,0,0,0.6); position: relative; animation: fadeUp .3s ease; }
.vl-tour-x { position: absolute; top: 12px; right: 14px; background: rgba(0,0,0,0.4); border: none; color: var(--text-secondary); width: 30px; height: 30px; border-radius: 50%; font-size: 20px; line-height: 1; cursor: pointer; z-index: 2; }
.vl-tour-x:hover { color: #fff; background: rgba(0,0,0,0.6); }
.vl-tour-media { position: relative; aspect-ratio: 16 / 9; background: linear-gradient(135deg, rgba(124,106,247,0.20), rgba(167,139,250,0.05)); border-radius: var(--radius-xl) var(--radius-xl) 0 0; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.vl-tour-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vl-tour-ph { position: absolute; color: var(--text-muted); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.vl-tour-body { padding: 22px 26px 4px; }
.vl-tour-body h3 { font-family: 'Sora', sans-serif; font-size: 20px; margin-bottom: 9px; }
.vl-tour-body p { color: var(--text-secondary); font-size: 14.5px; line-height: 1.6; }
.vl-tour-dots { display: flex; gap: 7px; justify-content: center; padding: 16px 0 2px; }
.vl-tour-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-border); cursor: pointer; transition: all .15s; }
.vl-tour-dot.on { background: var(--brand-purple); transform: scale(1.3); }
.vl-tour-foot { display: flex; align-items: center; gap: 8px; padding: 8px 22px 22px; }
#vl-tour-help { position: fixed; left: 22px; bottom: 22px; z-index: 9998; width: 42px; height: 42px; border-radius: 50%; background: var(--brand-card); border: 1px solid var(--brand-border); color: var(--brand-violet); font-size: 20px; font-weight: 700; cursor: pointer; box-shadow: 0 4px 20px rgba(0,0,0,0.4); transition: all .18s; }
#vl-tour-help:hover { border-color: var(--brand-purple); color: #fff; transform: translateY(-2px); }
@media (max-width: 820px) { #vl-tour-help { left: 14px; bottom: 74px; } }
