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

:root {
  --bg: #07070F;
  --bg2: #0E0E1A;
  --bg3: #141425;
  --blue: #4F8EF7;
  --purple: #8B5CF6;
  --green: #10B981;
  --red: #EF4444;
  --white: #F8FAFF;
  --muted: #6B7280;
  --border: rgba(255, 255, 255, 0.08);
  --glass: rgba(255, 255, 255, 0.04);
  --grad: linear-gradient(135deg, #4F8EF7, #8B5CF6);
  --sidebar-w: 240px;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--white);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 50;
  transition: transform 0.3s;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 24px 20px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  border-bottom: 1px solid var(--border);
}

.logo-icon {
  width: 34px;
  height: 34px;
  background: var(--grad);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.95rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 12px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  text-decoration: none;
  color: #9CA3AF;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--white);
}

.nav-item.active {
  background: rgba(79, 142, 247, 0.12);
  color: var(--blue);
  border: 1px solid rgba(79, 142, 247, 0.2);
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 600;
}

.user-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  color: var(--muted);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}

.logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--muted);
  border: 1px solid var(--border);
  background: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.logout-btn:hover {
  color: var(--red);
  border-color: rgba(239, 68, 68, 0.4);
}

/* MAIN */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  border-bottom: 1px solid var(--border);
  background: rgba(7, 7, 15, 0.8);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.page-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
}

.page-sub {
  font-size: 0.78rem;
  color: var(--muted);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
}

.notif-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.notif-btn:hover {
  border-color: rgba(79, 142, 247, 0.4);
}

.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--red);
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg);
}

.notif-dropdown {
  display: none;
  position: absolute;
  top: 48px;
  right: 0;
  width: 340px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.notif-dropdown.open {
  display: block;
}

.notif-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.notif-header span {
  font-weight: 600;
  font-size: 0.9rem;
}

.notif-header button {
  background: none;
  border: none;
  color: var(--blue);
  font-size: 0.8rem;
  cursor: pointer;
}

.notif-list {
  max-height: 320px;
  overflow-y: auto;
}

.notif-item {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}

.notif-item:hover {
  background: var(--glass);
}

.notif-item.unread {
  background: rgba(79, 142, 247, 0.04);
}

.notif-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
  margin-top: 6px;
  flex-shrink: 0;
}

.notif-item.unread .notif-dot {
  background: var(--blue);
}

.notif-item:not(.unread) .notif-dot {
  background: transparent;
  border: 1px solid var(--border);
}

.notif-item b {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 2px;
}

.notif-item p {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.notif-item span {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 4px;
  display: block;
}

.topbar-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
}

/* DASHBOARD BODY */
.dashboard-body {
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* CARDS ROW */
.cards-row {
  display: grid;
  grid-template-columns: 1fr repeat(3, auto);
  gap: 20px;
  align-items: stretch;
}

.balance-card {
  background: var(--grad);
  border-radius: 24px;
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 160px;
  position: relative;
  overflow: hidden;
}

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

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

.balance-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: relative;
  z-index: 1;
}

.balance-label {
  font-size: 0.82rem;
  opacity: 0.85;
  margin-bottom: 8px;
}

.balance-amount {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -1px;
}

.balance-change {
  font-size: 0.8rem;
  opacity: 0.85;
  margin-top: 4px;
}

.balance-flag {
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.15);
  padding: 6px 12px;
  border-radius: 20px;
}

.balance-card-footer {
  display: flex;
  align-items: center;
  gap: 24px;
  position: relative;
  z-index: 1;
  margin-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 16px;
}

.bc-stat span {
  display: block;
  font-size: 0.72rem;
  opacity: 0.8;
  margin-bottom: 2px;
}

.bc-stat b {
  font-size: 0.9rem;
  font-weight: 700;
}

.bc-divider {
  width: 1px;
  height: 32px;
  background: rgba(255, 255, 255, 0.2);
}

.mini-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 22px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 170px;
  transition: all 0.3s;
}

.mini-card:hover {
  border-color: rgba(79, 142, 247, 0.3);
  transform: translateY(-2px);
}

.mini-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  flex-shrink: 0;
}

.mini-card-icon.green {
  background: rgba(16, 185, 129, 0.15);
  color: var(--green);
}

.mini-card-icon.red {
  background: rgba(239, 68, 68, 0.15);
  color: var(--red);
}

.mini-card-icon.blue {
  background: rgba(79, 142, 247, 0.15);
  color: var(--blue);
}

