* { box-sizing: border-box; }
body {
  font: 14px/1.45 system-ui, -apple-system, sans-serif;
  margin: 0;
  background: #f6f7f9;
  color: #1a1a1a;
}
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: #1f2937;
  color: white;
}
.topbar .brand { color: white; font-weight: 600; }
.topbar .who { margin-left: auto; opacity: 0.85; }
.topbar .logout-form button {
  background: transparent;
  color: white;
  border: 1px solid rgba(255,255,255,0.3);
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
}

.layout { display: flex; min-height: calc(100vh - 44px); }
.sidebar {
  width: 200px;
  background: white;
  border-right: 1px solid #e5e7eb;
  padding: 16px 0;
}
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li a {
  display: block;
  padding: 8px 16px;
  color: #1a1a1a;
}
.sidebar li a:hover { background: #f3f4f6; text-decoration: none; }

.content { flex: 1; padding: 24px; }

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.page-head h1 { margin: 0; font-size: 20px; }
.page-head .actions { display: flex; gap: 8px; }

.btn {
  display: inline-block;
  padding: 6px 12px;
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  color: #1a1a1a;
  cursor: pointer;
}
.btn.primary { background: #2563eb; color: white; border-color: #2563eb; }
.btn.danger, button.danger {
  background: #dc2626;
  color: white;
  border: 1px solid #dc2626;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border: 1px solid #e5e7eb;
}
table.data th, table.data td {
  padding: 8px 12px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
}
table.data th { background: #f9fafb; font-weight: 600; }
table.data td.actions a { margin-right: 12px; }

.pager { margin-top: 16px; display: flex; gap: 12px; }

.meta { color: #6b7280; font-size: 12px; }

dl.detail { background: white; padding: 16px; border: 1px solid #e5e7eb; }
dl.detail dt { font-weight: 600; color: #6b7280; margin-top: 8px; }
dl.detail dd { margin: 0 0 8px 0; }

.resource-form, .destroy-form {
  background: white;
  border: 1px solid #e5e7eb;
  padding: 16px;
  margin-bottom: 16px;
  max-width: 600px;
}
.resource-form label { display: block; margin-bottom: 12px; }
.resource-form label span { display: block; font-weight: 600; margin-bottom: 4px; }
.resource-form input, .resource-form textarea, .resource-form select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font: inherit;
}
.resource-form input[readonly] { background: #f9fafb; color: #6b7280; }
.resource-form button[type=submit] {
  background: #2563eb;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
}

.error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 8px 12px;
  border-radius: 4px;
  margin-bottom: 12px;
}

.login-box {
  max-width: 360px;
  margin: 80px auto;
  background: white;
  padding: 32px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
}
.login-box h1 { margin-top: 0; font-size: 20px; }
.login-box label { display: block; margin-bottom: 12px; }
.login-box input {
  width: 100%;
  padding: 8px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  margin-top: 4px;
}
.login-box button {
  width: 100%;
  background: #2563eb;
  color: white;
  border: none;
  padding: 10px;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
}

.dashboard-hero {
  display: block;
  max-width: 100%;
  width: 457px;
  margin: 16px 0;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
}

pre.json {
  background: #f3f4f6;
  padding: 8px;
  border-radius: 4px;
  white-space: pre-wrap;
  word-break: break-word;
}
