* {
	box-sizing: border-box;
}

html {
	font-size: 16px;
}

body {
	margin: 0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", Arial, sans-serif;
	font-size: 1rem;
	line-height: 1.5;
	color: #111;
	background: #fff;
}

a {
	color: #1267c7;
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

button,
input,
select,
textarea {
	font: inherit;
}

input,
select,
textarea {
	width: 100%;
	border: 1px solid #8f8f8f;
	border-radius: 0;
	background: #fff;
	padding: 0.62rem 0.7rem;
	font-size: 1rem;
}

input:focus,
select:focus,
textarea:focus {
	outline: 2px solid rgba(18, 103, 199, 0.25);
	border-color: #1267c7;
}

textarea {
	resize: vertical;
	min-height: 10rem;
}

label span {
	display: block;
	margin-bottom: 0.35rem;
	font-weight: 700;
}

label em {
	font-style: normal;
	color: #d60000;
}

.login-body {
	min-height: 100vh;
	background: #f5f6f8;
}

.login-wrap {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 100vh;
	padding: 1.25rem;
}

.login-card {
	width: 100%;
	max-width: 25rem;
	background: #fff;
	border: 1px solid #ddd;
	padding: 2rem;
	box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.06);
}

.login-card h1,
.panel h1,
.panel h2,
.admin-header h1 {
	margin: 0 0 0.75rem;
	line-height: 1.25;
}

.help-text {
	margin: 0 0 1.25rem;
	color: #555;
}

.stack-form {
	display: grid;
	gap: 1rem;
}

.btn,
.search-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 2.55rem;
	border: 1px solid transparent;
	background: #eee;
	color: #111;
	padding: 0.55rem 1rem;
	cursor: pointer;
	text-decoration: none;
	line-height: 1.2;
}

.btn:hover,
.search-btn:hover {
	text-decoration: none;
	filter: brightness(0.97);
}

.btn-primary {
	background: #1267c7;
	border-color: #1267c7;
	color: #fff;
}

.btn-line {
	background: #fff;
	border-color: #aaa;
	color: #111;
}

.btn-danger {
	background: #d93636;
	border-color: #d93636;
	color: #fff;
}

.btn-small {
	min-height: 2rem;
	padding: 0.35rem 0.6rem;
	font-size: 0.875rem;
	white-space: nowrap;
}

.full-btn {
	width: 100%;
}

.flash-wrap {
	display: grid;
	gap: 0.5rem;
	margin-bottom: 1rem;
}

.flash {
	padding: 0.75rem 0.9rem;
	border: 1px solid #ddd;
	background: #f6f6f6;
}

.flash-success {
	border-color: #9ed2a1;
	background: #f0fff1;
	color: #1b6b24;
}

.flash-error {
	border-color: #f0a5a5;
	background: #fff3f3;
	color: #9d1212;
}

.notice-box,
.empty-box {
	padding: 1rem;
	border: 1px dashed #aaa;
	background: #fafafa;
	text-align: center;
}

.search-page {
	position: relative;
	min-height: 100vh;
	padding: 2.5rem 1rem;
}

.corner-menu {
	position: fixed;
	top: 1rem;
	right: 1rem;
	display: flex;
	gap: 0.75rem;
	z-index: 5;
	font-size: 0.9rem;
}

.search-frame {
    width: 100%;
    max-width: 23rem;
    min-height: 31.5rem;
    margin: 0 auto;
    border: 1px solid #EAEAEA;
    padding: 8.4rem 1.85rem 2rem;
}

.search-section {
	margin: 0 0 1.65rem;
}

.search-section label {
	display: block;
	margin-bottom: 0.45rem;
	font-weight: 700;
}

.search-section input,
.search-section select {
	height: 2.2rem;
	padding: 0.35rem 0.5rem;
	border: 2px solid #111;
}

.search-btn {
	width: 100%;	height: 2rem;
	min-height: 2rem;
	margin-top: 0.75rem;
	border: 0;
	background: #eee;
	font-weight: 700;
}

.case-search {
	margin-top: 2rem;
}

.case-grid {
	display: grid;
	grid-template-columns: 1fr 1fr 1.4fr;
	gap: 0.45rem;
}

.result-wrap {
	width: 100%;
	max-width: 23rem;
	margin: 1.5rem auto 0;
	display: grid;
	gap: 1rem;
}

.result-card {
	border: 0;
	padding: 0;
	background: #fff;
}

.result-case-title,
.detail-case-title {
	margin: 0 0 1.4rem;
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.3;
	text-align: center;
}

.result-card h2 {
	margin: 1.45rem 0 0.45rem;
	font-size: 1rem;
}

.result-card h2:first-of-type {
	margin-top: 0;
}

.info-table {
	width: 100%;
	border-collapse: collapse;
	table-layout: fixed;
	margin-bottom: 0.9rem;
}

.info-table th,
.info-table td {
	border: 1px solid #aaa;
	padding: 0.34rem 0.5rem;
	vertical-align: top;
	word-break: break-all;
}

.info-table th {
	width: 34%;
	background: #f3f3f3;
	font-weight: 700;
	text-align: center;
}

.info-table td {
	color: #1267c7;
	font-weight: 700;
}

