/* ============================================================
   SomPerfect - Mobile-First CSS
   Optimized for 360px - 430px screens
   ============================================================ */

/* ---- CSS Variables ---- */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --secondary: #0f172a;
  --success: #16a34a;
  --success-light: #dcfce7;
  --warning: #d97706;
  --warning-light: #fef3c7;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --info: #0891b2;
  --info-light: #cffafe;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --white: #ffffff;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);
  --transition: all .2s cubic-bezier(.4,0,.2,1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --nav-height: 64px;
  --bottom-nav: 68px;
}

/* Dark mode */
[data-theme="dark"] {
  --primary-light: #1e3a8a;
  --gray-50: #0f172a;
  --gray-100: #1e293b;
  --gray-200: #334155;
  --gray-300: #475569;
  --gray-400: #64748b;
  --gray-500: #94a3b8;
  --gray-600: #cbd5e1;
  --gray-700: #e2e8f0;
  --gray-800: #f1f5f9;
  --gray-900: #f8fafc;
  --white: #1e293b;
  --shadow: 0 1px 3px rgba(0,0,0,.3);
  --shadow-md: 0 4px 6px rgba(0,0,0,.3);
}

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

/* ---- Typography ---- */
h1 { font-size: 1.5rem; font-weight: 700; }
h2 { font-size: 1.25rem; font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 600; }
h4 { font-size: 1rem; font-weight: 600; }
p  { font-size: .95rem; }

/* ---- Layout ---- */
.app-wrapper {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--gray-100);
  position: relative;
}

.main-content {
  padding: 16px 16px calc(var(--bottom-nav) + 16px);
  padding-top: calc(var(--nav-height) + 16px);
}

/* Admin has no bottom nav */
.admin-layout .main-content {
  padding-bottom: 24px;
}

/* ---- Top Navigation ---- */
.top-nav {
  position: fixed;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: var(--nav-height);
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
  box-shadow: var(--shadow);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary);
}

.nav-logo svg { width: 28px; height: 28px; }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-icon-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--gray-100);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content:: center;
  position: relative;
  color: var(--gray-600);
}

.nav-icon-btn:hover { background: var(--gray-200); }
.nav-icon-btn svg { width: 20px; height: 20px; }

.notif-badge {
  position: absolute;
  top: 2px; right: 2px;
  width: 16px; height: 16px;
  background: var(--danger);
  color: white;
  font-size: 10px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

/* ---- Bottom Navigation ---- */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: var(--bottom-nav);
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
  box-shadow: 0 -2px 10px rgba(0,0,0,.06);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--gray-400);
  font-size: .7rem;
  font-weight: 500;
  text-decoration: none;
  min-width: 60px;
  transition: var(--transition);
}

.bottom-nav-item svg { width: 22px; height: 22px; }

.bottom-nav-item.active {
  color: var(--primary);
}

.bottom-nav-item.active svg {
  stroke: var(--primary);
}

.bottom-nav-center {
  width: 54px; height: 54px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -24px;
  box-shadow: 0 4px 12px rgba(37,99,235,.35);
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
}

.bottom-nav-center:hover { transform: scale(1.05); background: var(--primary-dark); }
.bottom-nav-center svg { width: 24px; height: 24px; stroke: white; }

/* ---- Cards ---- */
.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-800);
}

.card + .card { margin-top: 12px; }

/* ---- Wallet Balance Card ---- */
.balance-card {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  color: white;
  position: relative;
  overflow: hidden;
}

.balance-card::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 160px; height: 160px;
  background: rgba(255,255,255,.08);
  border-radius: 50%;
}

.balance-card::after {
  content: '';
  position: absolute;
  bottom: -60px; left: -30px;
  width: 200px; height: 200px;
  background: rgba(255,255,255,.05);
  border-radius: 50%;
}

.balance-card-label {
  font-size: .8rem;
  opacity: .75;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.balance-card-amount {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.2;
  margin: 8px 0;
  letter-spacing: -.02em;
}

.balance-card-currency {
  font-size: .85rem;
  opacity: .8;
  margin-left: 4px;
}

.balance-card-sub {
  display: flex;
  gap: 20px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,.15);
}

.balance-sub-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.balance-sub-label {
  font-size: .72rem;
  opacity: .65;
}

.balance-sub-value {
  font-size: .9rem;
  font-weight: 600;
}

.account-id-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.15);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: .78rem;
  margin-bottom: 12px;
}

/* ---- Wallet Tabs ---- */
.wallet-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0;
  scrollbar-width: none;
  margin-bottom: 12px;
}

.wallet-tabs::-webkit-scrollbar { display: none; }

.wallet-tab {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-500);
  transition: var(--transition);
}

.wallet-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* ---- Quick Actions ---- */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 16px 0;
}

