/* ============================================================
   NURRA — Main Stylesheet
   Brand: Teal #38D1CC · Purple #755CF6 · Navy #192445 · Light #F2F5FA
   Fonts: Sora (headings) + Plus Jakarta Sans (body)
   ============================================================ */

:root {
  /* Brand palette from identity */
  --teal:        #38D1CC;
  --teal-dark:   #22A8A4;
  --teal-light:  #E0FAF9;
  --purple:      #755CF6;
  --purple-dark: #5A3ED4;
  --purple-light:#EEE9FE;
  --navy:        #192445;
  --navy-mid:    #243560;
  --light:       #F2F5FA;

  /* Semantic */
  --brand:       #755CF6;
  --brand-dark:  #5A3ED4;
  --brand-light: #EEE9FE;
  --accent:      #38D1CC;
  --accent-dark: #22A8A4;
  --danger:      #EF4444;
  --warning:     #F59E0B;
  --success:     #38D1CC;

  /* Layout */
  --bg:          #F2F5FA;
  --surface:     #FFFFFF;
  --border:      #DDE3EF;
  --text:        #192445;
  --text-muted:  #6B7A9F;
  --sidebar-w:   248px;
  --radius:      10px;
  --shadow:      0 1px 4px rgba(25,36,69,.08);
  --shadow-md:   0 4px 20px rgba(25,36,69,.12);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Plus Jakarta Sans', sans-serif; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.6; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }

/* ── Layout ── */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w); background: #192445; color: #A8B8D8;
  display: flex; flex-direction: column; z-index: 100;
  transition: transform .25s;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 22px 20px; border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand-icon { font-size: 22px; }
