@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&family=Playfair+Display:wght@600;700&display=swap');

:root {
  --peach-lightest: #1A237E;
  --peach-light: #283593;
  --peach-mid: #3949AB;
  --peach-deep: #7986CB;
  --peach-dark: #E8EAF6;
  --white: #FFFFFF;
  --off-white: #FFF8F6;
  --text-primary: #3E2723;
  --text-secondary: #6D4C41;
  --text-muted: #A1887F;
  --border: #FFCCBC;
  --border-light: #FBE9E7;
  --shadow-sm: 0 1px 3px rgba(230, 74, 25, 0.06);
  --shadow-md: 0 4px 12px rgba(230, 74, 25, 0.08);
  --shadow-lg: 0 8px 24px rgba(230, 74, 25, 0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
}

::selection {
  background: var(--peach-mid);
  color: var(--white);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--off-white);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

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

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

@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ===== APP CONTAINER ===== */
.app-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px 32px;
  min-height: 100vh;
}

/* ===== HEADER ===== */
.app-header {
  padding: 24px 0 16px;
  text-align: center;
  animation: fadeIn 0.6s ease;
}

.app-title {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--peach-dark);
  letter-spacing: -0.02em;
}

.app-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 2px;
}

/* ===== TAB NAVIGATION ===== */
.tab-nav {
  display: flex;
  gap: 4px;
  background: var(--peach-lightest);
  padding: 4px;
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  animation: fadeInUp 0.4s ease;
}

.tab-btn {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: transparent;
  border-radius: var(--radius-md);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.tab-btn.active {
  background: var(--white);
  color: var(--peach-dark);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

.tab-btn:hover:not(.active) {
  color: var(--peach-deep);
  background: rgba(255, 255, 255, 0.5);
}

.tab-icon {
  font-size: 1rem;
}

/* ===== SECTION HEADER ===== */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  animation: fadeInUp 0.5s ease;
}

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

.subsection-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}

/* ===== BUTTONS ===== */
.new-trip-btn,
.add-expense-btn {
  padding: 10px 20px;
  border: none;
  background: linear-gradient(135deg, var(--peach-deep), var(--peach-dark));
  color: var(--white);
  border-radius: var(--radius-md);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 2px 8px rgba(230, 74, 25, 0.25);
}

.new-trip-btn:hover,
.add-expense-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(230, 74, 25, 0.3);
}

.btn-primary {
  padding: 12px 24px;
  border: none;
  background: linear-gradient(135deg, var(--peach-deep), var(--peach-dark));
  color: var(--white);
  border-radius: var(--radius-md);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 2px 8px rgba(230, 74, 25, 0.25);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(230, 74, 25, 0.3);
}

.btn-secondary {
  padding: 12px 24px;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: var(--peach-lightest);
  border-color: var(--peach-mid);
}

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 4px;
  border-radius: 6px;
  transition: background 0.2s;
  opacity: 0.6;
}

.icon-btn:hover {
  background: var(--peach-lightest);
  opacity: 1;
}

.icon-btn-sm {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.75rem;
  padding: 4px 6px;
  border-radius: 6px;
  transition: all 0.2s;
  opacity: 0.5;
}

.icon-btn-sm:hover {
  background: var(--peach-lightest);
  opacity: 1;
}

.back-btn {
  background: none;
  border: none;
  color: var(--peach-dark);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  padding: 8px 0;
  margin-bottom: 16px;
  transition: color 0.2s;
  animation: fadeIn 0.3s ease;
}

.back-btn:hover {
  color: var(--peach-deep);
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: all 0.2s;
  line-height: 1;
}

.close-btn:hover {
  background: var(--peach-lightest);
  color: var(--peach-dark);
}

/* ===== TRIP CARDS ===== */
.trips-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}

.trip-card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: var(--shadow-sm);
  animation: fadeInUp 0.5s ease both;
}

.trip-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--peach-light);
}

.trip-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.trip-destination h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
}

.trip-cats {
  font-size: 0.8rem;
  margin-left: 6px;
}

.trip-actions {
  display: flex;
  gap: 2px;
}

