@import url(https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Outfit:wght@300;400;600;700&display=swap);
:root {
  --bg-deep: #0f172a;
  --bg-card: rgba(30, 41, 59, 0.7);
  --bg-card-hover: rgba(51, 65, 85, 0.8);
  --accent-primary: #6366f1;
  --accent-secondary: #0ea5e9;
  --success: #10b981;
  --danger: #ef4444;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --glass-border: rgba(255, 255, 255, 0.1);
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
}

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

body {
  font-family: "Inter", sans-serif;
  background: radial-gradient(circle at top left, #1e1b4b, var(--bg-deep));
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.6;
}

h1, h2, h3, .currency {
  font-family: "Outfit", sans-serif;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  transition: transform 0.3s ease, background 0.3s ease;
}
.glass-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-4px);
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3rem;
}
header .logo {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(to right, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
header .user-profile {
  display: flex;
  align-items: center;
  gap: 1rem;
}
header .user-profile .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.5rem;
}
.dashboard-grid .card-stats {
  grid-column: span 4;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.dashboard-grid .card-stats .label {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.dashboard-grid .card-stats .value {
  font-size: 2.25rem;
  font-weight: 700;
}
.dashboard-grid .card-stats.balance {
  border-top: 4px solid var(--accent-primary);
}
.dashboard-grid .card-stats.income {
  border-top: 4px solid var(--success);
}
.dashboard-grid .card-stats.expense {
  border-top: 4px solid var(--danger);
}
.dashboard-grid .card-chart {
  grid-column: span 6;
  min-height: 350px;
}
.dashboard-grid .card-transactions {
  grid-column: span 12;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}
table th {
  text-align: left;
  color: var(--text-muted);
  font-weight: 500;
  padding: 1rem;
  border-bottom: 1px solid var(--glass-border);
}
table td {
  padding: 1rem;
  border-bottom: 1px solid var(--glass-border);
}
table tr:last-child td {
  border-bottom: none;
}
table .amount-positive {
  color: var(--success);
  font-weight: 600;
}
table .amount-negative {
  color: var(--danger);
  font-weight: 600;
}

#ai-chat-bubble {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.4);
  z-index: 1000;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
#ai-chat-bubble:hover {
  transform: scale(1.1) rotate(5deg);
}
#ai-chat-bubble svg {
  width: 30px;
  height: 30px;
  fill: white;
}

#chat-window {
  position: fixed;
  bottom: 6rem;
  right: 2rem;
  width: 380px;
  height: 500px;
  display: none;
  flex-direction: column;
  z-index: 1000;
}
#chat-window .chat-header {
  padding: 1.25rem;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid var(--glass-border);
  border-radius: 24px 24px 0 0;
  font-weight: 600;
}
#chat-window .chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
#chat-window .message {
  max-width: 85%;
  padding: 0.75rem 1rem;
  border-radius: 16px;
  font-size: 0.9rem;
}
#chat-window .message.assistant {
  background: rgba(255, 255, 255, 0.1);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
#chat-window .message.user {
  background: var(--accent-primary);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
#chat-window .chat-input {
  padding: 1.25rem;
  display: flex;
  gap: 0.5rem;
}
#chat-window .chat-input input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  color: white;
  outline: none;
}
#chat-window .chat-input input:focus {
  border-color: var(--accent-primary);
}
#chat-window .chat-input button {
  background: var(--accent-primary);
  color: white;
  border: none;
  padding: 0 1rem;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  transition: opacity 0.2s;
}
#chat-window .chat-input button:hover {
  opacity: 0.9;
}

@media (max-width: 1024px) {
  .dashboard-grid .card-stats {
    grid-column: span 6;
  }
  .dashboard-grid .card-chart {
    grid-column: span 12;
  }
}
@media (max-width: 640px) {
  .dashboard-grid .card-stats {
    grid-column: span 12;
  }
  header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  #chat-window {
    width: calc(100vw - 4rem);
    right: 2rem;
  }
}
