:root {
  --bg: #f6f1e6;
  --panel: #ffffff;
  --accent: #0f6b6c;
  --accent-2: #d9772c;
  --text: #1f1a17;
  --muted: #6d6258;
  --danger: #b93a2f;
  --success: #2f7d4c;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
  color: var(--text);
  background: radial-gradient(circle at top left, #fff6e7, #f1e7d8 45%, #e6d9c5 100%);
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(6px);
}

.brand {
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand img {
  width: 28px;
  height: 28px;
  display: block;
}

.nav a {
  margin-left: 12px;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
}

.nav a:hover {
  color: var(--accent);
}

.nav .danger {
  color: var(--danger);
}

.content {
  flex: 1;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card {
  background: var(--panel);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
  animation: fadeUp 0.6s ease;
}

.card.narrow {
  max-width: 420px;
  margin: 40px auto;
}

h1,
h2 {
  margin-top: 0;
}

.form label {
  font-size: 0.9rem;
  color: var(--muted);
  display: block;
  margin-top: 12px;
}

.form input,
.form select,
.form textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #d6cfc6;
  background: #ffffff;
  font-family: inherit;
}

.form textarea {
  min-height: 90px;
}

.form.inline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  align-items: end;
}

.form.compact {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.form.compact input {
  width: 90px;
}

.btn {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: #ece3d5;
  font-weight: 600;
}

.btn.primary {
  background: var(--accent);
  color: #ffffff;
}

.btn.secondary {
  background: var(--accent-2);
  color: #ffffff;
}

.btn.small {
  padding: 6px 12px;
  font-size: 0.85rem;
}

.btn.danger {
  background: var(--danger);
  color: #ffffff;
}

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
}

.table-wrap {
  overflow: auto;
}

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

th,
td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid #eee2d5;
}

.badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.badge.open {
  background: #f6d6c1;
  color: #7a3d1d;
}

.badge.paid {
  background: #cfe8d8;
  color: #1f4a33;
}

.summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.metric {
  font-size: 1.4rem;
  margin-top: 6px;
}

.flash {
  padding: 12px 16px;
  border-radius: 12px;
  background: #f0e5d6;
}

.flash.success {
  background: #d6efe0;
  color: #234d36;
}

.flash.error {
  background: #f5d3cf;
  color: #7a2f26;
}

.footer {
  padding: 16px 24px;
  color: var(--muted);
}

.divider {
  height: 1px;
  background: #eee2d5;
  margin: 16px 0 8px;
}

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

@media (max-width: 720px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .nav a {
    margin-left: 0;
    margin-right: 10px;
    display: inline-block;
  }
}
