﻿/* ========================================
   Nexus WMS - 공통 CSS
   ======================================== */

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif; background: #f1f5f9; color: #1e293b; min-height: 100vh; }
a { text-decoration: none; color: inherit; }

/* === CSS Variables === */
:root {
	--sidebar-width: 260px;
	--header-height: 60px;
	--primary: #2563eb;
	--primary-hover: #1d4ed8;
	--success: #10b981;
	--warning: #f59e0b;
	--danger: #ef4444;
	--info: #3b82f6;
	--gray-50: #f8fafc;
	--gray-100: #f1f5f9;
	--gray-200: #e2e8f0;
	--gray-300: #cbd5e1;
	--gray-400: #94a3b8;
	--gray-500: #64748b;
	--gray-600: #475569;
	--gray-700: #334155;
	--gray-800: #1e293b;
	--gray-900: #0f172a;
}

/* === Sidebar === */
.sidebar {
	position: fixed; top: 0; left: 0; bottom: 0;
	width: var(--sidebar-width); background: var(--gray-900);
	color: #e2e8f0; display: flex; flex-direction: column;
	z-index: 1000; transition: transform 0.3s ease;
	overflow-y: auto;
}
.sidebar-header {
	display: flex; align-items: center; justify-content: space-between;
	padding: 20px 16px; border-bottom: 1px solid var(--gray-700);
}
.sidebar-logo {
	display: flex; align-items: center; gap: 10px;
	font-size: 18px; font-weight: 700; color: #fff;
}
.sidebar-logo i { color: var(--primary); font-size: 22px; }
.sidebar-close { background: none; border: none; color: var(--gray-400); font-size: 20px; cursor: pointer; }
.sidebar-nav { flex: 1; padding: 8px 0; overflow-y: auto; }
.nav-section { margin-bottom: 4px; }
.nav-section-title {
	padding: 12px 20px 6px; font-size: 11px; font-weight: 600;
	text-transform: uppercase; color: var(--gray-500); letter-spacing: 0.05em;
}
.nav-item {
	display: flex; align-items: center; gap: 12px;
	padding: 10px 20px; color: var(--gray-400);
	font-size: 14px; transition: all 0.15s; cursor: pointer;
	border-left: 3px solid transparent;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,0.05); }
.nav-item.active {
	color: #fff; background: rgba(37,99,235,0.15);
	border-left-color: var(--primary);
}
.nav-item i { width: 20px; text-align: center; font-size: 15px; }

