:root {
  --bg: #020617;
  --panel: rgba(2,6,23,.9);
  --panel2: rgba(2,6,23,.6);
  --border: #1e293b;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --accent: #6366f1;
  --accent2: #4f46e5;
  --danger: #ef4444;
}

/* ===== Light Theme ===== */
.theme-light {
  --bg: #f8fafc;
  --panel: rgba(255,255,255,.85);
  --panel2: rgba(255,255,255,.6);
  --border: #e5e7eb;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #6366f1;
  --accent2: #4f46e5;
  --danger: #ef4444;
}

/* ===== Global ===== */
* {
  box-sizing: border-box;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  margin: 0;
  background: linear-gradient(180deg, var(--bg), #0f172a);
  color: var(--text);
}

/* ===== App Layout ===== */
.app {
  display: flex;
  min-height: 100vh;
}

/* ===== Sidebar ===== */
.sidebar {
  width: 240px;
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.logo {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 2rem;
}

.nav-item {
  display: block;
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 8px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.nav-item:hover {
  background: rgba(99,102,241,.15);
}

.nav-item.active {
  background: rgba(99,102,241,.25);
}

.nav-item.danger:hover {
  background: rgba(239,68,68,.15);
}

/* ===== Main Content ===== */
.main {
  flex: 1;
  padding: 2rem;
}

/* ===== Cards ===== */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 20px 40px rgba(0,0,0,.4);
}

/* ===== Grid ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

/* ===== Stats ===== */
.stat {
  font-size: 2.4rem;
  font-weight: 800;
}

.muted {
  color: var(--muted);
}

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  padding: 10px 16px;
  background: var(--accent);
  color: white;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .1s ease, opacity .2s ease;
}

.btn:hover {
  opacity: .9;
  transform: translateY(-1px);
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
}

.btn.secondary {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.16);
  color: var(--text);
}

.btn.outline {
  background: transparent;
  border: 1px solid rgba(255,255,255,.4);
  color: var(--text);
}

/* ===== Forms ===== */
input, select {
  width: 100%;
  padding: 12px;
  margin-bottom: 14px;
  background: rgba(0,0,0,.25);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
}

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

/* ===== Toast ===== */
#toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--accent);
  color: white;
  padding: 14px 18px;
  border-radius: 12px;
  display: none;
  box-shadow: 0 20px 40px rgba(0,0,0,.4);
}

/* ===== Skeleton ===== */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg) 25%,
    #1e293b 37%,
    var(--bg) 63%
  );
  background-size: 400% 100%;
  animation: shimmer 1.4s infinite;
  height: 20px;
  border-radius: 6px;
}

@keyframes shimmer {
  0% { background-position: 100% 0 }
  100% { background-position: -100% 0 }
}

/* ===== Wallet UI ===== */
.wallet-container {
  max-width: 960px;
  margin: auto;
  padding: 1.5rem;
}

.wallet-balance {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 22px;
  padding: 1.5rem;
  color: white;
  margin-bottom: 2rem;
}

.wallet-balance .label {
  opacity: .85;
  font-size: .9rem;
}

.wallet-balance .amount {
  font-size: 2.2rem;
  font-weight: 800;
  margin: .5rem 0 1rem;
}

.wallet-actions {
  display: flex;
  gap: 1rem;
}

.wallet-btn {
  flex: 1;
  padding: 12px;
  border-radius: 14px;
  border: none;
  font-weight: 700;
  background: white;
  color: var(--accent2);
  cursor: pointer;
}

.wallet-btn.outline {
  background: transparent;
  border: 1px solid rgba(255,255,255,.4);
  color: white;
}

/* ===== Sections ===== */
.section-title {
  font-size: 1rem;
  margin: 1.5rem 0 .5rem;
  color: #c7d2fe;
}

/* ===== Assets ===== */
.asset-list {
  background: var(--panel2);
  border-radius: 18px;
  overflow: hidden;
}

