@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=DM+Mono:wght@300;400;500&family=DM+Sans:wght@300;400;500&display=swap');

:root {
  --bg:        #080A0F;
  --bg2:       #0D1117;
  --bg3:       #111620;
  --border:    rgba(255,255,255,0.06);
  --border-hi: rgba(255,255,255,0.14);
  --text:      #E8EDF5;
  --muted:     #5B6478;
  --accent:    #7DF9C5;
  --accent2:   #5E6BFF;
  --accent3:   #FF6B9D;
  --gold:      #F0C060;
  --red:       #FF5E6B;
  --sidebar-w: 240px;
  --radius:    16px;
  --radius-sm: 10px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Grain overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: 0.5;
}

a { color: inherit; text-decoration: none; }

/* ── SIDEBAR ── */
.sidebar {
  position: fixed;
  left: 0; top: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 28px 20px 24px;
  z-index: 100;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 36px;
  padding: 0 4px;
}

.sidebar-logo img { width: 32px; height: 32px; object-fit: contain; }

.sidebar-logo-text {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar nav { flex: 1; }

.sidebar ul { list-style: none; display: flex; flex-direction: column; gap: 2px; }

.sidebar li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: all 0.2s ease;
  position: relative;
}

.sidebar li a svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.sidebar li a:hover,
.sidebar li a.active {
  background: rgba(125, 249, 197, 0.07);
  color: var(--accent);
}

.sidebar li a.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--accent);
  border-radius: 0 4px 4px 0;
}

.sidebar-footer {
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg3);
  border: 1px solid var(--border);
}

.user-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 500; }
.user-role { font-size: 11px; color: var(--muted); }

/* ── MAIN ── */
.main {
  margin-left: var(--sidebar-w);
  padding: 40px 44px;
  min-height: 100vh;
}

/* ── PAGE HEADER ── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 32px;
}

.page-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 26px;
  letter-spacing: -0.03em;
}

.page-subtitle {
  font-size: 14px;
  color: var(--muted);
  margin-top: 4px;
}

/* ── CARDS ── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s;
}

.card:hover { border-color: var(--border-hi); }

/* ── BALANCE CARD ── */
.balance-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  position: relative;
  overflow: hidden;
}

.balance-card::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 260px; height: 260px;
  background: radial-gradient(circle, rgba(125,249,197,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.balance-label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

.balance-amount {
  font-family: 'DM Mono', monospace;
  font-size: 48px;
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1;
  background: linear-gradient(135deg, #fff 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}

.balance-usd {
  font-size: 16px;
  color: var(--muted);
  font-family: 'DM Mono', monospace;
}

.balance-chips {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 100px;
  background: var(--bg3);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 500;
}

.chip-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
}

.chip-dot.green { background: var(--accent); box-shadow: 0 0 6px var(--accent); }
.chip-dot.blue  { background: var(--accent2); box-shadow: 0 0 6px var(--accent2); }

/* ── QUICK ACTIONS ── */
.quick-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

.quick-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.quick-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(125, 249, 197, 0.06);
}

.quick-btn svg { width: 16px; height: 16px; }

/* ── GRID LAYOUTS ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }

/* ── STAT CARD ── */
.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.stat-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 10px;
}

.stat-value {
  font-family: 'DM Mono', monospace;
  font-size: 26px;
  font-weight: 400;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.stat-change {
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-change.up { color: var(--accent); }
.stat-change.down { color: var(--red); }

/* ── STAKING PROGRESS ── */
.staking-ring-wrap {
  display: flex;
  align-items: center;
  gap: 28px;
}

.ring-svg { width: 100px; height: 100px; flex-shrink: 0; }

.ring-bg { fill: none; stroke: var(--bg3); stroke-width: 8; }

.ring-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 251.2;
  stroke-dashoffset: 87.9; /* 65% progress */
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  filter: drop-shadow(0 0 6px rgba(125,249,197,0.6));
  transition: stroke-dashoffset 1s ease;
}

.ring-label {
  position: relative;
  font-family: 'DM Mono', monospace;
  font-size: 20px;
  font-weight: 500;
  text-align: center;
}

.ring-text { text-align: left; }
.ring-text h3 { font-family: 'Syne', sans-serif; font-size: 16px; margin-bottom: 6px; }
.ring-text p { font-size: 13px; color: var(--muted); line-height: 1.6; }

.ring-pct {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Mono', monospace;
  font-size: 18px;
  color: var(--accent);
  pointer-events: none;
}

/* ── TABLE ── */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  text-align: left;
  padding: 10px 16px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

tbody tr:hover { background: rgba(255,255,255,0.02); }
tbody tr:last-child { border-bottom: none; }

tbody td {
  padding: 14px 16px;
  font-size: 14px;
}

.tx-type {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.tx-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.tx-dot.in  { background: var(--accent); box-shadow: 0 0 5px var(--accent); }
.tx-dot.out { background: var(--accent3); box-shadow: 0 0 5px var(--accent3); }
.tx-dot.stk { background: var(--gold); box-shadow: 0 0 5px var(--gold); }

.amount-in  { color: var(--accent); font-family: 'DM Mono', monospace; }
.amount-out { color: var(--accent3); font-family: 'DM Mono', monospace; }
.amount-stk { color: var(--gold); font-family: 'DM Mono', monospace; }

.tx-hash {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--muted);
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.badge-confirmed { background: rgba(125,249,197,0.12); color: var(--accent); }
.badge-pending   { background: rgba(240,192,96,0.12); color: var(--gold); }

/* ── FORMS ── */
.form-group { margin-bottom: 20px; }

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input::placeholder { color: var(--muted); }

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(125, 249, 197, 0.1);
}

.form-input.mono {
  font-family: 'DM Mono', monospace;
  font-size: 14px;
}

.form-hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--accent);
  color: #050805;
}