/* Sidebar Footer */
.sidebar-footer { border-top: 1px solid var(--gray-700); padding: 8px 0; }
.user-profile {
	display: flex; align-items: center; gap: 10px;
	padding: 12px 16px;
}
.user-avatar {
	width: 36px; height: 36px; border-radius: 50%;
	background: var(--primary); color: #fff;
	display: flex; align-items: center; justify-content: center;
	font-size: 14px; font-weight: 600; flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email { font-size: 11px; color: var(--gray-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-logout { color: var(--gray-500); font-size: 16px; padding: 4px; }
.btn-logout:hover { color: var(--danger); }

/* === Main Wrapper === */
.main-wrapper { margin-left: var(--sidebar-width); min-height: 100vh; }

/* === Header === */
.main-header {
	position: sticky; top: 0; height: var(--header-height);
	background: #fff; border-bottom: 1px solid var(--gray-200);
	display: flex; align-items: center; padding: 0 24px;
	z-index: 100; gap: 16px;
}
.btn-hamburger { background: none; border: none; font-size: 20px; color: var(--gray-600); cursor: pointer; }
.page-title { font-size: 18px; font-weight: 700; color: var(--gray-800); flex: 1; }
.header-right { display: flex; align-items: center; gap: 12px; }
.user-greeting { font-size: 14px; color: var(--gray-500); }

/* === Main Content === */
.main-content { padding: 24px; }

/* === Mobile Navigation === */
.mobile-nav {
	position: fixed; bottom: 0; left: 0; right: 0;
	background: #fff; border-top: 1px solid var(--gray-200);
	display: flex; justify-content: space-around; padding: 6px 0;
	z-index: 1000;
}
.mobile-nav-item {
	display: flex; flex-direction: column; align-items: center;
	gap: 2px; font-size: 10px; color: var(--gray-500); padding: 4px 0;
}
.mobile-nav-item.active { color: var(--primary); }
.mobile-nav-item i { font-size: 18px; }

/* === Sidebar Overlay === */
.sidebar-overlay {
	position: fixed; top: 0; left: 0; right: 0; bottom: 0;
	background: rgba(0,0,0,0.5); z-index: 999; display: none;
}

/* === Cards === */
.card {
	background: #fff; border-radius: 12px; border: 1px solid var(--gray-200);
	box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.card-header {
	padding: 16px 20px; border-bottom: 1px solid var(--gray-200);
	font-size: 16px; font-weight: 600;
}
.card-body { padding: 20px; }

/* === Stat Cards === */
.stat-card {
	background: #fff; border-radius: 12px; padding: 20px;
	border: 1px solid var(--gray-200); box-shadow: 0 1px 3px rgba(0,0,0,0.05);
	display: flex; align-items: center; gap: 16px;
}
.stat-icon {
	width: 48px; height: 48px; border-radius: 12px;
	display: flex; align-items: center; justify-content: center;
	font-size: 20px;
}
.stat-icon.blue { background: #dbeafe; color: var(--primary); }
.stat-icon.amber { background: #fef3c7; color: var(--warning); }
.stat-icon.green { background: #d1fae5; color: var(--success); }
.stat-icon.rose { background: #ffe4e6; color: var(--danger); }
.stat-value { font-size: 28px; font-weight: 700; color: var(--gray-800); }
.stat-label { font-size: 13px; color: var(--gray-500); margin-top: 2px; }

/* === Tables === */
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead th {
	padding: 12px 16px; font-size: 12px; font-weight: 600;
	color: var(--gray-500); text-transform: uppercase;
	background: var(--gray-50); border-bottom: 2px solid var(--gray-200);
	text-align: left; white-space: nowrap;
}
.data-table tbody td {
	padding: 12px 16px; font-size: 14px;
	border-bottom: 1px solid var(--gray-100); color: var(--gray-700);
	vertical-align: middle;
}
.data-table tbody tr:hover { background: var(--gray-50); }

/* === Buttons === */
.btn-primary { background: var(--primary); color: #fff; border: none; border-radius: 8px; padding: 8px 16px; font-size: 14px; font-weight: 500; cursor: pointer; transition: background 0.15s; }
.btn-primary:hover { background: var(--primary-hover); color: #fff; }
.btn-secondary { background: var(--gray-100); color: var(--gray-700); border: 1px solid var(--gray-200); border-radius: 8px; padding: 8px 16px; font-size: 14px; cursor: pointer; }
.btn-secondary:hover { background: var(--gray-200); }
.btn-danger { background: var(--danger); color: #fff; border: none; border-radius: 8px; padding: 8px 16px; font-size: 14px; cursor: pointer; }
.btn-danger:hover { background: #dc2626; }
.btn-success { background: var(--success); color: #fff; border: none; border-radius: 8px; padding: 8px 16px; font-size: 14px; cursor: pointer; }
.btn-success:hover { background: #059669; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-icon { background: none; border: none; cursor: pointer; color: var(--gray-500); padding: 6px; border-radius: 6px; }
.btn-icon:hover { background: var(--gray-100); color: var(--gray-700); }

/* === Badges === */
.badge-status { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.badge-green { background: #d1fae5; color: #065f46; }
.badge-yellow { background: #fef3c7; color: #92400e; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }
.badge-purple { background: #ede9fe; color: #5b21b6; }

/* === Forms === */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--gray-700); margin-bottom: 6px; }
.form-control { width: 100%; padding: 8px 12px; border: 1px solid var(--gray-300); border-radius: 8px; font-size: 14px; outline: none; transition: border-color 0.15s; }
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.form-select { width: 100%; padding: 8px 12px; border: 1px solid var(--gray-300); border-radius: 8px; font-size: 14px; outline: none; background: #fff; }

/* === Modals === */
.modal-backdrop-custom { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 2000; }
.modal-custom {
	position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
	background: #fff; border-radius: 16px; z-index: 2001;
	width: 90%; max-width: 600px; max-height: 90vh; overflow-y: auto;
	box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.modal-header-custom {
	display: flex; align-items: center; justify-content: space-between;
	padding: 20px 24px; border-bottom: 1px solid var(--gray-200);
}
.modal-header-custom h3 { font-size: 18px; font-weight: 700; }
.modal-body-custom { padding: 24px; }
.modal-footer-custom { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 24px; border-top: 1px solid var(--gray-200); }

/* === Search Bar === */
.search-bar {
	position: relative; max-width: 400px;
}
.search-bar input { padding-left: 36px; }
.search-bar i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--gray-400); }

/* === Empty State === */
.empty-state {
	display: flex; flex-direction: column; align-items: center;
	justify-content: center; padding: 60px 20px; color: var(--gray-400);
}
.empty-state i { font-size: 48px; margin-bottom: 16px; }
.empty-state p { font-size: 15px; }

/* === Loading Spinner === */
.loading-spinner {
	display: flex; align-items: center; justify-content: center; padding: 60px;
}
.spinner { width: 40px; height: 40px; border: 4px solid var(--gray-200); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* === Toast === */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast-item {
	padding: 14px 20px; border-radius: 10px; color: #fff;
	font-size: 14px; min-width: 280px; max-width: 400px;
	box-shadow: 0 4px 12px rgba(0,0,0,0.15);
	animation: toastIn 0.3s ease;
	display: flex; align-items: center; gap: 10px;
}
.toast-item.success { background: var(--success); }
.toast-item.error { background: var(--danger); }
.toast-item.warning { background: var(--warning); color: var(--gray-800); }
.toast-item.info { background: var(--info); }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }

/* === Confirm Dialog === */
.confirm-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 9998; display: flex; align-items: center; justify-content: center; }
.confirm-dialog { background: #fff; border-radius: 16px; padding: 28px; max-width: 400px; width: 90%; text-align: center; }
.confirm-dialog h4 { font-size: 18px; font-weight: 700; margin-bottom: 12px; }
.confirm-dialog p { font-size: 14px; color: var(--gray-500); margin-bottom: 24px; }
.confirm-dialog .btn-group { display: flex; gap: 8px; justify-content: center; }

/* === Responsive === */
@media (max-width: 991.98px) {
	.sidebar { transform: translateX(-100%); }
	.sidebar.open { transform: translateX(0); }
	.sidebar.open + .sidebar-overlay { display: block; }
	.main-wrapper { margin-left: 0; }
	.main-content { padding: 16px; padding-bottom: 80px; }
}

/* === Utility === */
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--gray-500); }
.fw-600 { font-weight: 600; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 991.98px) { .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 575.98px) { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } }

/* === Page Header === */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.page-header h2 { font-size: 20px; font-weight: 700; }

/* === Tab Navigation === */
.tab-nav { display: flex; gap: 4px; border-bottom: 2px solid var(--gray-200); margin-bottom: 20px; overflow-x: auto; }
.tab-item { padding: 10px 16px; font-size: 14px; font-weight: 500; color: var(--gray-500); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.tab-item:hover { color: var(--gray-700); }
.tab-item.active { color: var(--primary); border-bottom-color: var(--primary); }

/* === Toolbar === */
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }

/* =============================================
   추가 공통 컴포넌트 스타일
   ============================================= */

/* === Content Header (페이지 상단 바) === */
.content-header {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 12px; margin-bottom: 20px;
}
.content-header .header-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.content-header .header-right { display: flex; align-items: center; gap: 8px; }

/* === Content Toolbar === */
.content-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 12px; margin-bottom: 16px;
}
.content-toolbar .toolbar-left { display: flex; align-items: center; gap: 8px; }
.content-toolbar .toolbar-right { display: flex; align-items: center; gap: 8px; }

/* === Filter Group (상태 필터 버튼 그룹) === */
.filter-group {
    display: inline-flex; border-radius: 8px;
    border: 1px solid var(--gray-200); overflow: hidden;
    background: #fff;
}
.btn-filter {
    padding: 7px 16px; font-size: 13px; font-weight: 500;
    background: #fff; color: var(--gray-600);
    border: none; border-right: 1px solid var(--gray-200);
    cursor: pointer; transition: all 0.15s; white-space: nowrap;
    line-height: 1.4;
}
.btn-filter:last-child { border-right: none; }
.btn-filter:hover { background: var(--gray-50); color: var(--gray-800); }
.btn-filter.active { background: var(--primary); color: #fff; font-weight: 600; }

/* === Table Container === */
.table-container {
    background: #fff; border-radius: 12px;
    border: 1px solid var(--gray-200);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    overflow-x: auto;   /* 모바일 가로 스크롤 허용 */
    overflow-y: hidden;
}
.table-container .data-table thead th:first-child { padding-left: 20px; }
.table-container .data-table tbody td:first-child { padding-left: 20px; }
.table-wrap { overflow-x: auto; }

/* === Content Body (테이블 래퍼 - Supplier/Customer 등) === */
.content-body {
    background: #fff; border-radius: 12px;
    border: 1px solid var(--gray-200);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05); overflow: hidden;
}

/* === Modal Inner Structure (Bootstrap 클래스 스코핑) === */
/* modal-custom은 JS에서 .show()/.hide()로 직접 제어 */
/* modal-custom 안의 modal-dialog: 부모(modal-custom)가 이미 위치/크기 담당 */
.modal-custom .modal-dialog {
    background: #fff; border-radius: 0;
    margin: 0; pointer-events: auto; width: 100%; max-width: 100%;
}
/* modal-lg/modal-sm은 modal-custom의 max-width를 변경 */
.modal-custom.modal-lg { max-width: 860px; }
.modal-custom.modal-sm { max-width: 400px; }

.modal-custom .modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 24px; border-bottom: 1px solid var(--gray-200);
    background: #fff;
}
.modal-custom .modal-header h3,
.modal-custom .modal-header h4,
.modal-custom .modal-header h5,
.modal-custom .modal-title {
    font-size: 18px; font-weight: 700; color: var(--gray-800); margin: 0;
}
.modal-custom .modal-body {
    padding: 24px; overflow-y: auto; max-height: calc(90vh - 145px);
}
.modal-custom .modal-footer {
    display: flex; justify-content: flex-end; gap: 8px;
    padding: 16px 24px; border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}

/* Modal 닫기 버튼 통일 */
.modal-close,
.modal-custom .btn-close {
    background: none; border: none; color: var(--gray-400);
    font-size: 18px; cursor: pointer; padding: 6px; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    line-height: 1; transition: all 0.15s;
}
.modal-close:hover,
.modal-custom .btn-close:hover {
    background: var(--gray-100); color: var(--gray-700);
}

/* === Form Row (2컬럼 폼 레이아웃) === */
.form-row {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.form-row.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 576px) { .form-row, .form-row.cols-3 { grid-template-columns: 1fr; } }

/* form-group 내 label required 마크 */
.form-group label .required,
.required { color: var(--danger); }

/* form-control 추가 폼 요소 */
.form-control[readonly] { background: var(--gray-50); color: var(--gray-500); cursor: default; }
.form-control[disabled] { background: var(--gray-100); color: var(--gray-400); cursor: not-allowed; }
textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control,
.form-select { appearance: auto; }
.field-hint { margin: 4px 0 0; font-size: 12px; color: var(--gray-500); display: flex; align-items: center; gap: 4px; }
.field-hint i { color: var(--primary); font-size: 11px; }
.field-hint a { color: var(--primary); text-decoration: underline; }

/* === Inline Icon Buttons === */
.btn-icon-inline {
    background: none; border: none; cursor: pointer;
    color: var(--gray-400); padding: 4px 6px; border-radius: 6px;
    font-size: 14px; transition: all 0.15s; display: inline-flex;
    align-items: center; gap: 4px;
}
.btn-icon-inline:hover { background: var(--gray-100); color: var(--gray-700); }
.btn-icon-inline.text-danger:hover { background: #fee2e2; color: var(--danger); }
.btn-icon-inline.text-primary:hover { background: #dbeafe; color: var(--primary); }

/* === Block Buttons === */
.btn-block { width: 100%; display: block; text-align: center; }

/* === btn-toggle (접기/펼치기 등) === */
.btn-toggle {
    background: none; border: 1px solid var(--gray-200); border-radius: 6px;
    padding: 5px 10px; font-size: 12px; color: var(--gray-500); cursor: pointer;
}
.btn-toggle:hover { background: var(--gray-50); }

/* === Search Box (페이지별 검색) === */
.search-box { position: relative; }
.search-box i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--gray-400); pointer-events: none; }
.search-box input { padding-left: 36px; min-width: 220px; }

/* === Status Workflow Steps === */
.step-bar {
    display: flex; align-items: center; gap: 0;
    background: var(--gray-50); border-radius: 8px;
    border: 1px solid var(--gray-200); overflow: hidden;
    margin-bottom: 20px;
}
.step-item {
    flex: 1; padding: 10px 12px; text-align: center;
    font-size: 13px; color: var(--gray-500); border-right: 1px solid var(--gray-200);
    white-space: nowrap;
}
.step-item:last-child { border-right: none; }
.step-item.active { background: var(--primary); color: #fff; font-weight: 600; }
.step-item.done { background: #d1fae5; color: #065f46; }

/* === Info Box === */
.info-banner { display:flex; align-items:center; gap:10px; padding:10px 16px; background:#eff6ff; border:1px solid #bfdbfe; border-radius:8px; font-size:13px; color:#1e40af; margin-bottom:16px; }
.info-banner i { color:#3b82f6; flex-shrink:0; }
.info-banner a { color:#1d4ed8; text-decoration:underline; }
.info-box {
    background: #eff6ff; border: 1px solid #bfdbfe;
    border-radius: 8px; padding: 12px 16px;
    font-size: 13px; color: #1e40af;
}
.info-box.warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.info-box.success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.info-box.danger { background: #fef2f2; border-color: #fecaca; color: #991b1b; }

/* === Linked Info (연결 정보 박스) === */
.linked-info {
    background: #f0f9ff; border: 1px solid #bae6fd;
    border-radius: 8px; padding: 12px 16px; margin-top: 16px;
}
.linked-info h4 { font-size: 13px; font-weight: 600; color: #0369a1; margin: 0 0 6px; }
.linked-info p { font-size: 13px; color: var(--gray-600); margin: 0; }

/* === Items Section (발주/주문 품목 섹션) === */
.items-section { margin-top: 20px; border-top: 1px solid var(--gray-200); padding-top: 16px; }
.items-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 12px;
}
.items-header h4 { font-size: 14px; font-weight: 600; color: var(--gray-700); margin: 0; }

/* tfoot 합계 행 */
tfoot td { font-weight: 600; border-top: 2px solid var(--gray-200); padding: 10px 16px; }

/* === Grid 1 === */
.grid-1 { display: grid; grid-template-columns: 1fr; gap: 16px; }

/* === Chart Container === */
.chart-container { height: 280px; position: relative; }
.chart-container-wide { height: 240px; position: relative; }

/* === Action Buttons in Table === */
.actions { white-space: nowrap; display: flex; gap: 4px; align-items: center; }

/* === py utility === */
.py-4 { padding-top: 24px !important; padding-bottom: 24px !important; }
.py-3 { padding-top: 16px !important; padding-bottom: 16px !important; }
.px-3 { padding-left: 16px !important; padding-right: 16px !important; }

/* Bootstrap 호환 */
.mb-3 { margin-bottom: 16px !important; }
.mb-2 { margin-bottom: 8px !important; }
.mt-2 { margin-top: 8px !important; }
.mt-3 { margin-top: 16px !important; }
.fw-bold { font-weight: 700; }
.small { font-size: 12px; }
.text-danger { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-primary { color: var(--primary) !important; }
.text-muted { color: var(--gray-500) !important; }
.d-flex { display: flex; }
.justify-content-between { justify-content: space-between; }
.justify-content-end { justify-content: flex-end; }
.align-items-center { align-items: center; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.w-100 { width: 100%; }
.col-md-6 { width: 50%; }
.row { display: flex; flex-wrap: wrap; gap: 0; margin: 0 -8px; }
.row > [class*="col-"] { padding: 0 8px; box-sizing: border-box; }
@media (max-width: 768px) { .col-md-6 { width: 100%; } }

/* ═══════════════════════════════════════════════
   모바일 공통 반응형
   ═══════════════════════════════════════════════ */
@media (max-width: 768px) {
    /* content-header: 필터 + 버튼 세로 배치 */
    .content-header {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .content-header .header-left { flex-direction: column; align-items: stretch; }
    .content-header .header-right { justify-content: stretch; }
    .content-header .header-right .btn-primary,
    .content-header .header-right .btn-secondary { flex: 1; justify-content: center; }

    /* 필터 버튼: 세그먼트 → 개별 pill 스타일 (wrapping 허용) */
    .filter-group {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        overflow: visible;
        border: none;
        background: transparent;
        border-radius: 0;
    }
    .btn-filter {
        border: 1px solid var(--gray-200) !important;
        border-radius: 20px !important;
        padding: 5px 14px;
        font-size: 12px;
    }
    .btn-filter.active {
        border-color: var(--primary) !important;
    }

    /* ── 모바일 테이블 → 카드 레이아웃 ── */
    .table-container { overflow-x: visible; overflow-y: visible; }
    .data-table { min-width: unset; width: 100%; }

    .data-table thead { display: none; }

    .data-table tbody tr {
        display: block;
        background: #fff;
        border: 1px solid var(--gray-200);
        border-radius: 10px;
        margin-bottom: 8px;
        padding: 10px 12px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    }
    .data-table tbody tr.group-header {
        background: #f8fafc;
        border-radius: 6px;
        padding: 8px 12px;
    }

    .data-table tbody td {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        padding: 4px 0 !important;
        border: none !important;
        font-size: 13px !important;
        min-height: 26px;
        gap: 8px;
        vertical-align: unset;
    }
    .data-table tbody td::before {
        content: attr(data-label);
        font-size: 10px;
        font-weight: 600;
        color: var(--gray-400);
        text-transform: uppercase;
        letter-spacing: 0.4px;
        flex-shrink: 0;
        min-width: 52px;
    }

    /* 액션(버튼) 열: 레이블 없이 우측 정렬 */
    .data-table tbody td.actions {
        justify-content: flex-end;
        padding-top: 8px;
        margin-top: 2px;
        border-top: 1px solid var(--gray-100) !important;
    }
    .data-table tbody td.actions::before { display: none; }

    /* colspan 빈-상태 행은 단순 표시 */
    .data-table tbody td[colspan] {
        display: block;
        text-align: center;
    }
    .data-table tbody td[colspan]::before { display: none; }
}