.asset {
  display: flex;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

.asset:last-child {
  border-bottom: none;
}

.asset-left {
  display: flex;
  gap: .75rem;
  align-items: center;
}

.asset-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.asset-name {
  font-weight: 700;
}

.asset-symbol {
  font-size: .75rem;
  color: var(--muted);
}

.asset-right {
  text-align: right;
}

.asset-balance {
  font-weight: 700;
}

/* ===== Transactions ===== */
.tx-list {
  background: var(--panel2);
  border-radius: 18px;
  margin-top: .5rem;
}

.tx {
  display: flex;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

.tx:last-child {
  border-bottom: none;
}

.tx-left {
  display: flex;
  gap: .75rem;
}

.tx-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.tx-icon.receive {
  background: rgba(34,197,94,.15);
  color: #22c55e;
}

.tx-icon.send {
  background: rgba(239,68,68,.15);
  color: #ef4444;
}

.tx-amount.positive {
  color: #22c55e;
}

.tx-amount.negative {
  color: #ef4444;
}

.tx-date {
  font-size: .75rem;
  color: var(--muted);
}

/* ===== Profile ===== */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

.profile-item {
  padding: 1rem;
  border: 1px solid var(--border);
  background: rgba(2,6,23,.55);
  border-radius: 14px;
}

.profile-label {
  color: var(--muted);
  font-size: .85rem;
}

.profile-value {
  font-weight: 700;
  margin-top: .35rem;
}

.theme-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

/* ===== Login ===== */
.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: linear-gradient(180deg, var(--bg), #0f172a);
}

.login-card {
  width: 100%;
  max-width: 420px;
  padding: 1.5rem;
  border-radius: 22px;
  background: rgba(2, 6, 23, 0.85);
  border: 1px solid var(--border);
  box-shadow: 0 20px 50px rgba(0,0,0,.5);
}

.login-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-top: 0.5rem;
  text-align: center;
}

.login-subtitle {
  font-size: 0.95rem;
  color: var(--muted);
  text-align: center;
  margin-bottom: 1.2rem;
}

.login-form {
  display: grid;
  gap: 12px;
}

.login-form input {
  width: 100%;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,.25);
  color: var(--text);
}

.login-form .btn {
  width: 100%;
}

.theme-buttons {
  display: flex;
  gap: 0.8rem;
  margin-top: 1rem;
}

.theme-buttons .btn {
  flex: 1;
  padding: 10px;
}

.error {
  background: rgba(239, 68, 68, 0.15);
  color: #ff6b6b;
  border: 1px solid rgba(239, 68, 68, 0.35);
  padding: 10px;
  border-radius: 12px;
  margin-bottom: 1rem;
  text-align: center;
}

/* ===== Modal ===== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 50;
  padding: 1.5rem;
  display: grid;
  place-items: center;
}

.modal-content {
  width: 100%;
  max-width: 420px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 1.5rem;
}

/* ===== Bottom Navigation ===== */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--panel);
  border-top: 1px solid var(--border);
  padding: 0.5rem 0;
  display: flex;
  justify-content: space-around;
  z-index: 100;
}

.bottom-nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 12px;
}

.bottom-nav a.active {
  background: rgba(99,102,241,.25);
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .sidebar {
    display: none;
  }

  .main {
    padding: 1.2rem;
  }

  .wallet-container {
    padding-bottom: 5.5rem; /* space for bottom nav */
  }

  .bottom-nav {
    display: flex;
  }
}

@media (max-width: 420px) {
  .wallet-balance .amount {
    font-size: 1.9rem;
  }

  .wallet-actions {
    flex-direction: column;
  }

  .wallet-btn {
    width: 100%;
  }
}
/* ===== Perfect Centering ===== */
html, body {
  height: 100%;
  margin: 0;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center; /* centers vertically & horizontally */
  padding: 1.5rem;
  background: linear-gradient(180deg, var(--bg), #0f172a);
}

.login-card {
  width: 100%;
  max-width: 420px;
  padding: 1.5rem;
  border-radius: 24px;
  background: rgba(2, 6, 23, 0.85);
  border: 1px solid var(--border);
  box-shadow: 0 20px 50px rgba(0,0,0,.5);
}
.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: linear-gradient(180deg, var(--bg), #0f172a);
}

.login-card {
  width: 100%;
  max-width: 420px;
  padding: 1.5rem;
  border-radius: 24px;
  background: rgba(2, 6, 23, 0.85);
  border: 1px solid var(--border);
  box-shadow: 0 20px 50px rgba(0,0,0,.5);
}

.login-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-top: 0.5rem;
  text-align: center;
}

.login-subtitle {
  font-size: 0.95rem;
  color: var(--muted);
  text-align: center;
  margin-bottom: 1.2rem;
}

.login-form {
  display: grid;
  gap: 12px;
}

.login-form input {
  width: 100%;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,.25);
  color: var(--text);
}

.login-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,.25);
}

.login-form .btn {
  width: 100%;
}

.error {
  background: rgba(239, 68, 68, 0.15);
  color: #ff6b6b;
  border: 1px solid rgba(239, 68, 68, 0.35);
  padding: 10px;
  border-radius: 12px;
  margin-bottom: 1rem;
  text-align: center;
}