.mini-label {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.mini-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
}

.mini-sub {
  font-size: 0.72rem;
  color: var(--muted);
}

.green-text {
  color: var(--green);
}

.red-text {
  color: var(--red);
}

.blue-text {
  color: var(--blue);
}

/* QUICK ACTIONS */
.section-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.quick-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.qa-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 24px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--white);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  min-width: 90px;
  font-family: 'Inter', sans-serif;
}

.qa-btn:hover {
  background: rgba(79, 142, 247, 0.08);
  border-color: rgba(79, 142, 247, 0.3);
  transform: translateY(-3px);
}

.qa-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

/* CHART + TX GRID */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 20px;
}

.chart-card,
.recent-tx-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 28px;
}

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

.card-header h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 700;
}

.chart-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg);
  border-radius: 8px;
  padding: 3px;
}

.chart-tab {
  padding: 6px 14px;
  border-radius: 6px;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}

.chart-tab.active {
  background: var(--bg2);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.see-all {
  color: var(--blue);
  font-size: 0.82rem;
  text-decoration: none;
}

.see-all:hover {
  text-decoration: underline;
}

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

.tx-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 8px;
  border-radius: 12px;
  transition: background 0.2s;
  cursor: pointer;
}

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

.tx-emoji {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.tx-details {
  flex: 1;
}

.tx-details b {
  display: block;
  font-size: 0.88rem;
  margin-bottom: 2px;
}

.tx-details span {
  font-size: 0.75rem;
  color: var(--muted);
}

.tx-amount {
  font-weight: 700;
  font-size: 0.9rem;
}

/* CATEGORIES */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.cat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  transition: all 0.2s;
}

.cat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(79, 142, 247, 0.2);
}

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

.cat-icon {
  font-size: 1.3rem;
}

.cat-pct {
  font-size: 0.75rem;
  color: var(--muted);
}

.cat-name {
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.cat-amount {
  font-size: 0.82rem;
  color: var(--muted);
}

.cat-bar {
  height: 4px;
  background: var(--bg);
  border-radius: 2px;
  margin-top: 12px;
  overflow: hidden;
}

.cat-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 1s ease;
}

/* MODALS */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 200;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 24px;
  width: 100%;
  max-width: 440px;
  overflow: hidden;
  animation: slideUp 0.3s ease;
}

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

  to {
    transform: translateY(0);
    opacity: 1
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 28px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
}

.modal-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.1rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.modal-close:hover {
  background: var(--glass);
  color: var(--white);
}

.modal-body {
  padding: 24px 28px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  margin-bottom: 8px;
  color: #D1D5DB;
}

.input-wrap {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
}

.input-wrap input {
  width: 100%;
  padding: 13px 14px 13px 40px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--white);
  font-size: 0.92rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: all 0.2s;
}

.input-wrap input:focus {
  border-color: var(--blue);
}

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

.btn-submit-modal {
  width: 100%;
  padding: 14px;
  background: var(--grad);
  color: var(--white);
  border: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  font-family: 'Inter', sans-serif;
  margin-top: 4px;
}

.btn-submit-modal:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(79, 142, 247, 0.25);
}

.modal-disclaimer {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  margin-top: 12px;
  line-height: 1.6;
}

.quick-amounts {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.quick-amounts button {
  flex: 1;
  padding: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--white);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}

.quick-amounts button:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.receive-info-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
}

.rib-label {
  font-size: 0.75rem;
  color: var(--blue);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
}

.rib-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.rib-row:last-child {
  border-bottom: none;
}

.rib-row span {
  font-size: 0.82rem;
  color: var(--muted);
}

.rib-row b {
  font-size: 0.88rem;
  font-weight: 600;
}

.success-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 8px;
  animation: successPop 0.4s ease;
}

@keyframes successPop {
  0% {
    transform: scale(0)
  }

  70% {
    transform: scale(1.1)
  }

  100% {
    transform: scale(1)
  }
}

@media(max-width:1100px) {
  .cards-row {
    grid-template-columns: 1fr;
  }
}

@media(max-width:900px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .hamburger {
    display: flex;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-body {
    padding: 20px 16px;
  }

  .topbar {
    padding: 16px;
  }
}

@media(max-width:600px) {
  .mini-card {
    min-width: 0;
  }

  .quick-actions {
    gap: 8px;
  }

  .qa-btn {
    padding: 14px 16px;
    min-width: 70px;
  }
}