* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font-family: -apple-system, "Segoe UI", Roboto, sans-serif; color: #0f172a; background: #f1f5f9; }
.hidden { display: none !important; }
code { background: #e2e8f0; padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }

/* login */
.login-wrap { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  background: radial-gradient(1000px 500px at 50% -10%, #dbeafe, #f1f5f9 60%); }
.card { width: 360px; background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 26px; box-shadow: 0 18px 45px rgba(2,6,23,.12); }
.brand { font-size: 20px; font-weight: 700; } .brand span { color: #2563eb; }
.sub { color: #64748b; margin: 4px 0 16px; }
form label { display: block; font-size: 12px; color: #475569; margin-bottom: 12px; font-weight: 600; }
input[type=text], input[type=password], select { width: 100%; margin-top: 6px; padding: 10px 12px; border-radius: 9px;
  border: 1px solid #cbd5e1; background: #fff; color: #0f172a; font-size: 14px; font-weight: 400; }
input:focus, select:focus { outline: none; border-color: #2563eb; }
.row { display: flex; align-items: center; gap: 8px; font-weight: 500; }
button { cursor: pointer; }
#loginBtn, #assign { width: 100%; margin-top: 8px; padding: 11px; border: 0; border-radius: 9px; background: #2563eb; color: #fff; font-weight: 600; font-size: 14px; }
#loginBtn:disabled, #assign:disabled { opacity: .6; cursor: default; }
.err { color: #dc2626; font-size: 12px; margin-top: 10px; min-height: 16px; }
.hint { font-size: 12px; color: #64748b; }
#qrImg { width: 158px; height: 158px; border: 1px solid #e2e8f0; border-radius: 8px; padding: 5px; }
.foot { color: #94a3b8; font-size: 12px; }

/* app */
.app { min-height: 100%; }
.top { display: flex; align-items: center; padding: 0 20px; height: 56px; background: #fff; border-bottom: 1px solid #e2e8f0; }
.logo { font-weight: 700; } .logo span { color: #2563eb; }
.who { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: 13px; color: #334155; }
.ghost { background: #fff; border: 1px solid #cbd5e1; color: #334155; padding: 7px 12px; border-radius: 8px; font-size: 12px; }
.ghost.small { padding: 5px 10px; }
.wrap { max-width: 1000px; margin: 22px auto; padding: 0 20px; display: grid; grid-template-columns: 380px 1fr; gap: 20px; align-items: start; }
.panel { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 20px; box-shadow: 0 1px 3px rgba(2,6,23,.05); }
.panel h2 { font-size: 15px; margin: 0 0 14px; }
.panel label { display: block; font-size: 12px; color: #475569; margin-bottom: 14px; font-weight: 600; }
.tip { font-size: 12px; color: #64748b; margin-top: 12px; line-height: 1.5; }
.msg { font-size: 13px; margin-top: 10px; min-height: 18px; }
.msg.ok { color: #16a34a; } .msg.bad { color: #dc2626; }
.rowbetween { display: flex; align-items: center; justify-content: space-between; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #f1f5f9; }
th { color: #64748b; font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .03em; }
.muted { color: #94a3b8; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.pill.reg { background: #dcfce7; color: #15803d; } .pill.unreg { background: #f1f5f9; color: #64748b; }
button.link { background: none; border: 0; color: #2563eb; font-size: 12px; font-weight: 600; padding: 4px 6px; cursor: pointer; }
button.link:hover { text-decoration: underline; }
button.link.danger { color: #dc2626; }
td.actions { white-space: nowrap; }
@media (max-width: 820px) { .wrap { grid-template-columns: 1fr; } }
