* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #f3f4f6; color: #1f2937; line-height: 1.5;
}
.wrap { max-width: 860px; margin: 28px auto; padding: 0 20px; }
.wrap.narrow { max-width: 460px; }
.card {
  background: #fff; border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 8px 24px rgba(0,0,0,.04);
  padding: 28px; margin-bottom: 20px;
}
.center { text-align: center; }
h1 { font-size: 1.5rem; margin-bottom: 8px; }
h2 { font-size: 1.2rem; margin-bottom: 10px; }
.sub { color: #6b7280; margin-bottom: 18px; }
.muted { color: #9ca3af; }
.small { font-size: .85rem; }
.foot { margin-top: 16px; font-size: .9rem; }
.alert-text { color: #b91c1c; }

label { display: block; font-weight: 600; margin: 14px 0 6px; }
input, textarea {
  width: 100%; border: 1px solid #d1d5db; border-radius: 10px;
  padding: 11px; font-size: 1rem; font-family: inherit; resize: vertical; background:#fff;
}
input:focus, textarea:focus { outline: 2px solid #6366f1; border-color: #6366f1; }
.counter { text-align: right; color: #9ca3af; font-size: .8rem; margin-top: 4px; }

button, .btn {
  display: inline-block; background: #4f46e5; color: #fff; border: none;
  border-radius: 10px; padding: 11px 18px; font-size: 1rem; font-weight: 600;
  cursor: pointer; text-decoration: none; margin-top: 14px;
}
button:hover, .btn:hover { background: #4338ca; }
button:disabled { background: #c7c9d6; cursor: not-allowed; }
.btn.ghost { background: #e5e7eb; color: #374151; }
.btn.ghost:hover { background: #d1d5db; }
.btnrow { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.link { color: #4f46e5; text-decoration: none; word-break: break-all; }
.link:hover { text-decoration: underline; }

.topbar {
  display: flex; align-items: center; gap: 14px;
  background: #fff; padding: 14px 22px; border-bottom: 1px solid #e5e7eb;
}
.topbar .brand { font-weight: 700; }
.topbar .spacer { flex: 1; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.stat { background: #fff; border-radius: 16px; padding: 20px 24px;
        box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.stat-label { color: #6b7280; font-size: .9rem; }
.stat-value { font-size: 1.8rem; font-weight: 700; margin-top: 4px; }

.qrbox { display: inline-block; padding: 16px; background: #fff; border-radius: 12px; margin: 12px 0; }
.qrbox img, .qrbox canvas { display: block; }
.content { white-space: pre-wrap; word-wrap: break-word; margin-top: 8px; }

.alert { background: #fef2f2; color: #b91c1c; border-radius: 8px; padding: 12px; margin-bottom: 12px; }
.notice { background: #ecfdf5; color: #047857; border-radius: 8px; padding: 12px; margin-bottom: 12px; }

.tbl { width: 100%; border-collapse: collapse; margin-top: 8px; }
.tbl th, .tbl td { text-align: left; padding: 10px 8px; border-bottom: 1px solid #eef0f3; font-size: .95rem; vertical-align: middle; }
.tbl th { color: #6b7280; font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }

.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form input { width: auto; flex: 1; min-width: 90px; }
.inline-form button { margin-top: 0; padding: 9px 14px; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.badge.green { background: #ecfdf5; color: #047857; }
.badge.red { background: #fef2f2; color: #b91c1c; }

@media (max-width: 560px) {
  .grid2 { grid-template-columns: 1fr; }
}
