* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: #f4f5f7;
  color: #1f2430;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #1f2937;
  color: #fff;
  padding: 14px 24px;
}
.topbar .brand { font-weight: 600; }
.topbar nav a { color: #cbd5e1; text-decoration: none; margin-right: 16px; }
.topbar nav a:hover { color: #fff; }
.topbar .user { color: #94a3b8; margin-right: 16px; }
.container { max-width: 960px; margin: 32px auto; padding: 0 20px; }
.login-box {
  max-width: 360px;
  margin: 80px auto;
  background: #fff;
  padding: 32px;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
.login-box h1 { font-size: 20px; margin-bottom: 20px; }
form.form, .login-box form { display: flex; flex-direction: column; }
label { font-size: 13px; font-weight: 600; margin: 12px 0 4px; color: #475569; }
input, select {
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
}
button, .btn, .btn-secondary {
  display: inline-block;
  margin-top: 20px;
  padding: 10px 16px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  text-decoration: none;
  text-align: center;
}
button[type="submit"], .btn { background: #2563eb; color: #fff; }
.btn-secondary { background: #e5e7eb; color: #1f2430; }
.link-btn { background: none; border: none; color: #2563eb; cursor: pointer; padding: 0; font-size: 14px; }
.link-btn.danger { color: #dc2626; }
.error { background: #fee2e2; color: #991b1b; padding: 10px 12px; border-radius: 6px; font-size: 14px; }
.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.cards { display: flex; gap: 16px; margin: 20px 0; }
.card { background: #fff; padding: 20px 28px; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.card-value { font-size: 28px; font-weight: 700; }
.card-label { color: #64748b; font-size: 13px; }
.table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.table th, .table td { text-align: left; padding: 12px 16px; border-bottom: 1px solid #eef0f3; font-size: 14px; }
.table th { background: #f8fafc; color: #475569; font-size: 12px; text-transform: uppercase; }
.badge { padding: 3px 8px; border-radius: 999px; font-size: 12px; }
.badge-active { background: #dcfce7; color: #166534; }
.badge-passive { background: #f1f5f9; color: #64748b; }
.actions a { margin-right: 12px; color: #2563eb; text-decoration: none; }
.form-actions { display: flex; gap: 12px; align-items: center; }

.multiselect { position: relative; margin-top: 4px; }
.multiselect-toggle {
  width: 100%;
  text-align: left;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 14px;
  cursor: pointer;
  margin-top: 0;
  color: #1f2430;
}
.multiselect-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  z-index: 20;
  padding: 8px;
}
.multiselect-options {
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.multiselect-options .option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 6px;
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  color: #1f2430;
  border-radius: 4px;
  cursor: pointer;
}
.multiselect-options .option:hover { background: #f4f5f7; }
.multiselect-options .option input { margin: 0; }
.multiselect-add {
  display: flex;
  gap: 6px;
  padding-top: 8px;
  margin-top: 6px;
  border-top: 1px solid #eef0f3;
}
.multiselect-add input {
  flex: 1;
  padding: 8px;
  font-size: 13px;
}
.multiselect-add button {
  margin-top: 0;
  padding: 8px 12px;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}

.oauth-box {
  margin-top: 28px;
  padding: 20px 24px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.oauth-box h2 { font-size: 16px; margin: 0 0 12px; }
.oauth-box .hint { font-size: 13px; color: #64748b; line-height: 1.6; }
.oauth-box code {
  background: #f4f5f7;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  word-break: break-all;
}
.success { background: #dcfce7; color: #166534; padding: 10px 12px; border-radius: 6px; font-size: 14px; }
