/* =========================================================
   english-common.css
   White theme + crisp line accents (Brand: RED)
   Works with: .crm-layout / .crm-sidebar / .crm-main / .crm-main-inner
   ========================================================= */

/* ---- CSS Variables (Theme) ---- */
/* ---- CSS Variables (Theme) ---- */
:root {
	/* ===== Base ===== */
	--bg: #ffffff;
	--bg-soft: #f7f9fc;           /* very light panel bg */
	--text: #1f2937;              /* slate-800 */
	--text-muted: #6b7280;        /* gray-500 */

	--line: #d1d5db;              /* gray-200 */
	--line-strong: #bfc7d5;       /* slate-300 */

	/* ===== Neutral (Menu / Chip / State) ===== */
	--neutral-soft: #e5e7eb;    /* gray-200 */
	--neutral: #9ca3af;         /* 유지 */
	--neutral-strong: #1f2937;  /* gray-800 */


	/* ===== Brand Accent (Action only) ===== */
	--accent: #dc2626;            /* brand red */
	--accent-soft: rgba(220, 38, 38, 0.14);

	/* Accent helpers (Action / Progress 전용) */
	--accent-06: rgba(220, 38, 38, 0.06);
	--accent-08: rgba(220, 38, 38, 0.08);
	--accent-28: rgba(220, 38, 38, 0.28);
	--accent-35: rgba(220, 38, 38, 0.35);

	/* ===== Status (의미 분리) ===== */
	--danger: #e11d48;             /* error / warning */
	--success: #16a34a;

	/* ===== Shape / Shadow ===== */
	--radius: 12px;
	--shadow: 0 8px 24px rgba(15, 23, 42, 0.08);

	/* ===== Layout ===== */
	--sidebar-w: 260px;
	--topbar-h: 56px;

	/* ===== Font ===== */
	--font: "Noto Sans KR", "Open Sans", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}



/* ---- Base Reset ---- */
* {
	box-sizing: border-box;
}

