:root {
  --max-width: 1040px;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif;
  line-height: 1.4;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.75rem 1rem;
}

.topbar {
  border-bottom: 1px solid #e5e5e5;
}

.brand {
  font-weight: 700;
  margin-right: 1rem;
}

.nav a {
  margin-right: 0.75rem;
  text-decoration: none;
}

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

.table th,
.table td {
  padding: 0.45rem 0.5rem;
  border-bottom: 1px solid #eaeaea;
  text-align: left;
  vertical-align: top;
}

.form {
  max-width: 560px;
}

.form-row {
  margin-bottom: 0.75rem;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

input,
select,
textarea {
  width: 100%;
  padding: 0.45rem 0.5rem;
  box-sizing: border-box;
}

.form-actions {
  display: flex;
  gap: 0.5rem;
}

.btn {
  display: inline-block;
  padding: 0.35rem 0.6rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
}

.btn.primary {
  background: #111;
  border-color: #111;
  color: #fff;
}

.card {
  padding: 0.75rem 0.9rem;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  margin-bottom: 1rem;
}

.muted {
  opacity: 0.8;
}

.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
}

.filters-row .field {
  flex: 1 1 180px;
  min-width: 160px;
}

.filters-row .field.checkbox {
  flex: 0 0 auto;
  min-width: 160px;
}

.filters-row .field.actions {
  flex: 0 0 auto;
}

.checkbox-inline {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  font-weight: 600;
}

.btn.small {
  padding: 0.25rem 0.5rem;
  border-radius: 8px;
}

.badge {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border: 1px solid #ddd;
  border-radius: 999px;
  font-size: 0.85em;
  margin-left: 0.35rem;
}

.badge.overdue {
  border-color: #b00020;
  color: #b00020;
}

.row-overdue td {
  background: rgba(176, 0, 32, 0.04);
}
