/* Warm Editorial Theme Variables */
:root {
  --color-bg: #faf6f1;
  --color-surface: #fffdf9;
  --color-text: #2c2419;
  --color-muted: #6b5e52;
  --color-accent: #c45c26;
  --color-accent-soft: #f4ddd0;
  --font-heading: 'Georgia', 'Times New Roman', serif;
  --font-body: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --radius-md: 6px;
  --shadow-soft: 0 12px 40px rgba(44, 36, 25, 0.08);
  --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: 1.6;
  padding: 0;
  margin: 0;
  display: flex;
  justify-content: center;
  min-height: 100vh;
}

/* Layout Archetype: Centered narrow column (~680px) */
.app-container {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  animation: fadeIn 0.6s ease-out;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Editorial Hero Header */
.hero {
  background: linear-gradient(135deg, #faf6f1 0%, #f0e4d8 45%, #e8d5c4 100%);
  padding: 40px 30px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(196, 92, 38, 0.1);
  text-align: center;
}

.hero-tagline {
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-accent);
  display: block;
  margin-bottom: 8px;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 400;
  color: var(--color-text);
  margin-bottom: 16px;
}

.pull-quote {
  font-family: var(--font-heading);
  font-style: italic;
  color: var(--color-muted);
  font-size: 1.05rem;
  line-height: 1.5;
  max-width: 500px;
  margin: 0 auto;
  position: relative;
}

/* Main Content */
.main-content {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* Running Total Card */
.total-card {
  background-color: var(--color-surface);
  border-left: 4px solid var(--color-accent);
  padding: 24px 30px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: var(--transition-smooth);
}

.total-card:hover {
  transform: translateY(-2px);
}

.total-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.total-header h2 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--color-muted);
}

.currency-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-accent);
  background-color: var(--color-accent-soft);
  padding: 2px 8px;
  border-radius: 12px;
}

.total-amount {
  font-family: var(--font-heading);
  font-size: 2.8rem;
  font-weight: 400;
  color: var(--color-text);
  letter-spacing: -1px;
}

.total-meta {
  font-size: 0.85rem;
  color: var(--color-muted);
  border-top: 1px solid rgba(107, 94, 82, 0.1);
  padding-top: 8px;
  margin-top: 4px;
}

/* Ledger Sections */
.ledger-section {
  background-color: var(--color-surface);
  padding: 30px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(107, 94, 82, 0.05);
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--color-text);
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(107, 94, 82, 0.15);
  padding-bottom: 8px;
}

/* Form Styling */
.expense-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

input, select {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 10px 12px;
  border: 1px solid rgba(107, 94, 82, 0.25);
  border-radius: var(--radius-md);
  background-color: #fff;
  color: var(--color-text);
  outline: none;
  transition: var(--transition-smooth);
}

input:focus, select:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}

/* Buttons */
.btn-primary {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  background-color: var(--color-accent);
  color: #fff;
  border: none;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}

.btn-primary:hover {
  background-color: #a84b1d;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(196, 92, 38, 0.2);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-text-danger {
  background: none;
  border: none;
  color: #b32626;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 4px;
  transition: var(--transition-smooth);
}

.btn-text-danger:hover {
  background-color: #fdf2f2;
  color: #8a1d1d;
}

/* Controls (Filter & Sort) */
.controls-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  background-color: var(--color-surface);
  padding: 16px 24px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(107, 94, 82, 0.05);
}

@media (max-width: 480px) {
  .controls-section {
    grid-template-columns: 1fr;
  }
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.control-group label {
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.control-group select {
  padding: 8px 10px;
  font-size: 0.9rem;
}

/* Expense List */
.list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.list-header .section-title {
  margin-bottom: 0;
  border-bottom: none;
  padding-bottom: 0;
}

.expense-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.expense-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background-color: #fff;
  border: 1px solid rgba(107, 94, 82, 0.1);
  border-radius: var(--radius-md);
  transition: var(--transition-smooth);
  animation: slideIn 0.3s ease-out;
}

.expense-item:hover {
  border-color: var(--color-accent-soft);
  box-shadow: 0 4px 12px rgba(44, 36, 25, 0.04);
  transform: translateX(2px);
}

.expense-item-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 70%;
}

.expense-item-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--color-text);
  font-weight: 400;
  word-break: break-word;
}

.expense-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--color-muted);
  flex-wrap: wrap;
}

.category-badge {
  background-color: var(--color-bg);
  color: var(--color-muted);
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
  border: 1px solid rgba(107, 94, 82, 0.15);
}

.expense-item-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.expense-item-amount {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--color-text);
  white-space: nowrap;
}

.btn-delete {
  background: none;
  border: none;
  color: var(--color-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-delete:hover {
  color: #b32626;
  background-color: #fdf2f2;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--color-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.empty-icon {
  font-size: 2.5rem;
  color: var(--color-accent-soft);
}

.hidden {
  display: none !important;
}

/* Footer */
.app-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 0.85rem;
  color: var(--color-muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-sub {
  font-size: 0.75rem;
  opacity: 0.8;
}