.trip-dates {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.trip-days-info {
  color: var(--peach-mid);
  font-weight: 500;
}

.trip-days-info::before {
  content: '·';
  margin: 0 4px;
  color: var(--text-muted);
}

.trip-budget-bar {
  margin-bottom: 8px;
}

.budget-bar-track {
  width: 100%;
  height: 6px;
  background: var(--peach-lightest);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}

.budget-bar-track.large {
  height: 10px;
  border-radius: 5px;
  margin-bottom: 8px;
}

.budget-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--peach-mid), var(--peach-deep));
  border-radius: inherit;
  transition: width 0.6s ease;
}

.budget-bar-fill.over-budget {
  background: linear-gradient(90deg, var(--peach-dark), #C62828);
}

.budget-numbers {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
}

.budget-numbers .spent {
  color: var(--text-secondary);
  font-weight: 500;
}

.budget-numbers .remaining {
  color: var(--peach-mid);
  font-weight: 600;
}

.budget-numbers .remaining.over {
  color: #C62828;
}

.trip-total {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 400;
  border-top: 1px solid var(--border-light);
  padding-top: 8px;
  margin-top: 4px;
}

/* ===== DETAIL VIEW ===== */
.detail-container {
  animation: fadeIn 0.4s ease;
}

.detail-header {
  margin-bottom: 24px;
  animation: fadeInUp 0.5s ease;
}

.detail-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
}

.detail-dates {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ===== BUDGET OVERVIEW ===== */
.budget-overview {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  animation: fadeInUp 0.5s ease 0.1s both;
}

.budget-stat-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.budget-stat {
  flex: 1;
  text-align: center;
}

.stat-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
  font-weight: 500;
}

.stat-value {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.spent-value { color: var(--peach-deep); }
.remaining-value { color: #2E7D32; }
.over-value { color: #C62828; }

.budget-percent {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ===== CATEGORY BREAKDOWN ===== */
.category-breakdown {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  animation: fadeInUp 0.5s ease 0.2s both;
}

.category-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.category-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cat-label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 100px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.cat-icon { font-size: 1rem; }

.cat-name { font-weight: 500; }

.cat-bar-track {
  flex: 1;
  height: 8px;
  background: var(--peach-lightest);
  border-radius: 4px;
  overflow: hidden;
}

.cat-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--peach-mid), var(--peach-deep));
  border-radius: inherit;
  transition: width 0.6s ease;
  min-width: 2px;
}

.cat-amount {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 72px;
  text-align: right;
}

/* ===== EXPENSES SECTION ===== */
.expenses-section {
  animation: fadeInUp 0.5s ease 0.3s both;
}

.expenses-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.expenses-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.filter-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.pill {
  padding: 6px 14px;
  border: 1.5px solid var(--border);
  background: var(--white);
  border-radius: 20px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.pill.active {
  background: var(--peach-deep);
  border-color: var(--peach-deep);
  color: var(--white);
}

.pill:hover:not(.active) {
  border-color: var(--peach-mid);
  background: var(--peach-lightest);
}

.sort-select {
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  color: var(--text-secondary);
  background: var(--white);
  cursor: pointer;
  align-self: flex-start;
}

.sort-select:focus {
  outline: none;
  border-color: var(--peach-mid);
}

/* ===== EXPENSE LIST ===== */
.expense-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.expense-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
  animation: fadeInUp 0.4s ease both;
}

.expense-item:hover {
  border-color: var(--peach-light);
  box-shadow: var(--shadow-md);
}

.expense-icon {
  font-size: 1.5rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--peach-lightest);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.expense-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.expense-desc {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.expense-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.expense-notes {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.expense-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.expense-amount {
  font-weight: 700;
  font-size: 1rem;
  color: var(--peach-dark);
}

.expense-actions {
  display: flex;
  gap: 2px;
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(62, 39, 35, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
  animation: fadeIn 0.2s ease;
}

.modal-content {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 28px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s ease;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-header h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ===== FORMS ===== */
.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.form-group.flex-2 {
  flex: 2;
}

.form-row {
  display: flex;
  gap: 12px;
}

.form label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form input,
.form select,
.form textarea {
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  color: var(--text-primary);
  background: var(--off-white);
  transition: all 0.2s ease;
  min-height: 44px;
}

.form input:focus,
.form select:focus,
.form textarea:focus {
  outline: none;
  border-color: var(--peach-mid);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(255, 138, 101, 0.15);
}

.form input::placeholder,
.form textarea::placeholder {
  color: var(--text-muted);
}

.form textarea {
  resize: vertical;
  min-height: 60px;
}

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 8px;
}

/* ===== CATEGORY SELECTOR ===== */
.category-selector {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.cat-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  background: var(--white);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  flex: 1;
  min-width: 70px;
}

.cat-btn.active {
  border-color: var(--peach-deep);
  background: var(--peach-lightest);
}

.cat-btn:hover:not(.active) {
  border-color: var(--peach-mid);
  background: var(--peach-lightest);
}

.cat-btn-icon {
  font-size: 1.3rem;
}

.cat-btn-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.cat-btn.active .cat-btn-label {
  color: var(--peach-dark);
}

/* ===== DASHBOARD ===== */
.dashboard-container {
  animation: fadeIn 0.4s ease;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
  margin-top: 20px;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: var(--shadow-sm);
  animation: fadeInUp 0.5s ease both;
}

.stat-card:nth-child(1) { animation-delay: 0s; }
.stat-card:nth-child(2) { animation-delay: 0.06s; }
.stat-card:nth-child(3) { animation-delay: 0.12s; }
.stat-card:nth-child(4) { animation-delay: 0.18s; }

.stat-card-icon {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.stat-card-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.stat-card-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
}

.charts-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.chart-card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  animation: fadeInUp 0.5s ease 0.2s both;
}

.chart-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.chart-wrapper {
  position: relative;
  height: 260px;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  animation: fadeInUp 0.5s ease;
}

.empty-state.small {
  padding: 32px 16px;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 0.875rem;
  color: var(--text-muted);
  max-width: 300px;
  line-height: 1.5;
  margin-bottom: 20px;
}

/* ===== LOADING ===== */
.loading-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 0;
}

.skeleton-card {
  height: 140px;
  background: linear-gradient(90deg, var(--peach-lightest) 25%, var(--peach-light) 50%, var(--peach-lightest) 75%);
  background-size: 200% 100%;
  border-radius: var(--radius-lg);
  animation: shimmer 1.5s infinite;
}

.skeleton-card.large {
  height: 200px;
}

.skeleton-row {
  height: 60px;
  background: linear-gradient(90deg, var(--peach-lightest) 25%, var(--peach-light) 50%, var(--peach-lightest) 75%);
  background-size: 200% 100%;
  border-radius: var(--radius-md);
  animation: shimmer 1.5s infinite;
}

/* ===== FOCUS STYLES ===== */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--peach-mid);
  outline-offset: 2px;
}

