:root {
	--bg: #f5f6f8;
	--panel: #ffffff;
	--border: #e3e6ea;
	--text: #1b1f24;
	--muted: #6b7280;
	--brand: #2f6feb;
	--brand-ink: #ffffff;
}

* { box-sizing: border-box; }

body {
	margin: 0;
	font-family: -apple-system, BlinkMacSystemFont, "Pretendard", "Segoe UI", Roboto, sans-serif;
	background: var(--bg);
	color: var(--text);
}

/* --- 상단바 --- */
.topbar {
	background: var(--panel);
	border-bottom: 1px solid var(--border);
}
.topbar-inner {
	max-width: 1080px;
	margin: 0 auto;
	padding: 0 20px;
	height: 56px;
	display: flex;
	align-items: center;
	gap: 24px;
}
.brand { font-weight: 700; text-decoration: none; color: var(--text); }
.nav { display: flex; gap: 16px; flex: 1; }
.nav a { text-decoration: none; color: var(--muted); font-size: 14px; }
.nav a:hover { color: var(--text); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.admin-email { font-size: 13px; color: var(--muted); }
.logout-form { margin: 0; }
.logout-form button {
	border: 1px solid var(--border);
	background: var(--panel);
	color: var(--text);
	padding: 6px 12px;
	border-radius: 6px;
	font-size: 13px;
	cursor: pointer;
}
.logout-form button:hover { background: var(--bg); }

/* --- 본문 --- */
.container { max-width: 1080px; margin: 0 auto; padding: 28px 20px 60px; }
h1 { font-size: 22px; margin: 0 0 20px; }
h2 { font-size: 16px; margin: 32px 0 12px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.card {
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: 10px;
	padding: 18px;
}
.card-label { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.card-value { font-size: 28px; font-weight: 700; }

.data-table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.data-table th, .data-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; }
.data-table th { background: #fafbfc; color: var(--muted); font-weight: 600; }
.data-table tr:last-child td { border-bottom: none; }
.data-table .num { text-align: right; }
.data-table .empty { text-align: center; color: var(--muted); padding: 24px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--bg); border: 1px solid var(--border); font-size: 12px; }

.data-table .nowrap { white-space: nowrap; }
.data-table .sub { color: var(--muted); }
.data-table.compact th, .data-table.compact td { padding: 7px 10px; font-size: 13px; }
.badge-done { background: #e7f6ec; border-color: #b7e0c4; color: #1f7a3d; }
.cell-link { color: var(--brand); text-decoration: none; font-weight: 600; }
.cell-link:hover { text-decoration: underline; }
.row-link { cursor: pointer; }
.row-link:hover td { background: #f7f9fc; }

/* --- 검색바 / 페이징 --- */
.search-bar { display: flex; gap: 8px; margin-bottom: 16px; }
.search-bar input {
	flex: 1; max-width: 420px; padding: 9px 12px;
	border: 1px solid var(--border); border-radius: 8px; font-size: 14px;
}
.search-bar input:focus { outline: none; border-color: var(--brand); }
.search-bar button {
	padding: 9px 18px; background: var(--brand); color: var(--brand-ink);
	border: none; border-radius: 8px; font-weight: 600; font-size: 14px; cursor: pointer;
}
.search-bar button:hover { filter: brightness(0.95); }
.btn-reset {
	display: inline-flex; align-items: center; padding: 9px 14px;
	border: 1px solid var(--border); border-radius: 8px; color: var(--muted);
	text-decoration: none; font-size: 14px;
}
.result-meta { font-size: 13px; color: var(--muted); margin: 0 0 12px; }
.result-meta b { color: var(--text); }
.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 20px; }
.pager-btn {
	padding: 8px 16px; border: 1px solid var(--border); border-radius: 8px;
	background: var(--panel); color: var(--text); text-decoration: none; font-size: 14px;
}
.pager-btn.disabled { color: var(--muted); pointer-events: none; opacity: 0.5; }
.pager-page { font-size: 13px; color: var(--muted); }

/* --- 상세 화면 공통 --- */
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.crumbs a { color: var(--brand); text-decoration: none; }
.crumbs span { margin: 0 4px; }
h2 .count { color: var(--muted); font-weight: 500; font-size: 13px; }
h3 { font-size: 14px; margin: 20px 0 8px; }
h3 .count { color: var(--muted); font-weight: 500; font-size: 12px; }
.detail-grid {
	display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1px;
	background: var(--border); border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
}
.detail-item { background: var(--panel); padding: 12px 16px; display: flex; flex-direction: column; gap: 4px; }
.detail-item .k { font-size: 12px; color: var(--muted); }
.detail-item .v { font-size: 14px; word-break: break-all; }
.empty-inline { color: var(--muted); font-size: 14px; margin: 4px 0 8px; }
.notice-box {
	background: #fff7e6; border: 1px solid #ffe0a3; color: #8a6d1a;
	padding: 12px 16px; border-radius: 10px; font-size: 14px; margin: 16px 0;
}

/* --- 답안 히스토리 (Q&A) --- */
.qa-list { display: flex; flex-direction: column; gap: 12px; }
.qa { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.qa-q { font-weight: 600; font-size: 14px; display: flex; gap: 8px; align-items: baseline; }
.qa-a { margin-top: 8px; font-size: 14px; color: var(--text); white-space: pre-wrap; line-height: 1.55; }
.qa-tag {
	flex: none; display: inline-block; padding: 1px 8px; border-radius: 6px;
	background: var(--brand); color: var(--brand-ink); font-size: 12px; font-weight: 700;
}
.qa-tag.alt { background: #eef1f6; color: var(--muted); }
.qa-reaction { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: baseline; }
.qa-meta { margin-top: 8px; font-size: 12px; color: var(--muted); }
.chip { display: inline-block; padding: 1px 8px; margin-left: 4px; border-radius: 999px; background: var(--bg); border: 1px solid var(--border); font-size: 12px; }

.graph-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.report-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 720px) { .graph-cols, .report-cols { grid-template-columns: 1fr; } }
.bullets { margin: 4px 0 8px; padding-left: 20px; font-size: 14px; line-height: 1.6; }

/* --- 리포트 헤더 --- */
.report-head { display: flex; gap: 18px; align-items: flex-start; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 18px; margin-bottom: 8px; }
.score-badge {
	flex: none; width: 72px; height: 72px; border-radius: 14px; background: var(--brand); color: var(--brand-ink);
	display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 800;
}
.verdict { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.summary { margin: 0; font-size: 14px; line-height: 1.6; color: var(--text); }

/* --- 로그인 --- */
.login-body { display: flex; min-height: 100vh; align-items: center; justify-content: center; }
.login-card {
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: 14px;
	padding: 40px;
	width: 360px;
	text-align: center;
}
.login-card h1 { margin: 0 0 8px; }
.login-sub { color: var(--muted); font-size: 14px; margin: 0 0 24px; }
.notice { font-size: 13px; color: var(--muted); margin: 0 0 16px; }
.notice.error { color: #c0392b; }
.login-form { display: flex; flex-direction: column; gap: 14px; text-align: left; }
.login-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.login-form input {
	padding: 10px 12px;
	border: 1px solid var(--border);
	border-radius: 8px;
	font-size: 14px;
}
.login-form input:focus { outline: none; border-color: var(--brand); }
.login-form button {
	margin-top: 6px;
	padding: 12px;
	background: var(--brand);
	color: var(--brand-ink);
	border: none;
	border-radius: 8px;
	font-weight: 600;
	font-size: 14px;
	cursor: pointer;
}
.login-form button:hover { filter: brightness(0.95); }
.btn-google {
	display: inline-block;
	width: 100%;
	padding: 12px;
	background: var(--brand);
	color: var(--brand-ink);
	text-decoration: none;
	border-radius: 8px;
	font-weight: 600;
}
.btn-google:hover { filter: brightness(0.95); }
