:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-muted: #eef0f3;
  --text: #1a2332;
  --text-muted: #5a6678;
  --border: #e2e5ea;
  --primary: #1a2332;
  --action: #1f6b52;
  --action-hover: #185641;
  --accent: #2b5ea8;
  --warning: #9a6700;
  --danger: #b42318;
  --success: #1f6b52;
  --recalled: #6b5b95;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Source Sans 3", "Noto Sans Thai", system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.55; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.topbar { min-height: 56px; display: flex; align-items: center; gap: 20px; padding: 10px 24px; background: var(--surface); color: var(--text); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.brand { font-weight: 700; text-decoration: none; letter-spacing: 0.02em; white-space: nowrap; }
.brand span { color: var(--text-muted); font-weight: 500; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { min-height: 40px; display: inline-flex; align-items: center; padding: 0 12px; color: var(--text-muted); text-decoration: none; border-radius: 6px; font-weight: 600; }
.nav a:hover, .nav a.is-active { background: color-mix(in srgb, var(--action) 10%, var(--surface)); color: var(--action); }
.userbox { display: flex; align-items: center; gap: 10px; color: var(--text-muted); }
.container { max-width: 520px; margin: 48px auto; padding: 24px; }
.login-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 28px; }
.login-panel h1 { margin: 0 0 18px; font-size: 22px; font-weight: 650; letter-spacing: -0.02em; }
.muted { color: var(--text-muted); margin: 0 0 4px; }
label { display: grid; gap: 5px; font-weight: 600; color: var(--text); margin-bottom: 12px; }
input, select, textarea { min-height: 42px; border: 1px solid #cfd5de; border-radius: 6px; padding: 8px 10px; background: white; color: var(--text); width: 100%; }
.form-stack { display: grid; gap: 4px; }
.btn, .link-button { min-height: 42px; border: 1px solid transparent; border-radius: 6px; padding: 8px 14px; cursor: pointer; font-weight: 650; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn.primary { background: var(--action); color: white; width: 100%; margin-top: 8px; }
.btn.primary:hover { background: var(--action-hover); }
.link-button { color: var(--text-muted); background: transparent; padding: 0 6px; }
.error-summary { background: #fef2f2; border: 1px solid #fecaca; color: #7f1d1d; border-radius: 6px; padding: 12px 14px; margin-bottom: 16px; }
.messages { margin-bottom: 16px; }
.message { padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.message.success { background: #e8f5ef; color: #14553f; border-color: #b7e0cb; }
.message.error { background: #fceeee; color: #7f1d1d; border-color: #f0c4c4; }
