* { box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  background: #f5f6f8;
  color: #222;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  background: #1e293b;
  color: #fff;
}
.topbar a, .topbar .who { color: #e2e8f0; text-decoration: none; margin-right: 16px; }
.topbar a:hover { color: #fff; }
.topbar .brand { font-weight: 700; font-size: 18px; }
.topbar nav { display: flex; align-items: center; gap: 8px; }
.topbar .who { font-size: 13px; opacity: .8; }
.container { max-width: 960px; margin: 24px auto; padding: 0 16px; }
.card { background: #fff; border-radius: 8px; padding: 24px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.card.narrow { max-width: 420px; margin: 40px auto; }
h1 { margin-top: 0; }
label { display: block; margin-bottom: 14px; font-size: 14px; font-weight: 500; }
label.checkbox { display: flex; align-items: center; gap: 8px; font-weight: 400; }
input[type=text], input[type=email], input[type=password], select {
  width: 100%;
  padding: 10px 12px;
  margin-top: 6px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
}
input:focus, select:focus { outline: 2px solid #3b82f6; outline-offset: 1px; }
button, .btn {
  display: inline-block;
  padding: 9px 16px;
  border: 1px solid #cbd5e1;
  background: #fff;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  color: #222;
}
button.primary, .btn.primary { background: #3b82f6; color: #fff; border-color: #3b82f6; }
button.primary:hover, .btn.primary:hover { background: #2563eb; }
button.danger, .btn.danger { background: #ef4444; color: #fff; border-color: #ef4444; }
button.link { background: none; border: none; color: #e2e8f0; cursor: pointer; padding: 0; font-size: 14px; }
.btn.small { padding: 5px 10px; font-size: 12px; }
.row { display: flex; gap: 8px; align-items: center; }
.row.between { justify-content: space-between; }
table { width: 100%; border-collapse: collapse; margin-top: 16px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid #e2e8f0; font-size: 14px; }
th { background: #f1f5f9; font-weight: 600; }
.actions { white-space: nowrap; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; background: #e2e8f0; }
.tag.admin { background: #fde68a; color: #92400e; }
.tag.user { background: #dbeafe; color: #1e40af; }
.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; font-size: 14px; }
.flash.success { background: #d1fae5; color: #065f46; }
.flash.error { background: #fee2e2; color: #991b1b; }
small { font-weight: normal; color: #64748b; }
