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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: #f5f5f5;
  color: #333;
}

nav {
  background: #1a1a2e;
  color: white;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-brand { font-weight: 700; font-size: 1.1rem; }
.nav-links { display: flex; gap: 1rem; }
.nav-link {
  color: #aaa;
  text-decoration: none;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.9rem;
}
.nav-link.active, .nav-link:hover { color: white; background: rgba(255,255,255,0.1); }
.nav-tc { margin-left: auto; font-size: 0.85rem; color: #8f8; }

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

.loading { text-align: center; padding: 3rem; color: #888; }

/* Cards */
.card {
  background: white;
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.card h2 { font-size: 1rem; color: #666; margin-bottom: 1rem; }

/* Summary table */
.summary-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.summary-table th {
  text-align: left;
  padding: 0.5rem;
  border-bottom: 2px solid #eee;
  color: #888;
  font-weight: 500;
}
.summary-table td { padding: 0.5rem; border-bottom: 1px solid #f0f0f0; }
.summary-table tr:hover { background: #fafafa; }

.bar-cell { width: 120px; }
.bar-bg { background: #eee; border-radius: 3px; height: 8px; position: relative; }
.bar-fill { height: 100%; border-radius: 3px; transition: width 0.3s; }
.bar-green { background: #4caf50; }
.bar-yellow { background: #ff9800; }
.bar-red { background: #f44336; }

.amount { text-align: right; font-variant-numeric: tabular-nums; }
.total-row { font-weight: 700; border-top: 2px solid #333; }
.total-row td { padding-top: 0.75rem; }

/* Expenses list */
.expense-row { cursor: pointer; }
.expense-row:hover { background: #f0f7ff; }
.source-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.75rem;
  background: #e3f2fd;
  color: #1565c0;
}
.source-badge.qr { background: #e8f5e9; color: #2e7d32; }
.source-badge.audio { background: #fff3e0; color: #e65100; }

/* Filters */
.filters {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.filters select, .filters input {
  padding: 0.4rem 0.6rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.85rem;
}

/* Charts */
.charts-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 768px) { .charts-row { grid-template-columns: 1fr; } }
.chart-container { position: relative; height: 280px; }

/* Contractors */
.contractor-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid #f0f0f0;
}
.contractor-card:last-child { border-bottom: none; }
.contractor-name { font-weight: 600; }
.contractor-trade { color: #888; font-size: 0.85rem; }
.contractor-total { text-align: right; }

/* Budget form */
.budget-input {
  width: 100px;
  padding: 0.25rem 0.4rem;
  border: 1px solid #ddd;
  border-radius: 3px;
  text-align: right;
  font-size: 0.85rem;
}
.budget-input:focus { border-color: #1a73e8; outline: none; }
.btn {
  padding: 0.4rem 0.8rem;
  background: #1a73e8;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
}
.btn:hover { background: #1557b0; }
.btn-sm { padding: 0.2rem 0.5rem; font-size: 0.8rem; }
