@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800;900&family=Poppins:wght@600;700;800&display=swap');

/* ─── Design tokens ─────────────────────────────────────────── */
:root {
  --primary:        #4f46e5;
  --primary-light:  #6366f1;
  --primary-dark:   #3730a3;
  --primary-bg:     #eef2ff;
  --accent:         #f59e0b;
  --accent-light:   #fef3c7;
  --success:        #10b981;
  --success-light:  #d1fae5;
  --danger:         #ef4444;
  --danger-light:   #fee2e2;
  --warning:        #f59e0b;
  --warning-light:  #fef3c7;
  --info:           #3b82f6;
  --info-light:     #dbeafe;
  --purple-light:   #f5f3ff;
  --bg:             #f3f4f6;
  --surface:        #ffffff;
  --surface2:       #f9fafb;
  --border:         #e5e7eb;
  --border-strong:  #d1d5db;
  --text:           #111827;
  --text-2:         #374151;
  --text-3:         #6b7280;
  --text-4:         #9ca3af;
  --nav-h:          60px;
  --bottom-h:       64px;
  --r-sm:           10px;
  --r-md:           14px;
  --r-lg:           20px;
  --r-xl:           28px;
  --shadow-sm:      0 1px 2px rgba(0,0,0,.06), 0 1px 6px rgba(0,0,0,.05);
  --shadow:         0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.07);
  --shadow-md:      0 4px 8px rgba(0,0,0,.07), 0 12px 28px rgba(0,0,0,.09);
  --shadow-lg:      0 10px 20px rgba(0,0,0,.09), 0 24px 48px rgba(0,0,0,.11);
  --transition:     .15s ease;
}

/* ─── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }
ul { list-style: none; }

/* ─── App shell ──────────────────────────────────────────────── */
.app-container {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
}
@media (min-width: 480px) {
  .app-container { box-shadow: 0 0 60px rgba(0,0,0,.13); }
}

/* ─── Page wrapper ───────────────────────────────────────────── */
.page {
  padding-top: var(--nav-h);
  padding-bottom: calc(var(--bottom-h) + 16px);
  min-height: 100vh;
}
.page-no-bottom { padding-bottom: 20px; }

/* ─── Content padding ────────────────────────────────────────── */
.content { padding: 16px; }
.content-flush { padding: 0; }

