:root {
  --bg: #f4f3ef;
  --card: #ffffff;
  --ink: #22201d;
  --muted: #7a7570;
  --accent: #b5562f;
  --border: #e3e0da;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  padding-bottom: 40px;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
}

header h1 {
  font-size: 1.3rem;
  margin: 0;
}

.logout {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}
.logout:hover { color: var(--accent); }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin: 0 24px 16px 24px;
  padding: 16px 20px;
}

.add-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 110px;
}

.field.grow { flex: 1; min-width: 180px; }

label {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

input, select, button {
  font-size: 1rem;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
}

button {
  background: var(--accent);
  color: white;
  border: none;
  cursor: pointer;
}
button:hover { opacity: 0.9; }

.filter-form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-form a {
  color: var(--muted);
  font-size: 0.9rem;
}

.export-link {
  margin-left: auto;
  background: var(--ink);
  color: white;
  padding: 8px 14px;
  border-radius: 6px;
  text-decoration: none;
}

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

th, td {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
}

.importo { font-variant-numeric: tabular-nums; white-space: nowrap; }

.empty { text-align: center; color: var(--muted); padding: 20px; }

.delete-btn {
  background: none;
  color: var(--muted);
  border: none;
  font-size: 1.1rem;
  padding: 0 6px;
  line-height: 1;
}
.delete-btn:hover { color: var(--accent); }

.flash {
  margin: 0 24px 16px 24px;
  padding: 10px 14px;
  background: #fdecea;
  border: 1px solid #f3c4bd;
  border-radius: 6px;
  color: #a03c2e;
}

.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
}

.login-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 32px;
  width: 280px;
  text-align: center;
}

.login-box h1 { margin-top: 0; font-size: 1.2rem; }

.login-box form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}