.btn-primary:hover {
  background: #a0fcd8;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(125, 249, 197, 0.25);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  border-color: var(--border-hi);
  background: var(--bg3);
}

.btn-danger {
  background: rgba(255, 94, 107, 0.1);
  color: var(--red);
  border: 1px solid rgba(255, 94, 107, 0.2);
}

.btn-danger:hover {
  background: rgba(255, 94, 107, 0.2);
}

.btn-full { width: 100%; }

.btn svg { width: 16px; height: 16px; }

/* ── ADDRESS BOX ── */
.address-box {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  word-break: break-all;
  line-height: 1.7;
  color: var(--text);
  letter-spacing: 0.03em;
}

/* ── QR PLACEHOLDER ── */
.qr-wrap {
  width: 160px; height: 160px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg3);
  margin: 24px auto;
}

.qr-inner {
  width: 120px; height: 120px;
  background: repeating-linear-gradient(
    0deg,
    var(--border) 0px, var(--border) 1px,
    transparent 1px, transparent 5px
  ),
  repeating-linear-gradient(
    90deg,
    var(--border) 0px, var(--border) 1px,
    transparent 1px, transparent 5px
  );
  border-radius: 4px;
}

/* ── CONF METER ── */
.conf-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}

.conf-bar-wrap {
  flex: 1;
  height: 6px;
  background: var(--bg3);
  border-radius: 100px;
  overflow: hidden;
}

.conf-bar {
  height: 100%;
  border-radius: 100px;
  background: var(--accent);
  width: calc(3 / 7 * 100%);
  box-shadow: 0 0 8px rgba(125,249,197,0.5);
}

/* ── TOGGLE ── */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.toggle-row:last-child { border-bottom: none; }

.toggle-info h4 { font-size: 14px; font-weight: 500; margin-bottom: 3px; }
.toggle-info p  { font-size: 12px; color: var(--muted); }

.toggle {
  width: 40px; height: 22px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 100px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}

.toggle.on { background: var(--accent); border-color: var(--accent); }

.toggle::after {
  content: '';
  position: absolute;
  left: 3px; top: 3px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: left 0.2s;
}

.toggle.on::after { left: 21px; }

/* ── ADMIN PENDING ── */
.pending-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}

.pending-item:last-child { border-bottom: none; }

.pending-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: rgba(240,192,96,0.1);
  border: 1px solid rgba(240,192,96,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  flex-shrink: 0;
}

.pending-info { flex: 1; }
.pending-info h4 { font-size: 14px; font-weight: 500; }
.pending-info p { font-size: 12px; color: var(--muted); margin-top: 2px; }

.pending-amount {
  font-family: 'DM Mono', monospace;
  font-size: 16px;
  font-weight: 500;
  color: var(--gold);
  margin-right: 16px;
}

.pending-actions { display: flex; gap: 8px; }

/* ── LOGIN SCREEN ── */
.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  position: relative;
}

.login-bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 700px 500px at 20% 50%, rgba(94, 107, 255, 0.06) 0%, transparent 70%),
    radial-gradient(ellipse 600px 600px at 80% 20%, rgba(125, 249, 197, 0.05) 0%, transparent 70%),
    var(--bg);
  pointer-events: none;
}

.login-card {
  position: relative;
  z-index: 1;
  width: 420px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px;
}

.login-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 36px;
}

.login-logo img { width: 44px; margin-bottom: 12px; }

.login-logo h1 {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 24px;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-logo p { font-size: 13px; color: var(--muted); margin-top: 4px; }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--muted);
  font-size: 12px;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── SECTION TITLE ── */
.section-title {
  font-family: 'Syne', sans-serif;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
}

/* ── SPACER ── */
.mb-4  { margin-bottom: 4px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }

.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }

.text-muted  { color: var(--muted); }
.text-accent { color: var(--accent); }
.text-sm     { font-size: 13px; }
.text-mono   { font-family: 'DM Mono', monospace; }

/* ── WARN BOX ── */
.warn-box {
  background: rgba(255, 107, 157, 0.06);
  border: 1px solid rgba(255, 107, 157, 0.15);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 13px;
  color: var(--accent3);
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.warn-box svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 1px; }

/* ── SCROLL ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg3); border-radius: 100px; }

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.main > * {
  animation: fadeUp 0.4s ease both;
}

.main > *:nth-child(1) { animation-delay: 0.05s; }
.main > *:nth-child(2) { animation-delay: 0.12s; }
.main > *:nth-child(3) { animation-delay: 0.19s; }
.main > *:nth-child(4) { animation-delay: 0.26s; }