.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.quick-action-icon {
  width: 52px; height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quick-action-icon svg { width: 22px; height: 22px; }
.quick-action-label { font-size: .72rem; font-weight: 500; color: var(--gray-600); text-align: center; }

.qa-deposit  .quick-action-icon { background: var(--success-light); color: var(--success); }
.qa-withdraw .quick-action-icon { background: var(--danger-light); color: var(--danger); }
.qa-transfer .quick-action-icon { background: var(--primary-light); color: var(--primary); }
.qa-history  .quick-action-icon { background: var(--warning-light); color: var(--warning); }

/* ---- Transaction List ---- */
.tx-list { display: flex; flex-direction: column; gap: 2px; }

.tx-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.tx-item:hover { background: var(--gray-50); }

.tx-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tx-icon svg { width: 18px; height: 18px; }
.tx-icon.in  { background: var(--success-light); color: var(--success); }
.tx-icon.out { background: var(--danger-light); color: var(--danger); }
.tx-icon.fee { background: var(--warning-light); color: var(--warning); }
.tx-icon.pending { background: var(--info-light); color: var(--info); }

.tx-info { flex: 1; min-width: 0; }
.tx-desc { font-size: .85rem; font-weight: 500; color: var(--gray-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-date { font-size: .75rem; color: var(--gray-400); margin-top: 2px; }

.tx-amount { text-align: right; flex-shrink: 0; }
.tx-amount-value { font-size: .9rem; font-weight: 700; }
.tx-amount-value.credit { color: var(--success); }
.tx-amount-value.debit  { color: var(--danger); }
.tx-status { font-size: .7rem; color: var(--gray-400); margin-top: 2px; }

/* ---- Forms ---- */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: .95rem;
  background: var(--white);
  color: var(--gray-800);
  transition: var(--transition);
  outline: none;
  appearance: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

.form-control::placeholder { color: var(--gray-400); }

select.form-control { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; padding-right: 36px; }

.form-hint { font-size: .75rem; color: var(--gray-400); margin-top: 4px; }

.form-error { font-size: .78rem; color: var(--danger); margin-top: 4px; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 20px;
  border-radius: var(--radius-sm);
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: scale(.98); }
.btn svg { width: 18px; height: 18px; }

.btn-primary   { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }

.btn-success   { background: var(--success); color: white; }
.btn-success:hover { background: #15803d; }

.btn-danger    { background: var(--danger); color: white; }
.btn-danger:hover { background: #b91c1c; }

.btn-outline   { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary-light); }

.btn-ghost     { background: var(--gray-100); color: var(--gray-700); }
.btn-ghost:hover { background: var(--gray-200); }

.btn-block     { width: 100%; }
.btn-sm        { padding: 8px 14px; font-size: .82rem; }
.btn-lg        { padding: 16px 24px; font-size: 1rem; }

/* ---- Badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 600;
}

.badge-success   { background: var(--success-light); color: var(--success); }
.badge-danger    { background: var(--danger-light); color: var(--danger); }
.badge-warning   { background: var(--warning-light); color: var(--warning); }
.badge-info      { background: var(--info-light); color: var(--info); }
.badge-secondary { background: var(--gray-100); color: var(--gray-500); }

/* ---- Alerts ---- */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}

.alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }

.alert-success { background: var(--success-light); color: #14532d; }
.alert-danger  { background: var(--danger-light); color: #7f1d1d; }
.alert-warning { background: var(--warning-light); color: #78350f; }
.alert-info    { background: var(--info-light); color: #164e63; }

/* ---- Stats Grid ---- */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }

.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}

.stat-label { font-size: .72rem; color: var(--gray-500); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.stat-value { font-size: 1.2rem; font-weight: 800; color: var(--gray-800); margin-top: 4px; }
.stat-change { font-size: .72rem; margin-top: 4px; }
.stat-change.up   { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ---- Page Header ---- */
.page-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.page-header-back {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-600);
  box-shadow: var(--shadow);
  flex-shrink: 0;
}

.page-header-back svg { width: 18px; height: 18px; }

.page-title { font-size: 1.15rem; font-weight: 700; }
.page-subtitle { font-size: .8rem; color: var(--gray-500); }

/* ---- Input with Icon ---- */
.input-group { position: relative; }

.input-group .form-control { padding-left: 42px; }

.input-icon {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  pointer-events: none;
}

.input-icon svg { width: 18px; height: 18px; }

.input-suffix {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  font-size: .82rem;
  font-weight: 600;
  color: var(--gray-500);
}

/* ---- Fee Box ---- */
.fee-box {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 16px;
}

.fee-row {
  display: flex;
  justify-content: space-between;
  font-size: .82rem;
  padding: 3px 0;
}

.fee-row-label { color: var(--gray-500); }
.fee-row-value { font-weight: 600; color: var(--gray-700); }
.fee-row.total .fee-row-label { font-weight: 700; color: var(--gray-800); }
.fee-row.total .fee-row-value { color: var(--primary); font-size: .9rem; }
.fee-divider { border: none; border-top: 1px solid var(--gray-200); margin: 8px 0; }

/* ---- Auth Screens ---- */
.auth-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px 20px;
  max-width: 480px;
  margin: 0 auto;
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
  margin-top: 20px;
}

.auth-logo-mark {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.auth-logo-mark svg { width: 36px; height: 36px; }

.auth-title { font-size: 1.5rem; font-weight: 800; color: var(--gray-900); }
.auth-subtitle { font-size: .88rem; color: var(--gray-500); margin-top: 4px; }

.auth-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-lg);
}

.auth-footer {
  text-align: center;
  margin-top: 20px;
  font-size: .85rem;
  color: var(--gray-500);
}

.auth-footer a { color: var(--primary); font-weight: 600; }

/* ---- Empty State ---- */
.empty-state {
  text-align: center;
  padding: 48px 24px;
}

.empty-state-icon {
  width: 64px; height: 64px;
  background: var(--gray-100);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: var(--gray-400);
}

.empty-state-icon svg { width: 28px; height: 28px; }
.empty-state-title { font-size: 1rem; font-weight: 600; color: var(--gray-700); }
.empty-state-desc { font-size: .85rem; color: var(--gray-400); margin-top: 6px; }

/* ---- Tabs ---- */
.tabs { display: flex; border-bottom: 2px solid var(--gray-200); margin-bottom: 16px; }

.tab {
  flex: 1;
  text-align: center;
  padding: 10px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--gray-500);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
}

.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ---- Data Table (for admin) ---- */
.table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table { width: 100%; border-collapse: collapse; font-size: .82rem; min-width: 500px; }
thead th {
  background: var(--gray-50);
  padding: 10px 12px;
  text-align: left;
  font-size: .72rem;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid var(--gray-200);
}

tbody td {
  padding: 12px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
}

tbody tr:hover { background: var(--gray-50); }

/* ---- Pagination ---- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 20px;
}

.page-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--gray-200);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .82rem;
  font-weight: 600;
  color: var(--gray-600);
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
}

.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: white; }
.page-btn.disabled { opacity: .4; pointer-events: none; }

/* ---- Toggle (dark mode) ---- */
.theme-toggle {
  width: 40px; height: 22px;
  border-radius: 11px;
  background: var(--gray-300);
  position: relative;
  cursor: pointer;
  border: none;
  transition: var(--transition);
}

.theme-toggle.on { background: var(--primary); }

.theme-toggle-knob {
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: white;
  transition: var(--transition);
}

.theme-toggle.on .theme-toggle-knob { left: 20px; }

/* ---- Notification Item ---- */
.notif-item {
  display: flex;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius-sm);
  border-left: 3px solid transparent;
  transition: var(--transition);
}

.notif-item.unread { border-left-color: var(--primary); background: var(--primary-light); }
.notif-item + .notif-item { margin-top: 6px; }

.notif-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--primary);
}