.brand-name { font-family: 'Sora', sans-serif; font-size: 20px; font-weight: 700; color: #FFFFFF; letter-spacing: -.3px; }

.sidebar-nav { flex: 1; padding: 16px 12px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.sidebar-footer { padding: 12px 12px 20px; border-top: 1px solid rgba(255,255,255,.08); display: flex; flex-direction: column; gap: 2px; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px; color: #94A3B8;
  font-size: 14px; font-weight: 500; transition: background .15s, color .15s;
}
.nav-item:hover    { background: rgba(255,255,255,.06); color: #E2E8F0; text-decoration: none; }
.nav-item.active   { background: rgba(117,92,246,.25);  color: #C4B5FD; }
.nav-icon          { width: 18px; text-align: center; font-size: 15px; }
.nav-logout        { color: #FDA4AF; }
.nav-logout:hover  { background: rgba(229,57,53,.15); color: #FCA5A5; }

.main-wrap { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; height: 60px;
}
.menu-toggle { display: none; background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text); }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.wallet-pill {
  background: var(--brand-light); color: var(--brand-dark);
  padding: 5px 12px; border-radius: 20px; font-size: 13px; font-weight: 600;
}
.user-tag { font-size: 14px; color: var(--text-muted); font-weight: 500; }

.page-content { flex: 1; padding: 28px 28px 40px; max-width: 1200px; width: 100%; }

/* ── Cards ── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.card-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-family: 'Sora', sans-serif; font-size: 16px; font-weight: 600; }
.card-body { padding: 20px; }

/* ── Stat cards ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
.stat-label { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--text-muted); font-weight: 600; margin-bottom: 6px; }
.stat-value { font-family: 'Sora', sans-serif; font-size: 26px; font-weight: 700; color: var(--text); }
.stat-card.accent .stat-value { color: var(--accent-dark); }
.stat-card.brand  .stat-value { color: var(--brand); }
.stat-card.danger .stat-value { color: var(--danger); }

/* ── Forms ── */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .5px; }
.form-control {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid var(--border); border-radius: 8px;
  font-size: 15px; background: var(--surface); color: var(--text);
  transition: border-color .15s, box-shadow .15s; outline: none;
}
.form-control:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(26,115,232,.12); }
.form-control.error { border-color: var(--danger); }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 20px; border-radius: 8px; font-size: 14px;
  font-weight: 600; border: none; cursor: pointer; transition: .15s;
  text-decoration: none; white-space: nowrap;
}
.btn-primary  { background: var(--brand);   color: #fff; }
.btn-primary:hover  { background: var(--brand-dark); text-decoration: none; color: #fff; }
.btn-success  { background: var(--accent);  color: #fff; }
.btn-success:hover  { background: var(--accent-dark); text-decoration: none; color: #fff; }
.btn-danger   { background: var(--danger);  color: #fff; }
.btn-danger:hover   { filter: brightness(1.1); text-decoration: none; color: #fff; }
.btn-outline  { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover  { background: var(--bg); text-decoration: none; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ── Tables ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead { background: var(--bg); }
th { padding: 10px 14px; text-align: left; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); border-bottom: 1px solid var(--border); }
td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(26,115,232,.025); }

/* ── Badges ── */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; }
.badge-success   { background: #D1FAE5; color: #065F46; }
.badge-danger    { background: #FEE2E2; color: #991B1B; }
.badge-warning   { background: #FEF3C7; color: #92400E; }
.badge-secondary { background: #E2E8F0; color: #475569; }

/* ── Alerts ── */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 20px; font-size: 14px; font-weight: 500; }
.alert-success { background: #D1FAE5; color: #065F46; border: 1px solid #6EE7B7; }
.alert-danger   { background: #FEE2E2; color: #991B1B; border: 1px solid #FCA5A5; }
.alert-warning  { background: #FEF3C7; color: #92400E; border: 1px solid #FCD34D; }
.alert-info     { background: var(--brand-light); color: var(--brand-dark); border: 1px solid #BFDBFE; }

/* ── Token display ── */
.token-display {
  background: linear-gradient(135deg, #192445 0%, #2D3B70 60%, #3D2B7A 100%);
  color: #fff; border-radius: 14px; padding: 32px; text-align: center;
}
.token-label { font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: #94A3B8; margin-bottom: 10px; }
.token-value {
  font-family: 'Sora', monospace; font-size: 28px; font-weight: 700;
  letter-spacing: 4px; color: #38D1CC; word-break: break-all;
  background: rgba(255,255,255,.05); border-radius: 10px; padding: 16px 24px;
  border: 1px solid rgba(56,209,204,.3); cursor: pointer;
}
.token-units { font-size: 14px; color: #94A3B8; margin-top: 10px; }

/* ── Auth pages ── */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #192445; padding: 20px; }
.auth-card { background: var(--surface); border-radius: 16px; padding: 40px; width: 100%; max-width: 420px; box-shadow: var(--shadow-md); }
.auth-logo { text-align: center; margin-bottom: 32px; }
.auth-logo .brand-name { font-family: 'Sora', sans-serif; font-size: 28px; font-weight: 700; color: var(--brand); }
.auth-logo small { display: block; color: var(--text-muted); font-size: 13px; margin-top: 4px; }
.auth-title { font-family: 'Sora', sans-serif; font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.auth-sub { color: var(--text-muted); font-size: 14px; margin-bottom: 28px; }
.auth-link { text-align: center; font-size: 14px; color: var(--text-muted); margin-top: 20px; }

/* ── Page header ── */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.page-title { font-family: 'Sora', sans-serif; font-size: 22px; font-weight: 700; }
.page-sub { color: var(--text-muted); font-size: 14px; margin-top: 2px; }

/* ── Utility ── */
.flex { display: flex; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 13px; }
.text-right { text-align: right; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.fw-600 { font-weight: 600; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }

/* ── Pagination ── */
.pagination { display: flex; gap: 6px; margin-top: 20px; flex-wrap: wrap; }
.page-link { padding: 6px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; font-weight: 500; color: var(--text-muted); }
.page-link:hover { background: var(--brand-light); border-color: var(--purple); color: var(--brand); text-decoration: none; }
.page-link.active { background: var(--brand); color: #fff; border-color: var(--purple); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 20px rgba(0,0,0,.3); }
  .main-wrap { margin-left: 0; }
  .menu-toggle { display: block; }
  .page-content { padding: 16px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .token-value { font-size: 20px; letter-spacing: 2px; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  table { font-size: 13px; }
  th, td { padding: 8px 10px; }
}