/* ===== RESPONSIVE ===== */
@media (min-width: 640px) {
  .trips-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .charts-row {
    grid-template-columns: 1fr 1fr;
  }

  .expenses-controls {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

@media (max-width: 480px) {
  .app-title {
    font-size: 1.6rem;
  }

  .budget-stat-row {
    flex-direction: column;
    gap: 12px;
  }

  .form-row {
    flex-direction: column;
    gap: 16px;
  }

  .modal-content {
    padding: 20px;
    border-radius: var(--radius-lg);
  }

  .category-selector {
    gap: 6px;
  }

  .cat-btn {
    min-width: 56px;
    padding: 8px 10px;
  }

  .stat-card-value {
    font-size: 1.1rem;
  }

  .detail-title {
    font-size: 1.4rem;
  }
}

.auth-gate { display: flex; flex-direction: column; min-height: 100vh; }

.auth-main { display: flex; align-items: center; justify-content: center; flex: 1; }

.auth-card { width: 100%; max-width: 420px; background: var(--white); border: 1px solid var(--border-light); border-radius: var(--radius-xl); padding: 32px 28px; text-align: center; box-shadow: var(--shadow-lg); animation: slideUp 0.3s ease; }

.auth-hero { font-size: 3rem; margin-bottom: 12px; }

.auth-title { font-family: 'Playfair Display', serif; font-size: 1.5rem; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }

.auth-copy { font-size: 0.95rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 20px; }

.auth-btn { width: 100%; justify-content: center; }

.auth-header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.auth-user-area { display: flex; align-items: center; gap: 10px; }

.user-avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 2px solid var(--peach-light); background: var(--white); }

.user-avatar.fallback { display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--peach-dark); background: var(--peach-lightest); }

.user-meta { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }

.user-name { font-size: 0.9rem; font-weight: 600; color: var(--text-primary); }

.user-email { font-size: 0.75rem; color: var(--text-muted); }

.signout-btn { padding: 8px 14px; }

@media (max-width: 480px) {
  .auth-card { padding: 24px 18px; }
  .auth-header-row { flex-direction: column; align-items: flex-start; }
  .auth-user-area { width: 100%; flex-wrap: wrap; }
  .user-meta { min-width: 0; }
}