.notif-icon svg { width: 16px; height: 16px; }
.notif-title { font-size: .85rem; font-weight: 600; color: var(--gray-800); }
.notif-msg { font-size: .8rem; color: var(--gray-500); margin-top: 2px; }
.notif-time { font-size: .72rem; color: var(--gray-400); margin-top: 4px; }

/* ---- Upload Box ---- */
.upload-box {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}

.upload-box:hover { border-color: var(--primary); background: var(--primary-light); }
.upload-box svg { width: 32px; height: 32px; color: var(--gray-400); margin: 0 auto 8px; }
.upload-box input[type="file"] { display: none; }

/* ---- Crypto Address Box ---- */
.crypto-box {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.crypto-address {
  font-family: 'Courier New', monospace;
  font-size: .8rem;
  color: var(--gray-700);
  word-break: break-all;
  margin: 8px 0;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .8rem;
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px 0;
}

/* ---- Loading Spinner ---- */
.spinner {
  width: 24px; height: 24px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .6s linear infinite;
  margin: 0 auto;
}

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

/* ---- Progress Bar ---- */
.progress { height: 6px; background: var(--gray-200); border-radius: 3px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--primary); border-radius: 3px; transition: width .3s ease; }

/* ---- Skeleton Loading ---- */
.skeleton {
  background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-loading { to { background-position: -200% 0; } }

/* ---- Admin Sidebar (for larger screens) ---- */
@media (min-width: 768px) {
  .app-wrapper { max-width: 100%; }
  
  .admin-layout {
    display: flex;
    min-height: 100vh;
  }
  
  .admin-sidebar {
    width: 250px;
    background: var(--secondary);
    flex-shrink: 0;
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 200;
  }
  
  .admin-main { margin-left: 250px; flex: 1; }
  .admin-main .main-content { max-width: 1200px; padding: 24px; }
  
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
  table { min-width: unset; }
}

/* ---- Utilities ---- */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-sm { font-size: .82rem; }
.text-xs { font-size: .72rem; }
.text-muted { color: var(--gray-500); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-primary { color: var(--primary); }
.text-warning { color: var(--warning); }
.rounded { border-radius: var(--radius); }
.rounded-full { border-radius: 9999px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ---- Animations ---- */
.fade-in { animation: fadeIn .3s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.slide-up { animation: slideUp .3s ease; }

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