html, body {
	height: 100%;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

img {
	max-width: 100%;
	display: block;
}

button {
	font-family: inherit;
}

a {
	color: inherit;
	text-decoration: none;
}

/* ---- Layout ---- */
.crm-layout {
	min-height: 100vh;
	display: grid;
	grid-template-columns: var(--sidebar-w) 1fr;
	background: var(--bg);
}

/* Sidebar */
.crm-sidebar {
	position: sticky;
	top: 0;
	height: 100vh;
	background: var(--bg);
	border-right: 2px solid var(--line); /* 메인 포인트 라인 */
	display: flex;
	flex-direction: column;
}

.crm-sidebar-logo {
	padding: 22px 16px 20px;
	border-bottom: 1px solid var(--line);
}

.crm-sidebar-logo .logo-img img {
	height: 28px;
	width: auto;
}

/* Nav */
.crm-sidebar-nav {
	padding: 20px 10px 12px;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.crm-sidebar-nav .nav-item {
	width: 100%;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 11px 12px;
	border: 1px solid transparent;
	border-radius: 10px;
	background: transparent;
	cursor: pointer;
	color: var(--text);
	transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.crm-sidebar-nav .nav-item .nav-icon {
	width: 22px;
	height: 22px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var(--text-muted);
}

.crm-sidebar-nav .nav-item .nav-label {
	font-size: 14px;
	font-weight: 700;
	letter-spacing: -0.2px;
}

/* Hover (비활성) */
.crm-sidebar-nav .nav-item:not(.is-active):hover {
	background: var(--accent-soft);
	border-color: var(--accent-28);
}

/* Active */
.crm-sidebar-nav .nav-item.is-active,
.crm-sidebar-nav .nav-item[aria-current="page"] {
	background: var(--neutral-soft);
	border-color: var(--line-strong);
	box-shadow: inset 3px 0 0 var(--neutral-strong);
}

.crm-sidebar-nav .nav-item.is-active .nav-label,
.crm-sidebar-nav .nav-item[aria-current="page"] .nav-label {
	color: var(--neutral-strong);
	font-weight: 800;
}

.crm-sidebar-nav .nav-item.is-active .nav-icon i,
.crm-sidebar-nav .nav-item[aria-current="page"] .nav-icon i {
	color: var(--accent);
}

/* 로그인 사용자 정보 */
.crm-sidebar-userbox {
	margin-top: auto;
	padding: 14px 12px 16px;
	border-top: 1px solid var(--line);
	display: grid;
	grid-template-columns: 42px 1fr 40px;
	align-items: center;
	gap: 10px;
}

.crm-sidebar-userbox .user-avatar {
	width: 42px;
	height: 42px;
	border-radius: 999px;
	background: var(--neutral-soft);
	border: 1px solid var(--neutral);
	color: var(--neutral-strong);
	font-weight: 900;
	display: flex;
	align-items: center;
	justify-content: center;
}

.crm-sidebar-userbox .user-name {
	font-size: 14px;
	font-weight: 800;
	line-height: 1.2;
}

.crm-sidebar-userbox .user-role {
	font-size: 12px;
	color: var(--text-muted);
	margin-top: 2px;
}

.crm-sidebar-userbox .btn-logout {
	width: 40px;
	height: 40px;
	border-radius: 10px;
	border: 1px solid var(--line);
	background: #fff;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: border-color .15s ease, background .15s ease;
}

.crm-sidebar-userbox .btn-logout:hover {
	background: var(--bg-soft);
	border-color: var(--accent-35);
}

.crm-sidebar-userbox .btn-logout svg {
	width: 18px;
	height: 18px;
}

.crm-sidebar-userbox .btn-logout svg g path {
	fill: var(--text-muted);
}

.crm-sidebar-userbox .btn-logout:hover svg g path {
	fill: var(--accent);
}


/* Main */
.crm-main {
	min-height: 100vh;
	background: var(--bg);
	display: flex;
	flex-direction: column;
}

.crm-main-body {
	flex: 1;
	background: var(--bg);
}

.crm-main-inner {
	max-width: none;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 18px 18px 18px;
}

/* ---- Common UI (cards, toolbars, tables) ---- */
.tf-card,
.crm-card {
	background: #fff;
	border: 1px solid var(--line);
	border-top: 3px solid var(--accent); /* 카드 상단 포인트 라인 */
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	padding: 16px;
}

.tf-toolbar,
.crm-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 12px 14px;
	background: var(--bg-soft);
	border: 1px solid var(--line);
	border-radius: var(--radius);
}

.tf-divider {
	height: 1px;
	background: var(--line);
	margin: 14px 0;
}

/* Inputs */
.tf-input,
.tf-select,
.tf-textarea {
	width: 100%;
	border: 1px solid var(--line-strong);
	border-radius: 10px;
	padding: 10px 12px;
	font-size: 14px;
	background: #fff;
	color: var(--text);
	outline: none;
	transition: border-color .15s ease, box-shadow .15s ease;
}

.tf-textarea {
	min-height: 120px;
	resize: vertical;
}

.tf-input:focus,
.tf-select:focus,
.tf-textarea:focus {
	border-color: var(--neutral);
	box-shadow: 0 0 0 4px var(--neutral-soft);
}

.tf-label {
	font-size: 12px;
	color: var(--text-muted);
	font-weight: 700;
	margin-bottom: 6px;
	display: block;
}

/* Buttons
   - btn-accent: 핵심(레드) 버튼 전용
   - btn-primary: 기본(중립) 버튼
   - btn-outline: 보조(중립) 버튼
*/
.btn-primary,
.btn-outline,
.btn-accent,
.btn-danger {
	border-radius: 6px;
	padding: 6px 12px;
	font-size: 14px;
	font-weight: 800;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	transition: background .15s ease, border-color .15s ease, color .15s ease, transform .02s ease;
	user-select: none;
}

/* 기본(중립) */
.btn-primary {
	border: 1px solid var(--line-strong);
	background: #fff;
	color: var(--text);
}

/*.btn-primary:hover {*/
/*	background: var(--bg-soft);*/
/*	border-color: var(--line-strong);*/
/*}*/

.btn-primary:active {
	transform: translateY(1px);
}

/* 보조(중립) */
.btn-outline {
	border: 1px solid var(--line-strong);
	background: #fff;
	color: var(--text);
}

.btn-outline:hover {
	background: var(--bg-soft);
	border-color: var(--line-strong);
}

/* 핵심(레드) */
.btn-accent {
	border: 1px solid var(--accent);
	background: var(--accent);
	color: #fff;
}

.btn-accent:hover {
	filter: brightness(0.96);
}

.btn-accent:active {
	transform: translateY(1px);
}

/* 위험(삭제 등) */
.btn-danger {
	border: 1px solid rgba(225, 29, 72, 0.35);
	background: rgba(225, 29, 72, 0.10);
	color: var(--danger);
}

.btn-danger:hover {
	background: rgba(225, 29, 72, 0.14);
}

.btn-danger:active {
	transform: translateY(1px);
}

/* Disabled */
.btn-primary:disabled,
.btn-outline:disabled,
.btn-accent:disabled,
.btn-danger:disabled {
	opacity: 0.55;
	cursor: not-allowed;
	transform: none;
}

/* Badges */
.tf-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 9px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 800;
	border: 1px solid var(--line);
	background: #fff;
}

.tf-badge.is-accent {
	border-color: var(--accent-40);
	background: var(--accent-soft);
	color: var(--accent);
}

.tf-badge.is-danger {
	border-color: rgba(225, 29, 72, 0.35);
	background: rgba(225, 29, 72, 0.10);
	color: var(--danger);
}

.tf-badge.is-success {
	border-color: rgba(22, 163, 74, 0.35);
	background: rgba(22, 163, 74, 0.10);
	color: var(--success);
}

/* Tables */
.tf-table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	background: #fff;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	overflow: hidden;
}

