
:root {
  --bg: #090b13;
  --panel: rgba(20, 24, 39, 0.88);
  --panel-light: #1a2032;
  --border: rgba(255, 255, 255, 0.08);
  --text: #f4f5fb;
  --muted: #9299ad;
  --purple: #9c7aff;
  --blue: #62a5ff;
  --green: #47d7a1;
  --orange: #ffad70;
}

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

html {
  scroll-behavior: smooth;
}

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

button, input, select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.background-glow {
  position: fixed;
  width: 350px;
  height: 350px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.14;
  pointer-events: none;
  z-index: -1;
}

.glow-one {
  background: #8055ff;
  top: -120px;
  left: 20%;
}

.glow-two {
  background: #168dca;
  bottom: -140px;
  right: 5%;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

/* SIDEBAR */

.sidebar {
  width: 245px;
  padding: 30px 20px;
  border-right: 1px solid var(--border);
  background: rgba(12, 15, 26, 0.9);
  position: fixed;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  z-index: 5;
  backdrop-filter: blur(20px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 21px;
  font-weight: 700;
  margin-bottom: 58px;
}

.brand-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, #9c7aff, #5a75f5);
  box-shadow: 0 5px 25px #8e68ff55;
}

.brand-ai {
  color: var(--purple);
}

.sidebar-label, .eyebrow {
  color: #858ca4;
  font-size: 10px;
  letter-spacing: 1.5px;
  font-weight: 700;
}

.sidebar-label {
  margin: 0 0 17px 10px;
}

.navigation {
  display: grid;
  gap: 9px;
}

.nav-item {
  padding: 14px 13px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 14px;
  transition: 0.3s ease;
}

.nav-item span {
  margin-right: 9px;
}

.nav-item:hover,
.nav-item.active {
  color: white;
  background: linear-gradient(100deg, #8e6aff2c, #8e6aff08);
  box-shadow: inset 3px 0 var(--purple);
  transform: translateX(3px);
}

.sidebar-bottom {
  margin-top: auto;
}

.sidebar-tip {
  background: linear-gradient(145deg, #30245a, #1c1e38);
  padding: 20px 15px;
  border: 1px solid #9b7aff33;
  border-radius: 15px;
  margin-bottom: 25px;
}

.tip-icon {
  color: #c3adff;
  font-size: 22px;
}

.sidebar-tip h3 {
  margin: 12px 0 7px;
  font-family: "Space Grotesk";
}

.sidebar-tip p {
  color: #b4b1cb;
  font-size: 12px;
  line-height: 1.7;
}

.sidebar-footer {
  color: var(--muted);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 5px;
}

.online-dot {
  width: 8px;
  height: 8px;
  background: var(--green);
  display: inline-block;
  border-radius: 50%;
  box-shadow: 0 0 10px var(--green);
}

/* MAIN */

.main-content {
  margin-left: 245px;
  width: calc(100% - 245px);
  padding: 30px 38px;
  max-width: 1700px;
  margin-right: auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 35px;
}

.breadcrumb {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 7px;
}

.topbar h1 {
  font: 600 25px "Space Grotesk";
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.live-status {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 9px;
}

.avatar {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, #9b7aff, #547cff);
  font-weight: 800;
}

/* WELCOME */

.welcome-section {
  position: relative;
  overflow: hidden;
  padding: 33px;
  border: 1px solid #a58aff25;
  border-radius: 19px;
  background: linear-gradient(115deg, #282046, #171b31 65%, #151b32);
  margin-bottom: 25px;
  animation: slideUp 0.7s ease both;
}

.welcome-section h2 {
  font: 700 clamp(25px, 3vw, 35px) "Space Grotesk";
  margin: 12px 0;
}

.welcome-section h2 span {
  color: #b49bff;
}

.welcome-section p {
  color: #b7b6ca;
  max-width: 570px;
  font-size: 13px;
  line-height: 1.8;
}

.welcome-decoration {
  position: absolute;
  right: 9%;
  top: 5px;
  font-size: 140px;
  color: #c1a8ff19;
  animation: float 5s ease-in-out infinite;
}

/* STATS */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 17px;
  margin-bottom: 25px;
}

.stat-card, .panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  backdrop-filter: blur(15px);
}

.stat-card {
  padding: 21px;
  transition: transform 0.3s, border-color 0.3s;
  animation: slideUp 0.65s ease both;
}

.stat-card:nth-child(2) { animation-delay: .08s; }
.stat-card:nth-child(3) { animation-delay: .16s; }
.stat-card:nth-child(4) { animation-delay: .24s; }

.stat-card:hover {
  transform: translateY(-5px);
  border-color: #a38aff66;
}

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.stat-icon {
  width: 33px;
  height: 33px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-weight: 700;
}

.purple { background: #9877ff20; color: var(--purple); }
.blue { background: #62a5ff20; color: var(--blue); }
.green { background: #47d7a120; color: var(--green); }
.orange { background: #ffad7020; color: var(--orange); }

.stat-card h2 {
  font: 700 25px "Space Grotesk";
  margin: 17px 0 5px;
  overflow-wrap: anywhere;
}

.stat-card p {
  color: #747d94;
  font-size: 11px;
}

/* PANELS */

.content-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.85fr;
  gap: 20px;
  margin-bottom: 23px;
}

.panel {
  padding: 24px;
}

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

.panel-heading h3, .ai-heading h3 {
  font: 600 19px "Space Grotesk";
  margin-top: 7px;
}

.chart-label {
  color: #aaa3c6;
  background: #a58aff17;
  border: 1px solid #a58aff2c;
  border-radius: 20px;
  padding: 7px 12px;
  font-size: 11px;
}

.chart-container {
  position: relative;
  height: 275px;
  margin-top: 25px;
}

.chart-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  pointer-events: none;
}

.chart-empty span {
  font-size: 38px;
  color: var(--purple);
}

.chart-empty p {
  font-size: 12px;
  margin-top: 10px;
}

.add-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: var(--green);
  background: #47d7a120;
  font-size: 23px;
}

.add-panel form {
  display: flex;
  flex-direction: column;
  margin-top: 23px;
}

label {
  color: #b4bacb;
  font-size: 12px;
  margin-bottom: 8px;
}

input, select {
  width: 100%;
  padding: 12px 13px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  outline: none;
  background: #111625;
  color: white;
  border-radius: 9px;
  font-size: 13px;
  transition: 0.25s;
}

input:focus, select:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px #9c7aff19;
}

input::placeholder {
  color: #737b90;
}

select option {
  background: #111625;
}

.primary-button, .ai-button {
  border: none;
  border-radius: 10px;
  color: white;
  font-weight: 700;
  padding: 13px;
  background: linear-gradient(110deg, #916aff, #637cf5);
  box-shadow: 0 6px 20px #8d6bff35;
  transition: 0.3s;
}

.primary-button:hover, .ai-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px #8d6bff55;
  filter: brightness(1.1);
}

.primary-button span {
  margin-right: 8px;
}

.form-message, .ai-message {
  min-height: 17px;
  font-size: 12px;
  margin-top: 10px;
  color: var(--green);
}

/* TRANSACTIONS */

.transactions-panel {
  margin-bottom: 23px;
}

.secondary-button {
  border: 1px solid var(--border);
  background: #ffffff08;
  color: #c5bddf;
  border-radius: 9px;
  padding: 10px 13px;
  font-size: 11px;
  transition: 0.3s;
}

.secondary-button:hover {
  border-color: var(--purple);
  color: white;
  background: #9c7aff16;
}

.table-wrapper {
  overflow-x: auto;
  margin-top: 23px;
}

table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
  text-align: left;
}

th {
  color: #7e879e;
  font-size: 11px;
  font-weight: 600;
  padding: 13px 12px;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 16px 12px;
  border-bottom: 1px solid #ffffff08;
  color: #cbd0df;
  font-size: 12px;
}

tbody tr {
  transition: background 0.2s;
  animation: fadeIn 0.4s ease both;
}

tbody tr:hover {
  background: #ffffff06;
}

.amount-cell {
  color: var(--orange);
  font-weight: 700;
}

.category-pill {
  padding: 5px 9px;
  border-radius: 20px;
  background: #9c7aff16;
  color: #c0adff;
  font-size: 10px;
}

.delete-button {
  color: #ff858e;
  background: #ff858e12;
  border: 1px solid #ff858e25;
  border-radius: 7px;
  padding: 6px 9px;
  font-size: 11px;
  transition: 0.2s;
}

.delete-button:hover {
  background: #ff858e2b;
}

.empty-state {
  text-align: center;
  padding: 35px;
  color: var(--muted);
}

/* AI */

.ai-panel {
  position: relative;
  overflow: hidden;
  border-color: #a18aff35;
  background: linear-gradient(130deg, #211b3a, #171a2e 70%);
}

.ai-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 15px;
}

.ai-heading-left {
  display: flex;
  align-items: center;
  gap: 15px;
}

.ai-heading p {
  font-size: 12px;
  color: #9ea3bb;
  margin-top: 8px;
}

.ai-symbol {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: linear-gradient(135deg, #a17aff, #6559e8);
  font-size: 25px;
  box-shadow: 0 0 25px #9674ff45;
  animation: pulse 2.5s infinite;
}

.ai-badge {
  font-size: 9px;
  letter-spacing: 1px;
  padding: 8px 10px;
  color: #c9b7ff;
  background: #a17aff1d;
  border: 1px solid #a17aff38;
  border-radius: 20px;
}

.ai-content {
  margin: 25px 0;
  padding: 23px;
  min-height: 145px;
  border: 1px solid #a18aff22;
  border-radius: 12px;
  background: #090d1c66;
}

.ai-placeholder {
  text-align: center;
  padding: 10px;
}

.ai-placeholder span {
  font-size: 30px;
  color: #ad96ff;
}

.ai-placeholder h3 {
  font: 600 16px "Space Grotesk";
  margin: 9px 0;
}

.ai-placeholder p {
  color: #9299ad;
  font-size: 12px;
  line-height: 1.7;
}

.ai-result {
  color: #d9dced;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.9;
}

.ai-button {
  padding: 14px 20px;
}

.ai-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.ai-message {
  color: #c4b0ff;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 25px 5px 5px;
  color: #707a92;
  font-size: 11px;
}

/* ANIMATIONS */

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-15px) rotate(12deg); }
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 15px #9674ff30; }
  50% { box-shadow: 0 0 30px #9674ff75; }
}

/* RESPONSIVE */

@media (max-width: 1100px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

@media (max-width: 760px) {
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    padding: 15px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .brand {
    margin-bottom: 16px;
  }

  .sidebar-label, .sidebar-bottom {
    display: none;
  }

  .navigation {
    display: flex;
    gap: 5px;
    overflow-x: auto;
  }

  .nav-item {
    white-space: nowrap;
    padding: 10px;
    font-size: 12px;
  }

  .app-shell {
    display: block;
  }

  .main-content {
    margin: 0;
    width: 100%;
    padding: 23px 15px;
  }

  .topbar {
    margin-bottom: 24px;
  }

  .topbar h1 {
    font-size: 20px;
  }

  .live-status {
    display: none;
  }

  .welcome-section {
    padding: 24px 19px;
  }

  .welcome-decoration {
    right: -10px;
    top: 30px;
    font-size: 95px;
  }

  .welcome-section p {
    max-width: 80%;
  }

  .stats-grid {
    gap: 10px;
  }

  .stat-card {
    padding: 15px;
  }

  .stat-card h2 {
    font-size: 20px;
  }

  .panel {
    padding: 17px;
  }

  .chart-container {
    height: 240px;
  }

  .ai-heading {
    flex-direction: column;
  }

  .ai-heading-left {
    align-items: flex-start;
  }

  .footer {
    flex-direction: column;
  }
}

@media (max-width: 390px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .welcome-section h2 {
    font-size: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}