.notes-box {
	min-height: 10rem;
	border: 1px solid #aaa;
	padding: 0.8rem;
	white-space: normal;
	word-break: break-word;
}

.page-shell {
	width: 100%;
	max-width: 74rem;
	margin: 0 auto;
	padding: 1.5rem 1rem 3rem;
}

.narrow-shell {
	max-width: 38rem;
}

.admin-shell {
	display: grid;
	gap: 1rem;
}

.admin-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
	padding: 1rem 0;
}

.admin-header p {
	margin: 0;
	color: #555;
}

.top-actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 0.5rem;
}

.top-actions a {
	display: inline-flex;
	align-items: center;
	min-height: 2.25rem;
	padding: 0.4rem 0.7rem;
	border: 1px solid #ccc;
	background: #fff;
	color: #111;
	font-size: 0.9rem;
}

.panel {
	border: 1px solid #ddd;
	background: #fff;
	padding: 1rem;
}

.section-title-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 1rem;
}

.section-title-row h2 {
	margin: 0;
}

.count-badge {
	display: inline-flex;
	align-items: center;
	min-height: 2rem;
	padding: 0.2rem 0.65rem;
	background: #f0f3f8;
	border: 1px solid #d7deea;
	font-weight: 700;
}

.admin-form h3 {
	margin: 1.6rem 0 0.75rem;
	padding-bottom: 0.35rem;
	border-bottom: 1px solid #e5e5e5;
	font-size: 1.05rem;
}

.admin-form h3:first-of-type {
	margin-top: 0;
}

.form-grid {
	display: grid;
	gap: 0.9rem;
}

.two-col {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.three-col {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.full-label {
	display: block;
}

.form-actions {
	display: flex;
	justify-content: flex-end;
	gap: 0.5rem;
	margin-top: 1rem;
}

.small-form {
	margin-top: 0.75rem;
}

.table-scroll {
	overflow-x: auto;
}

.list-table {
	width: 100%;
	min-width: 55rem;
	border-collapse: collapse;
}

.list-table th,
.list-table td {
	border: 1px solid #ddd;
	padding: 0.65rem;
	vertical-align: middle;
	text-align: left;
}

.list-table th {
	background: #f5f6f8;
	font-weight: 700;
}

.empty-cell {
	text-align: center !important;
	color: #777;
}

.row-actions {
	display: flex;
	align-items: center;
	gap: 0.35rem;
	white-space: nowrap;
}

.inline-form {
	display: inline;
	margin: 0;
}

.modal[hidden] {
	display: none;
}

.modal {
	position: fixed;
	inset: 0;
	z-index: 50;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}

.modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
}

.modal-box {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 42rem;
	max-height: calc(100vh - 2rem);
	overflow: auto;
	background: #fff;
	box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.25);
}

.modal-head,
.modal-actions {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 1rem;
	border-bottom: 1px solid #ddd;
}

.modal-actions {
	justify-content: flex-end;
	border-top: 1px solid #ddd;
	border-bottom: 0;
}

.modal-head h2 {
	margin: 0;
	font-size: 1.25rem;
}

.modal-close {
	border: 0;
	background: transparent;
	font-size: 2rem;
	line-height: 1;
	cursor: pointer;
}

.modal-body {
	padding: 1rem;
}

.detail-print h3 {
	margin: 1.2rem 0 0.45rem;
	font-size: 1rem;
}

.detail-print h3:first-of-type {
	margin-top: 0;
}

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

@media (max-width: 760px) {
	.search-page {
		padding-top: 3.5rem;
	}

	.corner-menu {
		position: absolute;
		top: 0.75rem;
		right: 0.75rem;
	}

	.search-frame {
		max-width: 100%;
		min-height: 28rem;
		padding: 6.5rem 1.25rem 1.5rem;
	}

	.result-wrap {
		max-width: 100%;
	}

	.admin-header {
		flex-direction: column;
	}

	.top-actions {
		justify-content: flex-start;
	}

	.two-col,
	.three-col {
		grid-template-columns: 1fr;
	}

	.section-title-row {
		align-items: flex-start;
		flex-direction: column;
	}

	.form-actions {
		justify-content: stretch;
	}

	.form-actions .btn {
		width: 100%;
	}

	.modal {
		align-items: flex-start;
		padding: 0.5rem;
	}

	.modal-box {
		max-height: calc(100vh - 1rem);
	}
}

@media print {
	body.print-modal * {
		visibility: hidden !important;
	}

	body.print-modal #modalPrintArea,
	body.print-modal #modalPrintArea * {
		visibility: visible !important;
	}

	body.print-modal #modalPrintArea {
		position: absolute;
		left: 0;
		top: 0;
		width: 100%;
		padding: 0;
	}

	body.print-modal .modal,
	body.print-modal .modal-box,
	body.print-modal .modal-body {
		position: static;
		inset: auto;
		box-shadow: none;
		max-height: none;
		overflow: visible;
		padding: 0;
	}

	body:not(.print-modal) .top-actions,
	body:not(.print-modal) .form-actions,
	body:not(.print-modal) .row-actions,
	body:not(.print-modal) .corner-menu {
		display: none !important;
	}
}
