:root {
  --primary-color: #3b82f6;
  --primary-hover: #2563eb;
  --bg-color: #f3f4f6;
  --text-color: #1f2937;
  --border-color: #e5e7eb;
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  color: var(--text-color);
  background-color: var(--bg-color);
}

header {
  background-color: white;
  box-shadow: var(--shadow);
  padding: 1rem;
}

.header-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--primary-color);
}

main {
  max-width: 1280px;
  margin: 1.5rem auto;
  padding: 0 1rem;
}

.expense-form {
  background-color: white;
  border-radius: 0.5rem;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

label {
  font-size: 0.875rem;
  font-weight: 500;
}

input, select {
  padding: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  font-size: 0.875rem;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
}

.mr-2 {
  margin-right: 0.5rem;
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.chart-container {
  background-color: white;
  border-radius: 0.5rem;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.content-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
}

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

.expense-list {
  background-color: white;
  border-radius: 0.5rem;
  box-shadow: var(--shadow);
  overflow-x: auto;
}

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

th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

th {
  background-color: #f9fafb;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  color: #6b7280;
}

.chatbot {
  background-color: white;
  border-radius: 0.5rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  height: 400px;
}

.chatbot-header {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.message {
  max-width: 75%;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  white-space: pre-line;
}

.message.user {
  background-color: var(--primary-color);
  color: white;
  align-self: flex-end;
}

.message.bot {
  background-color: #f3f4f6;
  color: var(--text-color);
  align-self: flex-start;
}

.chat-input {
  display: flex;
  gap: 0.5rem;
  padding: 1rem;
  border-top: 1px solid var(--border-color);
}

.chat-input input {
  flex: 1;
}

.chat-question {
  display: block;
  background: none;
  border: none;
  color: var(--primary-color);
  text-align: left;
  padding: 0.25rem 0;
  font-size: 0.875rem;
  cursor: pointer;
  transition: color 0.2s;
  text-decoration: underline;
  width: 100%;
}

.chat-question:hover {
  color: var(--primary-hover);
}

.empty-state {
  text-align: center;
  padding: 3rem 0;
}

.empty-state img {
  width: 12rem;
  height: 12rem;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1rem;
}

.empty-state h3 {
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: #6b7280;
}

.hidden {
  display: none;
}