:root {
  --background: #ffffff;
  --foreground: #0a0a0a;
  --card: #ffffff;
  --card-foreground: #0a0a0a;
  --muted: #f5f5f5;
  --muted-foreground: #737373;
  --border: #e5e5e5;
  --primary: #171717;
  --primary-foreground: #fafafa;
  --accent: #f99c00;
  --accent-foreground: #171717;
  --destructive: #e40014;
  --destructive-foreground: #fafafa;
  --radius: 0.625rem;
  --font-sans: "DM Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background: var(--background);
  color: var(--foreground);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

h1,
h2,
h3 {
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 0.5rem;
}

h1 {
  font-size: 1.5rem;
}

h2 {
  font-size: 1.15rem;
}

p {
  margin: 0 0 0.75rem;
  color: var(--muted-foreground);
}

.topbar {
  border-bottom: 1px solid var(--border);
  background: var(--card);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  color: var(--foreground);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.topbar nav {
  display: flex;
  gap: 1.25rem;
}

.topbar nav a {
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--muted-foreground);
  transition: color 0.15s ease;
}

.topbar nav a:hover,
.topbar nav a.active {
  color: var(--foreground);
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: color-mix(in srgb, var(--accent) 15%, white);
  color: #7a4d00;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, white);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 500;
}

.badge-muted {
  background: var(--muted);
  color: var(--muted-foreground);
  border: 1px solid var(--border);
}

.badge-destructive {
  background: #fef2f2;
  color: var(--destructive);
  border: 1px solid #ffd6d6;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.5rem 0.95rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s ease, background-color 0.15s ease;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
}

.btn-primary:hover {
  opacity: 0.85;
}

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--foreground);
}

.btn-outline:hover {
  background: var(--muted);
}

.btn-destructive {
  background: var(--destructive);
  color: var(--destructive-foreground);
}

.btn-destructive:hover {
  opacity: 0.85;
}

.btn-sm {
  padding: 0.3rem 0.65rem;
  font-size: 0.8rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th,
td {
  text-align: left;
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--muted-foreground);
  font-weight: 500;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

tbody tr:hover {
  background: var(--muted);
}

.table-wrap {
  overflow-x: auto;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.3rem;
}

.field {
  margin-bottom: 1rem;
}

.field-hint {
  font-size: 0.78rem;
  color: var(--muted-foreground);
  margin-top: 0.25rem;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="password"],
select,
textarea {
  width: 100%;
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 4px);
  background: var(--background);
  color: var(--foreground);
}

textarea {
  min-height: 5rem;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.checkbox-row input {
  width: auto;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem 1.5rem;
}

.form-actions {
  margin-top: 1.25rem;
  display: flex;
  gap: 0.6rem;
}

.flash {
  border-radius: var(--radius);
  padding: 0.7rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.88rem;
  border: 1px solid transparent;
}

.flash-success {
  background: #f0fdf4;
  color: #166534;
  border-color: #bbf7d0;
}

.flash-danger {
  background: #fef2f2;
  color: var(--destructive);
  border-color: #ffd6d6;
}

.flash-info {
  background: var(--muted);
  color: var(--foreground);
  border-color: var(--border);
}

.banner-unresolved {
  background: #fef2f2;
  border: 1px solid #ffd6d6;
  color: #7a1120;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}

.banner-unresolved strong {
  color: var(--destructive);
}

.muted {
  color: var(--muted-foreground);
}

.empty-state {
  color: var(--muted-foreground);
  font-size: 0.88rem;
  padding: 1rem 0;
}

.actions-row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.inline-form {
  display: inline;
}
