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

:root {
  --bg: #F1E7D1;
  --surface: #ffffff;
  --primary: #7258A8;
  --primary-dark: #5d4787;
  --lavender: #A694D6;
  --secondary: #6EC6FF;
  --accent: #4A346B;
  --text: #1B1528;
  --text-muted: #4A346B;
  --gold: #D8B36A;
  --danger: #ef4444;
  --bg-card: #ffffff;
  --bg-input: #faf8f3;
  --border: #d4c8e5;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* Login Page */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-container {
  background: var(--bg-card);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 400px;
}

.login-container h1 {
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: 1.8rem;
}

.login-container form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Main Container */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

header h1 {
  font-size: 2rem;
}

/* Cards */
.card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.card h2 {
  margin-bottom: 1rem;
  font-size: 1.3rem;
  color: var(--text);
}

/* Forms */
.form-group {
  margin-bottom: 1rem;
}

input[type="text"],
input[type="number"],
input[type="password"],
select {
  width: 100%;
  padding: 0.75rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
  transition: border-color 0.2s;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
}

.month-filter {
  width: auto;
  min-width: 200px;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
}

.input-with-prefix {
  position: relative;
  display: flex;
  align-items: center;
}

.prefix {
  position: absolute;
  left: 0.75rem;
  color: var(--text-muted);
  font-size: 1rem;
  pointer-events: none;
}

.input-with-prefix input {
  padding-left: 2rem;
}

/* Buttons */
button {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--primary);
  color: white;
  width: 100%;
}

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

.logout-btn {
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.logout-btn:hover {
  background: var(--bg-input);
  color: var(--text);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
}

/* Entries List */
.entries-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Month Groups */
.month-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.month-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--bg);
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.month-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  text-transform: capitalize;
}

.month-total {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}

.month-entries {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.entry-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: var(--bg-input);
  border-radius: 8px;
  gap: 1rem;
}

.entry-info {
  flex: 1;
  min-width: 0;
}

.entry-name {
  font-weight: 500;
  margin-bottom: 0.25rem;
  word-break: break-word;
}

.entry-date {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.entry-amount {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}

.entry-delete {
  background: var(--danger);
  color: white;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
}

.entry-delete:hover {
  background: #dc2626;
}

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

.error {
  color: var(--danger);
  font-size: 0.875rem;
  margin-top: 0.5rem;
  text-align: center;
}

/* Mobile Responsive */
@media (max-width: 640px) {
  .container {
    padding: 1rem;
  }

  header h1 {
    font-size: 1.5rem;
  }

  .card {
    padding: 1rem;
  }

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

  .stat-value {
    font-size: 1.5rem;
  }

  .month-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .month-title {
    font-size: 1rem;
  }

  .month-total {
    font-size: 1.3rem;
    align-self: flex-end;
  }

  .entry-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .entry-amount {
    font-size: 1.5rem;
    align-self: flex-end;
  }
}