/* ─── Top nav ────────────────────────────────────────────────── */
.top-nav {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: var(--nav-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  z-index: 100;
  gap: 8px;
}
.nav-logo {
  font-family: 'Poppins', sans-serif;
  font-size: 17px;
  font-weight: 800;
  color: var(--primary);
  white-space: nowrap;
  flex-shrink: 0;
}
.nav-title {
  font-family: 'Poppins', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-actions { display: flex; gap: 4px; flex-shrink: 0; }
.nav-btn {
  width: 40px; height: 40px;
  border: none;
  background: transparent;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  font-size: 20px;
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
  text-decoration: none;
  position: relative;
}
.nav-btn:hover { background: var(--bg); color: var(--primary); }
.nav-btn-notif .notif-dot {
  position: absolute;
  top: 7px; right: 7px;
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--surface);
}

/* ─── Bottom nav ─────────────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: var(--bottom-h);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
  padding: 0 4px;
}
.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 8px;
  border-radius: var(--r-md);
  color: var(--text-4);
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  transition: color var(--transition);
  flex: 1;
  max-width: 72px;
}
.bnav-icon { font-size: 22px; line-height: 1; }
.bottom-nav-item.active { color: var(--primary); }

/* ─── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 12px;
}
.card-sm  { padding: 12px; border-radius: var(--r-md); }
.card-lg  { padding: 20px; border-radius: var(--r-xl); }
.card-interactive { cursor: pointer; transition: transform var(--transition), box-shadow var(--transition); }
.card-interactive:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.card-interactive:active { transform: scale(.98); }

.card-title    { font-size: 15px; font-weight: 800; color: var(--text); margin-bottom: 2px; }
.card-subtitle { font-size: 13px; color: var(--text-3); }

/* ─── Hero card ──────────────────────────────────────────────── */
.hero-card {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  border-radius: var(--r-xl);
  padding: 20px;
  margin-bottom: 20px;
}
.hero-card h2   { font-size: 22px; font-weight: 900; margin-bottom: 4px; }
.hero-card p    { font-size: 14px; opacity: .85; }
.hero-stat      { font-size: 22px; font-weight: 900; line-height: 1; }
.hero-stat-label{ font-size: 12px; opacity: .75; margin-top: 2px; }

/* ─── Stats grid ─────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: 14px;
  text-align: center;
}
.stat-value { font-size: 26px; font-weight: 900; color: var(--primary); line-height: 1; margin-bottom: 4px; }
.stat-label { font-size: 11px; color: var(--text-3); font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }

/* ─── Section header ─────────────────────────────────────────── */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.section-title  { font-size: 16px; font-weight: 800; color: var(--text); }
.section-link   { font-size: 13px; font-weight: 800; color: var(--primary); }

/* ─── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 20px;
  border-radius: var(--r-md);
  font-size: 15px;
  font-weight: 800;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}
.btn:active { transform: scale(.97); }
.btn-primary   { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--primary-bg); color: var(--primary); }
.btn-secondary:hover { background: #e0e7ff; }
.btn-outline   { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--primary-bg); }
.btn-ghost     { background: transparent; color: var(--text-3); }
.btn-ghost:hover { background: var(--bg); }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-success   { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; }
.btn-block { width: 100%; }
.btn-sm    { padding: 8px 14px; font-size: 13px; border-radius: var(--r-sm); }
.btn-lg    { padding: 15px 28px; font-size: 17px; border-radius: var(--r-lg); }
.btn-icon  { width: 40px; height: 40px; padding: 0; border-radius: var(--r-md); }

/* ─── Forms ──────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 14px; font-weight: 800; color: var(--text-2); margin-bottom: 6px; }
.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  font-size: 15px;
  color: var(--text);
  background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  appearance: none;
}
.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}
.form-input::placeholder { color: var(--text-4); }
.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}
.form-hint  { font-size: 12px; color: var(--text-4); margin-top: 4px; }
.form-error { font-size: 13px; color: var(--danger); margin-top: 4px; font-weight: 700; }

.input-group { position: relative; }
.input-group .form-input { padding-left: 44px; }
.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-4);
  font-size: 18px;
  pointer-events: none;
}

/* ─── Badges / chips ─────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 800;
}
.badge-primary { background: var(--primary-bg); color: var(--primary); }
.badge-success { background: var(--success-light); color: #059669; }
.badge-warning { background: var(--warning-light); color: #d97706; }
.badge-danger  { background: var(--danger-light);  color: #dc2626; }
.badge-info    { background: var(--info-light);    color: #2563eb; }
.badge-gray    { background: var(--bg);            color: var(--text-3); }

.chip-group { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip {
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 700;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-3);
  cursor: pointer;
  transition: all var(--transition);
}
.chip.active  { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ─── Avatar ─────────────────────────────────────────────────── */
.avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--primary-bg);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 900;
  flex-shrink: 0;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-xs  { width: 28px; height: 28px; font-size: 11px; }
.avatar-sm  { width: 36px; height: 36px; font-size: 13px; }
.avatar-lg  { width: 60px; height: 60px; font-size: 24px; }
.avatar-xl  { width: 80px; height: 80px; font-size: 30px; }