.trip-history-badge { display: inline-flex; align-items: center; margin-top: 4px; padding: 2px 8px; border-radius: 999px; background: var(--peach-lightest); color: var(--peach-dark); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; }

.trip-form,
.share-form,
.expense-form {
  display: grid;
  gap: 12px;
}

.trips-view,
.detail-view,
.dashboard-view {
  display: grid;
  gap: 16px;
}

.trip-list {
  display: grid;
  gap: 16px;
}

.trip-card,
.panel-card {
  background: var(--card-bg, #fff);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.trip-card-header,
.detail-topbar,
.auth-user-area {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.trip-stats,
.dashboard-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.trip-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.shared-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.shared-chip,
.badge,
.owner-badge,
.companion-badge,
.detail-roles {
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
}

.owner-badge {
  background: #e8f5e9;
  color: #1b5e20;
}

.companion-badge {
  background: #e3f2fd;
  color: #0d47a1;
}

.expense-list {
  display: grid;
  gap: 10px;
}

.expense-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.expense-row:last-child {
  border-bottom: 0;
}

.input-field {
  width: 100%;
}

.helper-text {
  opacity: 0.75;
}

.dashboard-metric {
  min-width: 160px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.03);
  display: grid;
  gap: 4px;
}

@media (max-width: 720px) {
  .trip-card-header,
  .detail-topbar,
  .auth-user-area,
  .expense-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

.analytics-section { display: grid; gap: 16px; margin-top: 8px; }

.analytics-grid { display: grid; gap: 20px; }

.analytics-chart { width: 100%; }

.analytics-burn-down-card .chart-wrapper { height: 300px; }

@media (min-width: 640px) {
  .analytics-grid { grid-template-columns: 1fr 1fr; }
  .analytics-burn-down-card { grid-column: 1 / -1; }
}

.prediction-card { margin-bottom: 24px; }

.prediction-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
}

.prediction-copy {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.prediction-btn {
  padding: 10px 16px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--peach-mid), var(--peach-deep));
  color: var(--white);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(230, 74, 25, 0.2);
}

.prediction-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.prediction-error {
  font-size: 0.85rem;
  color: #C62828;
  margin-bottom: 10px;
}

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

.prediction-result {
  display: grid;
  gap: 14px;
}

.prediction-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.prediction-badge.on_track {
  background: #E8F5E9;
  color: #1B5E20;
}

.prediction-badge.at_risk {
  background: #FFF3E0;
  color: #E65100;
}

.prediction-badge.over_budget {
  background: #FFEBEE;
  color: #C62828;
}

.prediction-summary {
  font-size: 0.95rem;
  color: var(--text-primary);
  line-height: 1.5;
}

.prediction-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.prediction-metric {
  background: var(--off-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px;
}

.prediction-metric-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-weight: 600;
}

.prediction-metric-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.prediction-cutbacks h4 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.cutback-list {
  display: grid;
  gap: 10px;
}

.cutback-item {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px;
  background: var(--white);
}

.cutback-top {
  margin-bottom: 4px;
}

.cutback-item p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
  line-height: 1.45;
}

.cutback-item span {
  font-size: 0.82rem;
  color: var(--text-primary);
  font-weight: 600;
}

@media (max-width: 480px) {
  .prediction-header {
    flex-direction: column;
    align-items: stretch;
  }

  .prediction-metrics {
    grid-template-columns: 1fr;
  }
}

.expenses-header-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.pdf-export-btn {
  background: linear-gradient(135deg, var(--peach-mid), var(--peach-dark));
}

.pdf-report {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  background: var(--white);
  color: #000;
  padding: 24px;
}

.pdf-report-header h1 {
  font-size: 24px;
  margin-bottom: 6px;
}

.pdf-report-header p {
  font-size: 12px;
  color: #444;
  margin-bottom: 18px;
}

.pdf-report-summary {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  font-size: 12px;
}

.pdf-report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.pdf-report-table th,
.pdf-report-table td {
  border: 1px solid #ddd;
  padding: 8px;
  text-align: left;
}

.pdf-report-table th {
  background: #f6f6f6;
}

@media (max-width: 480px) {
  .expenses-header-actions {
    width: 100%;
  }

  .expenses-header-actions .add-expense-btn {
    flex: 1;
  }
}