.tf-table th, .tf-table td {
	padding: 12px 12px;
	font-size: 13px;
	border-bottom: 1px solid var(--line);
	vertical-align: middle;
}

.tf-table th {
	background: var(--bg-soft);
	color: var(--text);
	text-align: left;
	font-weight: 900;
	border-bottom: 1px solid var(--line-strong);
}

.tf-table tr:last-child td {
	border-bottom: 0;
}

.tf-table tbody tr:hover td {
	background: var(--accent-06);
}

/* ---- Responsive (Mobile) ---- */
@media (max-width: 1023px) {
	:root {
		--sidebar-w: 220px;
	}

	.crm-main-inner {
		padding: 14px 14px 34px;
	}
}

@media (max-width: 767px) {
	.crm-layout {
		grid-template-columns: 1fr;
	}

	/* Sidebar becomes topbar-like */
	.crm-sidebar {
		position: relative;
		height: auto;
		border-right: 0;
		border-bottom: 2px solid var(--accent);
	}

	.crm-sidebar-nav {
		flex-direction: row;
		flex-wrap: wrap;
		gap: 8px;
		padding: 10px 10px 12px;
	}

	.crm-sidebar-nav .nav-item {
		flex: 1 1 calc(50% - 8px);
		justify-content: center;
		padding: 10px 10px;
	}

	.crm-sidebar-userbox {
		grid-template-columns: 42px 1fr 40px;
	}
}

/* ---- Utility ---- */
.text-muted {
	color: var(--text-muted);
}

.line-accent {
	border-left: 3px solid var(--accent);
	padding-left: 10px;
}

.hidden {
	display: none !important;
}

[data-tpl-item] {
	display: none;
}

/* Block */


.section-block {
	border: 1px solid var(--line);
	border-radius: 10px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	height: 100%;
	box-sizing: border-box;
}

.section-title {
	height: 50px;
	box-sizing: border-box;
	padding: 10px 15px;
	display: flex;
	align-items: center;
	background-color: var(--neutral-soft);
	justify-content: space-between;
}

.section-body {
	flex: 1 0 0;
	min-height: 0;
	padding: 10px;
	box-sizing: border-box;
	overflow-y: auto;
}