/* ─── List items ─────────────────────────────────────────────── */
.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.list-item:last-child { border-bottom: none; }
.item-icon {
  width: 44px; height: 44px;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.item-body { flex: 1; min-width: 0; }
.item-title { font-size: 14px; font-weight: 800; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-sub   { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.item-right { flex-shrink: 0; }

/* ─── Progress bar ───────────────────────────────────────────── */
.progress-bar {
  height: 7px;
  background: var(--border);
  border-radius: 100px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 100px;
  transition: width .5s ease;
}
.progress-bar.p-success .progress-fill { background: var(--success); }
.progress-bar.p-warning .progress-fill { background: var(--warning); }
.progress-bar.p-danger  .progress-fill { background: var(--danger); }

/* ─── Tabs ───────────────────────────────────────────────────── */
.tabs {
  display: flex;
  background: var(--bg);
  border-radius: var(--r-md);
  padding: 4px;
  gap: 4px;
  margin-bottom: 16px;
}
.tab {
  flex: 1;
  padding: 8px 6px;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  border-radius: 10px;
  color: var(--text-3);
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.tab.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }

/* ─── Toast ──────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: calc(var(--bottom-h) + 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  width: calc(100% - 32px);
  max-width: 448px;
  pointer-events: none;
}
.toast {
  background: #1f2937;
  color: #fff;
  padding: 12px 16px;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 700;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn .25s ease;
  box-shadow: var(--shadow-lg);
  transition: opacity .3s, transform .3s;
}
.toast-success { background: #064e3b; }
.toast-error   { background: #7f1d1d; }
.toast-hide    { opacity: 0; transform: translateY(8px); }
@keyframes toastIn { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ─── Auth pages ─────────────────────────────────────────────── */
.auth-page { min-height: 100vh; display: flex; flex-direction: column; }
.auth-header {
  background: linear-gradient(145deg, var(--primary-dark), var(--primary));
  padding: 56px 24px 36px;
  color: #fff;
  text-align: center;
}
.auth-logo { font-size: 52px; margin-bottom: 10px; }
.auth-header h1 { font-family: 'Poppins', sans-serif; font-size: 26px; font-weight: 800; margin-bottom: 6px; }
.auth-header p  { font-size: 14px; opacity: .8; }
.auth-body {
  flex: 1;
  background: var(--surface);
  border-radius: 28px 28px 0 0;
  margin-top: -20px;
  padding: 28px 24px 40px;
}
.auth-body h2    { font-size: 22px; font-weight: 900; color: var(--text); margin-bottom: 4px; }
.auth-sub        { font-size: 14px; color: var(--text-3); margin-bottom: 24px; }
.auth-footer     { text-align: center; margin-top: 20px; font-size: 14px; color: var(--text-3); }
.auth-footer a   { font-weight: 800; color: var(--primary); }
.auth-demo-box {
  background: var(--primary-bg);
  border-radius: var(--r-md);
  padding: 12px 14px;
  margin-bottom: 20px;
}

/* ─── Divider ────────────────────────────────────────────────── */
.divider {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0;
  color: var(--text-4); font-size: 13px; font-weight: 700;
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ─── Notifications ──────────────────────────────────────────── */
.notif-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  transition: background var(--transition);
  cursor: pointer;
}
.notif-item.unread { background: var(--primary-bg); }
.notif-item:hover  { background: var(--surface2); }
.notif-icon {
  width: 40px; height: 40px; border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.notif-body   { flex: 1; min-width: 0; }
.notif-title  { font-size: 14px; font-weight: 800; color: var(--text); margin-bottom: 2px; }
.notif-text   { font-size: 13px; color: var(--text-3); }
.notif-time   { font-size: 11px; color: var(--text-4); margin-top: 3px; }
.unread-dot   { width: 8px; height: 8px; background: var(--primary); border-radius: 50%; flex-shrink: 0; margin-top: 4px; }

/* ─── Settings ───────────────────────────────────────────────── */
.settings-section { margin-bottom: 24px; }
.settings-label {
  font-size: 11px; font-weight: 900; color: var(--text-4);
  text-transform: uppercase; letter-spacing: 1px;
  margin-bottom: 6px; padding: 0 4px;
}
.settings-group { border-radius: var(--r-lg); overflow: hidden; }
.settings-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
}
.settings-item:last-child { border-bottom: none; }
.settings-item:hover { background: var(--surface2); }
.si-icon {
  width: 36px; height: 36px; border-radius: var(--r-sm);
  background: var(--primary-bg); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; flex-shrink: 0;
}
.si-body  { flex: 1; }
.si-title { font-size: 15px; font-weight: 700; color: var(--text); }
.si-sub   { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.si-right { color: var(--text-4); font-size: 18px; }

/* ─── Toggle ─────────────────────────────────────────────────── */
.toggle {
  width: 48px; height: 26px;
  background: var(--border);
  border-radius: 100px;
  position: relative;
  cursor: pointer;
  transition: background .2s;
  border: none;
  flex-shrink: 0;
}
.toggle.on { background: var(--primary); }
.toggle::after {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: white;
  top: 3px; left: 3px;
  transition: transform .2s;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.toggle.on::after { transform: translateX(22px); }

/* ─── Leaderboard ────────────────────────────────────────────── */
.rank-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; border-radius: var(--r-lg);
  margin-bottom: 8px; background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.rank-item.rank-1 { background: linear-gradient(135deg,#fef9c3,#fde047); }
.rank-item.rank-2 { background: linear-gradient(135deg,#f1f5f9,#e2e8f0); }
.rank-item.rank-3 { background: linear-gradient(135deg,#fff7ed,#fed7aa); }
.rank-num { width: 28px; font-size: 16px; font-weight: 900; text-align: center; flex-shrink: 0; }

/* ─── Badge grid ─────────────────────────────────────────────── */
.badge-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.badge-item {
  background: var(--surface);
  border-radius: var(--r-lg); padding: 16px 8px;
  text-align: center; box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform var(--transition);
}
.badge-item:hover { transform: translateY(-2px); }
.badge-emoji { font-size: 34px; margin-bottom: 8px; }
.badge-name  { font-size: 12px; font-weight: 800; color: var(--text); }
.badge-desc  { font-size: 11px; color: var(--text-4); margin-top: 2px; }
.badge-item.locked { opacity: .4; filter: grayscale(1); cursor: default; }
.badge-item.locked:hover { transform: none; }

/* ─── Feed / social ──────────────────────────────────────────── */
.post-card { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); margin-bottom: 12px; overflow: hidden; }
.post-header { padding: 12px 16px; display: flex; align-items: center; gap: 10px; }
.post-body   { padding: 0 16px 14px; font-size: 14px; color: var(--text-2); line-height: 1.6; }
.post-actions { padding: 10px 16px; border-top: 1px solid var(--border); display: flex; gap: 16px; }
.post-action {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700; color: var(--text-3);
  background: none; border: none; cursor: pointer;
  transition: color var(--transition);
}
.post-action:hover { color: var(--primary); }

/* ─── Messages ───────────────────────────────────────────────── */
.messages-list { display: flex; flex-direction: column; gap: 4px; }
.message-bubble {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.45;
}
.message-bubble.sent {
  background: var(--primary); color: #fff;
  border-bottom-right-radius: 4px;
  margin-left: auto;
}
.message-bubble.received {
  background: var(--bg); color: var(--text);
  border-bottom-left-radius: 4px;
}

/* ─── Streak calendar ────────────────────────────────────────── */
.streak-calendar { display: grid; grid-template-columns: repeat(7,1fr); gap: 5px; }
.streak-day {
  aspect-ratio: 1;
  border-radius: 8px;
  background: var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: var(--text-4);
}
.streak-day.done  { background: var(--warning); color: #fff; }
.streak-day.today { background: var(--primary); color: #fff; }

/* ─── FAB ────────────────────────────────────────────────────── */
.fab {
  position: fixed;
  bottom: calc(var(--bottom-h) + 14px);
  right: 16px;
  width: 52px; height: 52px;
  border-radius: 16px;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  box-shadow: var(--shadow-lg);
  border: none;
  z-index: 50;
  cursor: pointer;
  transition: transform var(--transition);
}
.fab:hover  { transform: scale(1.06); }
.fab:active { transform: scale(.95); }

/* ─── Modal / sheet ──────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 200;
  display: flex; align-items: flex-end; justify-content: center;
}
.modal-sheet {
  background: var(--surface);
  border-radius: 24px 24px 0 0;
  padding: 24px;
  width: 100%; max-width: 480px;
  max-height: 80vh; overflow-y: auto;
}
.modal-handle {
  width: 36px; height: 4px;
  background: var(--border);
  border-radius: 100px;
  margin: 0 auto 16px;
}

/* ─── Loading ────────────────────────────────────────────────── */
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, var(--bg) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ─── Empty state ────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 40px 20px; }
.empty-icon  { font-size: 52px; margin-bottom: 12px; }
.empty-state h3 { font-size: 17px; font-weight: 900; color: var(--text); margin-bottom: 6px; }
.empty-state p  { font-size: 14px; color: var(--text-3); }

/* ─── Utility classes ────────────────────────────────────────── */
/* Layout */
.row          { display: flex; }
.row-between  { display: flex; align-items: center; justify-content: space-between; }
.row-center   { display: flex; align-items: center; }
.row-gap-sm   { gap: 8px; }
.row-gap-md   { gap: 12px; }
.row-gap-lg   { gap: 16px; }
.col          { display: flex; flex-direction: column; }
.flex-1       { flex: 1; }
.flex-shrink-0{ flex-shrink: 0; }
.grid-2       { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3       { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.w-full       { width: 100%; }
.text-right   { text-align: right; }
.text-center  { text-align: center; }
.overflow-hidden { overflow: hidden; }
.truncate     { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Spacing — margin-top */
.mt-xs  { margin-top: 4px; }
.mt-sm  { margin-top: 8px; }
.mt-md  { margin-top: 12px; }
.mt-lg  { margin-top: 16px; }
.mt-xl  { margin-top: 24px; }
.mt-2xl { margin-top: 32px; }

/* Spacing — margin-bottom */
.mb-xs  { margin-bottom: 4px; }
.mb-sm  { margin-bottom: 8px; }
.mb-md  { margin-bottom: 12px; }
.mb-lg  { margin-bottom: 16px; }
.mb-xl  { margin-bottom: 24px; }

/* Spacing — padding helpers */
.p-md   { padding: 12px; }
.p-lg   { padding: 16px; }
.px-md  { padding-left: 12px; padding-right: 12px; }
.py-sm  { padding-top: 8px; padding-bottom: 8px; }

/* Typography */
.text-xs    { font-size: 12px; }
.text-sm    { font-size: 13px; }
.text-base  { font-size: 15px; }
.text-lg    { font-size: 18px; }
.text-xl    { font-size: 22px; }
.font-normal{ font-weight: 400; }
.font-bold  { font-weight: 700; }
.font-black { font-weight: 900; }
.leading-tight { line-height: 1.3; }

/* Colors */
.text-primary  { color: var(--primary); }
.text-success  { color: var(--success); }
.text-danger   { color: var(--danger); }
.text-warning  { color: var(--warning); }
.text-muted    { color: var(--text-3); }
.text-white    { color: #fff; }
.bg-primary-soft { background: var(--primary-bg); }
.bg-surface    { background: var(--surface); }

/* Borders */
.border-top    { border-top: 1px solid var(--border); }
.border-bottom { border-bottom: 1px solid var(--border); }
.rounded       { border-radius: var(--r-md); }
.rounded-lg    { border-radius: var(--r-lg); }
.rounded-full  { border-radius: 100px; }

/* Visibility */
.hidden  { display: none !important; }
.invisible { visibility: hidden; }

/* Splash / loading screen */
.splash-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  text-align: center;
  padding: 40px;
}
.splash-logo  { font-size: 72px; margin-bottom: 16px; }
.splash-title {
  font-family: 'Poppins', sans-serif;
  font-size: 28px; font-weight: 800;
  color: var(--primary); margin-bottom: 8px;
}
.splash-sub { font-size: 15px; color: var(--text-3); margin-bottom: 32px; }
