/* ================================================================
   진담헤어 관리자 – Admin CSS
   디자인 톤: 파란색 계열, 둥근 버튼 (디자이너 테마 통일)
   ================================================================ */

/* ── Variables ────────────────────────────────────── */
:root {
    --primary: #2563EB;
    --primary-dark: #1D4ED8;
    --primary-light: #EFF6FF;
    --primary-border: #BFDBFE;
    --secondary: #64748B;
    --success: #10B981;
    --success-light: #ECFDF5;
    --danger: #EF4444;
    --danger-light: #FEF2F2;
    --warning: #F59E0B;
    --bg: #F8FAFC;
    --card-bg: #FFFFFF;
    --text-primary: #1E293B;
    --text-secondary: #64748B;
    --border: #E2E8F0;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -1px rgba(0,0,0,.04);
}

/* Base */
body {
    font-family: 'Pretendard', 'Noto Sans KR', sans-serif;
    background-color: var(--bg);
    color: var(--text-primary);
    font-size: 14px;
    margin: 0;
}

/* ================================================================
   레이아웃
   ================================================================ */

/* ── Sidebar ─────────────────────────────────────── */
.sidebar {
    width: 240px;
    height: 100vh;
    background: #1E293B;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255,255,255,.1);
    flex-shrink: 0; /* §2.8⑥ 헤더 고정 */
}

.sidebar-brand h1 {
    font-size: 18px;
    font-weight: 700;
    color: #FFFFFF;
    margin: 0;
}

.sidebar-brand small {
    font-size: 11px;
    color: #94A3B8;
}

.sidebar-nav {
    padding: 16px 0;
    flex: 1 1 auto; /* §2.8⑥ 메뉴만 스크롤 */
    overflow-y: auto;
    min-height: 0;
}

/* 스크롤바 (§2.9) — 얇고 은은하게. 다크 영역=반투명 흰 / 라이트=옅은 회색 */
* { scrollbar-width: thin; scrollbar-color: rgba(100,116,139,.4) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(100,116,139,.35); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(100,116,139,.55); }
.sidebar-nav { scrollbar-color: rgba(255,255,255,.25) transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.22); }
.sidebar-nav::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.4); }

.nav-section-title {
    font-size: 10px;
    font-weight: 600;
    color: #64748B;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: 8px 24px 4px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 24px;
    color: #94A3B8;
    text-decoration: none;
    font-size: 14px;
    border-radius: 0;
    transition: all 0.15s;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(37,99,235,.15);
    color: #60A5FA;
}

.sidebar-nav a.active {
    border-left: 3px solid #2563EB;
}

.sidebar-nav a i {
    width: 18px;
    text-align: center;
}

/* 텍스트 로고 (§2.8): "진담헤어 ADMIN" */
.brand-logo {
    font-size: 18px;
    font-weight: 800;
    color: #FFFFFF;
    margin: 0;
    letter-spacing: -0.01em;
    cursor: default; /* 텍스트 I-beam/도움말(?) 커서 제거 — 툴팁(title)은 그대로 */
    display: inline-block;
}
.brand-logo span {
    color: #60A5FA;
    font-weight: 700;
    margin-left: 2px;
}

/* 사이드바 접기 핸들 — 사이드바 오른쪽 가장자리의 < / > 탭 (§2.8 ⑤) */
.sidebar-edge-toggle {
    display: none; /* 데스크탑(≥729px)에서만 표시 */
    position: fixed;
    top: 50%;
    left: 216px; /* 240(사이드바폭) - 24(버튼폭): 오른쪽 끝이 사이드바 경계에 딱 맞음(넘지 않음) */
    transform: translateY(-50%);
    width: 24px;
    height: 52px;
    background: #1E293B;
    color: #94A3B8;
    border: 1px solid rgba(255,255,255,.14);
    border-right: none; /* 사이드바 경계에 붙으므로 오른쪽 보더 없음 */
    border-radius: 6px 0 0 6px; /* 왼쪽만 둥글게 */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 101; /* 사이드바(100) 위 */
    font-size: 12px;
    transition: left 0.3s ease, background 0.15s;
}
.sidebar-edge-toggle:hover { background: #273449; color: #fff; }
.sidebar-edge-toggle i { transition: transform 0.3s ease; }
@media (min-width: 729px) {
    .sidebar-edge-toggle { display: flex; }
    /* 접힘: 핸들을 화면 왼쪽 끝에 붙임 + 왼쪽 보더 없음 + 화살표 반전(>) */
    html.sidebar-collapsed .sidebar-edge-toggle {
        left: 0;
        border-right: 1px solid rgba(255,255,255,.14);
        border-left: none;
        border-radius: 0 6px 6px 0;
    }
    html.sidebar-collapsed .sidebar-edge-toggle i { transform: rotate(180deg); }
}

/* ── Main Content ────────────────────────────────── */
.main-content {
    margin-left: 240px;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

/* 사이드바 접힘 상태 (데스크탑 전용) — html.sidebar-collapsed 토글 */
@media (min-width: 729px) {
    html.sidebar-collapsed .sidebar { transform: translateX(-100%); }
    html.sidebar-collapsed .main-content { margin-left: 0; }
}

/* ── Top Header ──────────────────────────────────── */
.top-header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 90;
}

.page-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}
/* 페이지 제목 옆 작대기(액센트 바) */
.page-title::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 18px;
    margin-right: 10px;
    border-radius: 2px;
    background: var(--primary);
    vertical-align: -2px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-secondary);
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
}

/* ── Hamburger (mobile) ──────────────────────────── */
.hamburger-btn {
    display: none;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 99;
}

.sidebar-overlay.show {
    display: block;
}

/* ── Page Body ───────────────────────────────────── */
.page-body {
    padding: 28px;
}

/* ================================================================
   카드
   ================================================================ */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--card-bg);
}

.card-body {
    padding: 20px;
}

/* ================================================================
   테이블
   ================================================================ */
.table-wrapper {
    overflow-x: auto;
}

.table { font-size: 14px; margin: 0; }
.table thead th {
    background: #F8FAFC;
    border-bottom: 2px solid var(--border);
    font-weight: 600;
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    padding: 10px 14px;
}
.table tbody td {
    padding: 12px 14px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-primary);
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background 0.15s; }
.table tbody tr:hover td { background-color: var(--primary) !important; color: #fff !important; cursor: pointer; }
.table tbody tr:hover td .btn { color: inherit; background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.4); }
.table tbody tr:hover td .badge-status { opacity: .9; }
.table .text-center { text-align: center; }
.table .text-right { text-align: right; }

/* ── 그리드 공통: 컬럼 너비 고정 + 셀 말줄임(…) + 호버 툴팁 ──
   table-layout:fixed 로 내용 길이에 따라 컬럼 너비가 흔들리는 것 방지.
   넘치는 텍스트는 … 처리하고, JS(createTableSorter)가 전체 내용을 title 툴팁으로 부여한다.
   서브/모달 테이블(table-sm)은 제외. 버튼이 든 셀은 JS가 overflow:visible 로 되돌린다. */
.table-responsive > table.table:not(.table-sm) {
    table-layout: auto;   /* 내용에 맞게 — 순번/일시는 고정폭으로 가로를 점유하지 않고 max-width 로 캡(텍스트 컬럼이 뭉개지지 않게) */
    width: 100%;
}
.table-responsive > table.table:not(.table-sm) thead th,
.table-responsive > table.table:not(.table-sm) tbody td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 320px;   /* 기본 캡 — 한 컬럼이 과도하게 넓어지지 않게(넘치면 말줄임+커스텀 툴팁) */
}

/* 헤더 전부 중앙 정렬 (§2.6 — 콘텐츠 정렬과 무관하게 th 는 항상 중앙) */
.table thead th { text-align: center !important; }
/* 셀 세로 구분선 (§2.5 — postring 동일) */
.table thead th, .table tbody td { border-right: 1px solid var(--border); }
.table thead th:last-child, .table tbody td:last-child { border-right: none; }
/* 순번 컬럼 너비 캡 → 실제 규칙은 §2.10 의 `.table th.col-seq, .table td.col-seq`(특정도 높음)에서 통일 관리 */
/* 일시 컬럼: 고정폭 X, 최대 너비만(§2.5 — auto 레이아웃에서 내용 폭으로, 상한 172px) */
.col-datetime { max-width: 172px !important; }

/* ── 테이블 헤더 정렬 (Multi-column Sort) ─── */
.table thead th.sortable {
    cursor: pointer;
    position: relative;
    user-select: none;
    transition: background 0.15s;
}
.table thead th.sortable:hover {
    background: var(--primary-light);
}
/* 정렬 표시(§2.6) — 라벨 바로 옆 인라인 묶음(숫자배지 + 화살표). 셀 끝 절대위치 아님(postring 동일 위치) */
.sort-ind { display: inline-flex; align-items: center; gap: 2px; margin-left: 4px; vertical-align: middle; }
.sort-ind .sort-ar { font-size: 10px; color: #CBD5E1; line-height: 1; }
.table thead th.sortable.sorted .sort-ind .sort-ar { color: var(--primary); }
.sort-ind .sort-pri {
    display: none; min-width: 16px; height: 16px; line-height: 16px; text-align: center;
    font-size: 9px; font-weight: 700; color: #fff; background: var(--primary);
    border-radius: 9999px; padding: 0 3px;
}
.sort-ind .sort-pri:not(:empty) { display: inline-block; }

/* ================================================================
   배지
   ================================================================ */
.badge-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}
.badge-active { background: var(--success-light); color: var(--success); }
.badge-inactive { background: var(--danger-light); color: var(--danger); }
.badge-pending { background: #FEF3C7; color: #92400E; }
.badge-default { background: var(--bg); color: var(--text-secondary); }

/* ================================================================
   버튼
   ================================================================ */
.btn {
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    padding: 8px 16px;
    transition: all 0.15s;
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
    color: #fff;
}

.btn-outline-primary {
    background: transparent;
    border-color: var(--primary);
    color: var(--primary);
}

.btn-outline-primary:hover,
.btn-outline-primary.active {
    background: var(--primary);
    color: #fff;
}

.btn-sm { padding: 5px 12px; font-size: 12px; }

/* ================================================================
   조회 건수
   ================================================================ */
.record-count {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.record-count strong {
    color: var(--primary);
    font-weight: 600;
}

/* ================================================================
   검색 바
   ================================================================ */
.search-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    align-items: center;
}
.search-bar .form-control,
.search-bar .form-select {
    max-width: 200px;
    height: 38px;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.search-bar .btn {
    height: 38px;
    font-size: 14px;
    border-radius: var(--radius-sm);
}

/* ================================================================
   페이지네이션
   ================================================================ */
.pagination-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px 0;
}
/* §3.3 페이저: ‹ 1 … 현재주변 … N › — 첫/마지막 항상, n/n 텍스트 없음 */
.pagination-wrapper nav { display: flex; align-items: center; }
.pagination-wrapper .pagination { margin: 0; }
.pagination .page-gap .page-link { background: transparent; border: none; color: var(--text-muted); cursor: default; pointer-events: none; min-width: auto; padding: 0 4px; }

/* §2.2 검색유형 폭 조정은 보류 — 검색유형/검색값의 위아래 정렬이 틀어져 원복(이전 d-flex 기본 정렬 유지) */
.pagination .page-link {
    color: var(--primary);
    font-size: 14px;
    border: none;
    border-radius: var(--radius-sm);
    margin: 0 4px;
    background: #F1F5F9; /* 연한 회색 배경 박스 (포스트링식) — 이전/다음(< >)도 인지 잘 되게 */
    min-width: 36px;
    text-align: center;
    transition: background 0.15s;
}
.pagination .page-link:hover { background: #E2E8F0; }
.pagination .page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.pagination .page-item.disabled .page-link {
    background: #F1F5F9;
    color: var(--text-muted);
    opacity: .55;
}

/* 로딩 스켈레톤 (그리드 데이터 도착 전 shimmer) — ADMIN_PAGE_RULE §1.2 */
.skeleton-row td { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.skeleton-row:hover td { background: transparent !important; color: inherit !important; cursor: default; }
.skeleton-box {
    display: block;
    height: 14px;
    width: 70%;
    border-radius: 4px;
    background: linear-gradient(90deg, #eef2f7 25%, #e2e8f0 37%, #eef2f7 63%);
    background-size: 400% 100%;
    animation: skeletonShimmer 1.4s ease infinite;
}
@keyframes skeletonShimmer {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

/* ================================================================
   모달
   ================================================================ */
.modal-header {
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
}
.modal-title { font-size: 16px; font-weight: 700; }
.modal-body { padding: 20px; }
.modal-footer { border-top: 1px solid var(--border); padding: 12px 20px; }

/* ================================================================
   폼
   ================================================================ */
.form-label { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; }
.form-control, .form-select {
    font-size: 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.form-text { font-size: 12px; color: var(--text-secondary); }

/* 검색 필터(card 내 align-items-end row)의 마지막 col=조회 버튼:
   가장 우측 고정 + 가로는 컨텐츠 폭만 + 세로는 전체 높이 채움 */
.card .row.align-items-end > div:last-child:has(> .btn) {
    align-self: stretch;     /* 세로 전체 높이 */
    flex: 0 0 auto;
    width: auto;             /* col 고정폭(col-md-*) 해제 → 컨텐츠 폭 */
    max-width: none;
    margin-left: auto;       /* 가장 우측 고정 */
}
.card .row.align-items-end > div:last-child:has(> .btn) > .btn {
    height: 100%;            /* 세로 채움 */
    width: auto !important;  /* w-100(!important) 무력화 → 컨텐츠 폭 */
}

/* ===== 목록 화면 표준 UI (feedback_admin_grid_search_ui_spec) ===== */
/* 검색영역: 필터(좌) + 우측 세로 [초기화 / 조회], 조회가 남는 세로영역 채움 */
.search-bar-flex {
    display: flex;
    gap: 12px;
    align-items: stretch;
}
.search-bar-flex .search-filters {
    flex: 1 1 auto;
    min-width: 0;
}
.search-bar-flex .search-actions {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 96px;
}
.search-bar-flex .search-actions .btn {
    width: 100%;
    flex: 1 1 0;        /* §2.2 초기화·조회 둘 다 세로영역 분배 */
    min-height: 0;      /* 버튼 자동 최소높이가 검색영역 높이를 키우지 않게 */
    line-height: 1.2;
}
/* 검색영역 단독 셀렉트(콤보)는 컬럼 폭을 꽉 채워 라벨 아래 정렬 통일 (검색유형+키워드 d-flex 쌍은 제외) */
.search-filters .row > [class*="col-"] > .combobox { display: flex; width: 100%; }
.search-filters .row > [class*="col-"] > .combobox .combobox-input { width: 100%; min-width: 0; }

/* 그리드 헤더: 좌(색바+전체건수) / 우(액션버튼 + 페이지크기 셀렉트) */
.grid-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.grid-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-primary);
}
.grid-header-left .grid-accent {
    width: 4px;
    height: 16px;
    border-radius: 2px;
    background: var(--primary);
    display: inline-block;
}
.grid-header-left strong { color: var(--primary); }
.grid-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}
.grid-header-right .page-size-box {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
}
.grid-header-right .page-size-box select.form-select {
    width: auto;
    min-width: 64px;
}
/* 포스트링 기준: 그리드 헤더 버튼은 조금 크게, 페이지크기 셀렉트는 너비 넉넉히 */
.grid-header-right > .btn {
    padding: 7px 14px;
    font-size: 13px;
}
/* 엑셀 다운로드 버튼 (§2.1) — 흰 배경 + 보더, 엑셀 그린 아이콘 */
.btn-excel {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    white-space: nowrap;
}
.btn-excel:hover { background: #F1F5F9; color: var(--text-primary); border-color: var(--border); }
.btn-excel i { color: #1D6F42; }

/* §2.11 컬럼 표시/숨김 토글 — 버튼 + 팝오버(뱃지) */
.btn-coltoggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    white-space: nowrap;
}
.btn-coltoggle:hover { background: #F1F5F9; color: var(--text-primary); }
.coltoggle-pop {
    z-index: 1080;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: 0 6px 20px rgba(0, 0, 0, .12);
    padding: 10px;
    max-width: 340px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.coltoggle-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    cursor: pointer;
    background: #F1F5F9;
    color: var(--text-muted);
    border: 1px solid var(--border);
    user-select: none;
}
.coltoggle-badge.active { background: var(--primary); color: #fff; border-color: var(--primary); }
/* 페이지크기 콤보는 컨텐츠만큼만 (포스트링처럼 컴팩트). inline-flex + form-select width:100% 라서 래퍼에 고정폭 지정 */
.page-size-box .combobox {
    width: 96px;
    flex: 0 0 auto;
}
.page-size-box .combobox-input {
    width: 100%;
    min-width: 0;
    padding-right: 28px;
}
/* 초기화 버튼: 색상반전 대신 살짝만 호버 (다른 버튼과 톤 통일) */
.search-actions .btn-outline-primary:hover,
.search-actions .btn-outline-primary:focus {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

/* ================================================================
   Info Row (read-only detail)
   ================================================================ */
.info-row {
    display: flex;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.info-row:last-child { border-bottom: none; }
.info-label {
    width: 120px;
    min-width: 120px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 13px;
}
.info-value { flex: 1; color: var(--text-primary); }

/* ================================================================
   탭
   ================================================================ */
.nav-tabs .nav-link {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    border: none;
    border-bottom: 2px solid transparent;
    padding: 10px 20px;
    margin-bottom: -2px;
    transition: all 0.15s;
}
.nav-tabs .nav-link:hover {
    color: var(--primary);
}
.nav-tabs .nav-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
    background: none;
}

/* ================================================================
   빈 상태
   ================================================================ */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-secondary);
}
/* §1.2 빈 상태 행은 충분한 높이(고정 px)로 — 그리드가 쪼그라들지 않게. padding !important 대비 특정도 확보 */
.table tbody td.empty-state { height: 200px; }

/* §2.10 그리드 표준 컬럼: 순번(내림차순)·체크박스(전체선택)·정렬변경 드래그 */
.table th.col-seq, .table td.col-seq { max-width: 76px !important; padding-left: 8px; padding-right: 8px; text-align: center; color: var(--text-secondary); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }   /* 고정폭 X, 최대 너비만(5자리). 보조정보라 작고 흐리게(11px·slate) — §2.10 */
.table th.col-check, .table td.col-check { width: 40px; text-align: center; }
.grid-row-check, .grid-check-all { cursor: pointer; width: 15px; height: 15px; vertical-align: middle; }
.table th.col-drag, .table td.col-drag { width: 36px; text-align: center; color: var(--text-muted); }
.table td.col-drag { cursor: grab; }
.table td.col-drag:active { cursor: grabbing; }
.table tbody tr.dragging td { opacity: .55; background: var(--primary-light) !important; }

/* §2.5 컬럼 너비 조절(리사이즈 핸들 + 구분선) + 헤더 드래그 순서변경 */
.table thead th.col-movable { position: relative; border-right: 1px solid var(--border); }
.col-resizer { position: absolute; top: 0; right: -4px; width: 8px; height: 100%; cursor: col-resize; user-select: none; z-index: 3; }
body.col-resizing { cursor: col-resize !important; user-select: none; }
.table thead th.th-dragging { opacity: .5; }
.empty-state i {
    font-size: 40px;
    margin-bottom: 12px;
    opacity: 0.4;
}
.empty-state p {
    font-size: 14px;
}

/* ================================================================
   로딩
   ================================================================ */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.6);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
.loading-overlay.show { display: flex; }

/* ================================================================
   서버 모니터링
   ================================================================ */
.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
}
.status-dot.up { background: var(--success); }
.status-dot.down { background: var(--danger); }
.status-dot.skipped { background: #9e9e9e; }

.log-viewer {
    background: #1e1e1e;
    color: #d4d4d4;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    padding: 16px;
    border-radius: var(--radius);
    height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.6;
}

/* ================================================================
   로그인 페이지
   ================================================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
}

/* 로그인 화면 좌측 하단 버전 */
.login-version {
    position: fixed;
    left: 18px;
    bottom: 14px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .02em;
    color: var(--text-secondary);
    opacity: .65;
}

.login-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(37,99,235,.12);
    padding: 48px 40px;
    width: 100%;
    max-width: 400px;
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo h1 {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary);
    margin: 0;
}

.login-logo p {
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: 4px;
}

.login-form .form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.login-form .form-control {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 14px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.login-form .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
    outline: none;
}

.login-btn {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    background: var(--primary);
    border: none;
    color: #fff;
    cursor: pointer;
    transition: background 0.15s;
}

.login-btn:hover {
    background: var(--primary-dark);
}

/* ================================================================
   반응형
   ================================================================ */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .sidebar-overlay.show {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }

    .page-body {
        padding: 16px;
    }

    .top-header {
        padding: 12px 16px;
    }

    .hamburger-btn {
        display: flex !important;
    }

    .search-bar .form-control,
    .search-bar .form-select {
        max-width: 100%;
    }
}

/* ================================================================
   추가 스타일 — 관리자 UI 개선
   ================================================================ */

/* 사이드바 섹션 구분 강화 */
.sidebar-nav .nav-section-title {
    margin-top: 20px;
    padding: 12px 24px 6px;
    font-size: 10px;
    font-weight: 700;
    color: #94A3B8;
    letter-spacing: .12em;
    text-transform: uppercase;
    border-top: 1px solid rgba(255,255,255,.06);
}
.sidebar-nav .nav-section-title:first-child {
    border-top: none;
    margin-top: 8px;
}

/* 테이블 행 호버 강조 (클릭 가능한 행) */
.table-clickable tbody tr {
    cursor: pointer;
    transition: background 0.15s;
}

/* 패널 수정버튼 hover 시만 표시 */
.panel-list-item .btn { opacity: 0; transition: opacity 0.15s; }
.panel-list-item:hover .btn { opacity: 1; }

/* 프로필 이미지 */
.profile-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-light);
    background: var(--bg);
}
.profile-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    flex-shrink: 0;
}

/* 상세 카드 레이아웃 */
.detail-card {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid var(--border);
}
.detail-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.detail-header-info {
    flex: 1;
    min-width: 0;
}
.detail-header-id {
    flex-shrink: 0;
    font-size: 12px;
    color: var(--text-secondary);
}
.detail-header-id code {
    color: var(--text-secondary);
    font-size: 11px;
}
.detail-header-info h5 {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 4px 0;
}
.detail-header-info p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}
.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;   /* 그리드 셀이 컨텐츠보다 좁아질 수 있게 → 긴 값이 옆 칸으로 안 넘침 */
}
.detail-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: .03em;
}
.detail-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    word-break: break-word;
    overflow-wrap: anywhere;   /* 긴 이메일/주소 등 셀 안에서 줄바꿈 */
}
code {
    color: inherit;
}

/* 섹션 제목 (왼쪽 accent bar) */
.section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    padding-left: 12px;
    border-left: 3px solid var(--primary);
    margin: 24px 0 16px;
}
.section-title:first-child,
.section-title.mt-0 {
    margin-top: 0;
}

/* 모달 요약 영역 */
.modal-summary {
    background: var(--bg-light);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 16px 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-summary .summary-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}
.modal-summary .summary-sub {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
    flex-shrink: 0;
}
.modal-summary .summary-sub code {
    color: var(--text-secondary);
    font-size: 11px;
}

/* 3-panel 레이아웃 (시술 메뉴) */
.three-panel {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
}
@media (max-width: 992px) {
    .three-panel { grid-template-columns: 1fr; }
}
.panel-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}
.panel-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg);
    border-radius: var(--radius) var(--radius) 0 0;
    flex-shrink: 0;
}
.panel-body {
    max-height: 500px;
    overflow-y: auto;
    flex: 1;
}
.panel-list-item {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.1s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}
.panel-list-item:last-child { border-bottom: none; }
.panel-list-item:hover { background: var(--primary-light); }
.panel-list-item.active {
    background: var(--primary-light);
    border-left: 3px solid var(--primary);
    color: var(--primary);
    font-weight: 600;
}
.panel-list-item .item-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.15s;
}
.panel-list-item:hover .item-actions { opacity: 1; }

/* 이미지 썸네일 */
.img-thumbnail-wrap {
    display: inline-block;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin: 4px;
}
.img-thumbnail-wrap img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    display: block;
}

/* 콤보박스 */
.combo-box { position: relative; }
.combo-box .combo-input { padding-right: 32px; cursor: text; }
.combo-box .combo-arrow {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-secondary);
    font-size: 12px;
}
.combo-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1060;
    margin-top: 2px;
}
.combo-dropdown.show { display: block; }
.combo-item {
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.1s;
}
.combo-item:hover { background: var(--primary-light); color: var(--primary); }
.combo-item.selected { background: var(--primary); color: #fff; }

/* 모달 드래그 */
.modal-header { cursor: move; }
.modal-dialog.dragging { transition: none !important; }

/* 모달 수직 정중앙 */
.modal-dialog {
    display: flex;
    align-items: center;
    min-height: calc(100% - 3.5rem);
}

/* 패널 드래그 정렬 */
.panel-list-item .drag-handle {
    cursor: grab;
    color: var(--text-secondary);
    margin-right: 8px;
    font-size: 12px;
}
.panel-list-item.dragging { opacity: 0.4; }
.panel-list-item.drag-over-top { border-top: 2px solid var(--primary); padding-top: 8px; }
.panel-list-item.drag-over-bottom { border-bottom: 2px solid var(--primary); padding-bottom: 8px; }

/* Toast UI Editor (배너 내용 등) — ADMIN_PAGE_RULE §1.5 */
.toastui-editor-defaultUI { border-radius: var(--radius-sm); border-color: var(--border); }
.toastui-editor-defaultUI .ProseMirror { font-size: 14px; }

/* ── 시술 메뉴 상세 팝업 ── */
.menu-detail-gallery { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 16px; }
.menu-detail-img { width: 120px; height: 120px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); flex-shrink: 0; }
.menu-detail-price-card { background: var(--primary-light); border-radius: var(--radius-sm); padding: 16px; margin-bottom: 12px; text-align: center; }
.menu-detail-original-price { font-size: 0.85rem; color: var(--text-muted); text-decoration: line-through; margin-bottom: 2px; }
.menu-detail-sale-row { display: flex; align-items: center; justify-content: center; gap: 8px; }
.menu-detail-discount { font-size: 1.25rem; font-weight: 700; color: #ef4444; }
.menu-detail-sale-price { font-size: 1.25rem; font-weight: 700; color: var(--text-dark); }
.menu-detail-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.menu-detail-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; font-size: 0.8rem; border-radius: 999px; background: var(--bg-light); border: 1px solid var(--border); color: var(--text-secondary); }
.menu-detail-desc { margin-top: 0; padding: 16px; background: var(--bg-light); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.menu-detail-desc-text { font-size: 0.9rem; line-height: 1.7; color: var(--text-dark); white-space: pre-wrap; }

/* ── 캐로셀 이미지 ── */
.carousel-detail-img { max-height: 300px; max-width: 100%; object-fit: contain; border-radius: var(--radius-sm); }
.carousel-indicators [data-bs-target] { background-color: var(--primary); }
.carousel-control-prev-icon,
.carousel-control-next-icon { background-color: rgba(0,0,0,.4); border-radius: 50%; padding: 12px; background-size: 50%; }
.carousel { border-radius: var(--radius-sm); background: var(--bg-light); }

/* ================================================================
   콤보박스 (input + dropdown)
   combobox.js 가 select.form-select / select.filter-input 을 자동 변환
   ================================================================ */
.combobox {
    position: relative;
    display: inline-flex;
    align-items: center;
}
/* 편집 폼(row g-3) 내 콤보박스는 form-control 처럼 전체 폭으로 정렬 (인풋과 가로 정렬 통일) */
.row.g-3 .combobox {
    display: flex;
    width: 100%;
}
.row.g-3 .combobox .combobox-input {
    flex: 1 1 auto;
    width: 100%;
}
.combobox-input {
    cursor: pointer;
    padding-right: 32px;
    user-select: none;
    -webkit-user-select: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px 10px;
}
.combobox.combobox-open .combobox-input {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.combobox-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    min-width: 100%;
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 20px rgba(0, 0, 0, .08);
    max-height: 280px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 1050;
    padding: 4px 0;
}
.combobox.combobox-open .combobox-dropdown { display: block; }
.combobox-item {
    padding: 9px 14px;
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--text-dark);
    white-space: nowrap;
    line-height: 1.4;
}
.combobox-item:hover { background: rgba(37, 99, 235, .06); }
.combobox-item-active { background: rgba(37, 99, 235, .12); }
.combobox-item-selected {
    background: rgba(37, 99, 235, .10);
    color: var(--primary);
    font-weight: 600;
}
.combobox-item-selected:hover { background: rgba(37, 99, 235, .14); }
@media (max-width: 768px) {
    .combobox { flex: 1 1 auto; }
    .combobox-input { width: 100%; min-height: 40px; font-size: 0.9rem; }
    .combobox-item { padding: 11px 14px; font-size: 0.9rem; min-height: 42px; }
}
.combobox-empty {
    padding: 12px 14px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: center;
}

/* ================================================================
   워크스페이스 탭 셸 (ADMIN_PAGE_RULE §2.13)
   - 셸: 사이드바(유지) + 탭헤더 + iframe 패널 영역
   - 임베드: iframe 안/?embed=1 → html.embed 로 크롬 숨김(컨텐츠만)
   ================================================================ */

/* ── 임베드 모드 (iframe 안에서 컨텐츠만) ───────────────── */
html.embed .sidebar,
html.embed .sidebar-edge-toggle,
html.embed .sidebar-overlay,
html.embed .top-header,
html.embed .hamburger-btn { display: none !important; }
html.embed .main-content { margin-left: 0 !important; }

/* ── 셸 레이아웃 ─────────────────────────────────────── */
.ws-shell {
    height: 100vh;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ws-header {
    display: flex;
    align-items: stretch;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    height: 46px;
    flex-shrink: 0;
}
.ws-header .hamburger-btn { display: none; align-self: center; margin: 0 8px; }
@media (max-width: 728px) { .ws-header .hamburger-btn { display: flex; } }

/* ── 탭바 (좌·중앙, 오버플로우 가로 슬라이드) ──────────── */
.ws-tabbar {
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    display: flex;
    align-items: stretch;
    scrollbar-width: none;
    cursor: grab;              /* 드래그로 슬라이드 (모바일은 네이티브 스와이프) */
    user-select: none;
    -webkit-overflow-scrolling: touch;
}
.ws-tabbar::-webkit-scrollbar { height: 0; width: 0; }
.ws-tabbar.is-dragging,
.ws-tabbar.is-dragging * { cursor: grabbing !important; }
.ws-tabs { display: flex; align-items: stretch; }

.ws-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px 0 14px;
    max-width: 220px;
    border-right: 1px solid var(--border);
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    position: relative;
    transition: background .12s, color .12s;
}
/* ✕(닫기) 없는 탭(마지막 1탭 등) = 좌우 패딩 대칭 — ✕ 자리 비대칭으로 제목 쏠림 방지 (§2.13) */
.ws-tab:not(:has(.ws-tab-close)) { padding-right: 14px; }
.ws-tab:hover { background: var(--bg); }
.ws-tab.is-active { background: #fff; color: var(--text-primary); font-weight: 600; }
.ws-tab.is-active::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0;
    height: 2px; background: var(--primary);
}
.ws-tab.is-shown:not(.is-active) { color: var(--text-primary); }   /* 분할로 보이는 다른 패널 탭 */
.ws-tab-title { overflow: hidden; text-overflow: ellipsis; }
.ws-tab-home { font-size: 11px; color: var(--text-secondary); }
.ws-tab.is-active .ws-tab-home { color: var(--primary); }
.ws-tab-close {
    border: 0; background: transparent; color: var(--text-secondary);
    width: 18px; height: 18px; border-radius: 4px; padding: 0;
    display: flex; align-items: center; justify-content: center; font-size: 11px; line-height: 1;
}
.ws-tab-close:hover { background: var(--danger-light); color: var(--danger); }

/* ── 탭 컨트롤 ───────────────────────────────────────── */
.ws-controls { display: flex; align-items: center; gap: 2px; flex-shrink: 0; padding: 0 6px; border-left: 1px solid var(--border); }
.ws-controls button {
    width: 30px; height: 30px; border: 0; background: transparent;
    color: var(--text-secondary); border-radius: 6px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; font-size: 13px;
}
.ws-controls button:hover { background: var(--bg); color: var(--text-primary); }
.ws-controls button:disabled { opacity: .35; cursor: default; }
.ws-controls button.is-on { background: var(--primary-light); color: var(--primary); }
.ws-ctrl-sep { width: 1px; height: 18px; background: var(--border); margin: 0 4px; }
@media (max-width: 728px) {
    .ws-controls [data-act="splitLR"],
    .ws-controls [data-act="splitTB"],
    .ws-controls [data-act="closeOthers"] { display: none; }
}

.ws-header .ws-user { flex-shrink: 0; align-self: center; padding: 0 16px 0 10px; border-left: 1px solid var(--border); }

/* ── 패널 영역 (탭당 iframe 1개) ─────────────────────── */
.ws-panes { flex: 1 1 auto; min-height: 0; display: flex; background: var(--bg); }
.ws-panes.dir-tb { flex-direction: column; }
.ws-pane { display: none; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; }
.ws-pane.is-single { flex: 1 1 100%; }
.ws-panes.mode-split .ws-pane { flex: 1 1 50%; }
.ws-panes.dir-lr .ws-pane.is-paneB { border-left: 2px solid var(--border); }
.ws-panes.dir-tb .ws-pane.is-paneB { border-top: 2px solid var(--border); }
.ws-frame { flex: 1 1 auto; width: 100%; height: 100%; border: 0; display: block; background: #fff; }

/* 분할 시에만 보이는 패널 헤더 (제목 클릭 → 다른 탭으로 교체) */
.ws-pane-head { display: none; }
.ws-panes.mode-split .ws-pane-head {
    display: flex; align-items: center; height: 30px; padding: 0 8px;
    background: var(--card-bg); border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.ws-pane.is-focus .ws-pane-head { box-shadow: inset 0 -2px 0 var(--primary); }
.ws-pane-title {
    border: 0; background: transparent; font-size: 12px; font-weight: 600;
    color: var(--text-primary); display: flex; align-items: center; gap: 6px;
    cursor: pointer; padding: 2px 6px; border-radius: 4px;
}
.ws-pane-title:hover { background: var(--bg); }
.ws-pane-title i { font-size: 10px; color: var(--text-secondary); }

/* ── 팝오버 (열린 탭 목록 / 패널 교체 / 우클릭) ─────────── */
.ws-pop {
    position: fixed; z-index: 1200; background: #fff;
    border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-md);
    min-width: 200px; max-height: 70vh; overflow: auto; padding: 4px;
}
.ws-pop-row {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 7px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--text-primary);
}
.ws-pop-row:hover { background: var(--bg); }
.ws-pop-row.is-active { color: var(--primary); font-weight: 600; background: var(--primary-light); }
.ws-pop-row.is-disabled { color: var(--text-secondary); opacity: .5; cursor: default; }
.ws-pop-label { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-pop-x { border: 0; background: transparent; color: var(--text-secondary); width: 22px; height: 22px; border-radius: 4px; flex-shrink: 0; }
.ws-pop-x:hover { background: var(--danger-light); color: var(--danger); }

/* ================================================================
   사이드바 2뎁스 메뉴 (ADMIN_PAGE_RULE §2.8 ⑦)
   0뎁스(.nav-group) / 1뎁스(.nav-leaf | .nav-parent) / 2뎁스(.nav-sub)
   ================================================================ */
.sidebar-nav { padding: 8px 0 56px; }   /* 하단 여유 — 맨 아래 메뉴(로그아웃 등)가 뷰포트 끝에 붙지 않게 */
.nav-group + .nav-group { margin-top: 2px; border-top: 1px solid rgba(255,255,255,.05); }

/* 공통 행 (그룹헤더 / 부모헤더 / 리프) — 글씨 크기 통일(14px) */
.nav-group-head,
.nav-parent-head,
.sidebar-nav .nav-leaf {
    display: flex; align-items: center; gap: 8px;
    width: 100%; border: 0; background: transparent; text-align: left;
    color: #94A3B8; font-size: 14px; font-family: inherit; line-height: 1.3;
    text-decoration: none; cursor: pointer;
    transition: background .12s, color .12s;
}
.nav-group-head:hover,
.nav-parent-head:hover,
.sidebar-nav .nav-leaf:hover { background: rgba(255,255,255,.06); color: #CBD5E1; }

/* 라벨: 말줄임 (§2.8 ⑦) */
.nav-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 꺽쇠 — 자식 있는 0/1뎁스에만. 열리면 회전(▸→▾) */
.nav-caret { flex: 0 0 12px; width: 12px; font-size: 10px; color: #64748B; text-align: center; transition: transform .15s; }
.nav-group.is-open > .nav-group-head .nav-caret,
.nav-parent.is-open > .nav-parent-head .nav-caret { transform: rotate(90deg); }

/* 뎁스별 들여쓰기 — 단계적으로 확실히 (0 < 1 < 2). 1뎁스 부모는 꺽쇠가 라벨을 ~16px 밀어내므로, 2뎁스는 그보다 더 깊게 잡아야 단계가 보인다 */
.nav-group-head { padding: 9px 16px; font-weight: 700; color: #CBD5E1; }   /* 0뎁스: 16px (꺽쇠+라벨) */
.sidebar-nav .nav-leaf { padding: 8px 16px 8px 30px; }   /* 1뎁스 리프: 30px */
.nav-parent-head { padding: 8px 16px 8px 30px; }          /* 1뎁스 부모: 30px (꺽쇠 때문에 라벨은 ~46px) */
.sidebar-nav .nav-parent .nav-leaf.nav-sub { padding-left: 64px !important; }   /* 2뎁스: 64px — 1뎁스 부모 라벨(~46px)보다 확실히 깊게 */

/* 접힘/펼침 */
.nav-group-body, .nav-parent-body { display: none; }
.nav-group.is-open > .nav-group-body { display: block; }
.nav-parent.is-open > .nav-parent-body { display: block; }

/* 활성(현재 탭) 리프 하이라이트 — 좌측 액센트 인셋 바 + 굵게 + 밝은 라벨 (§2.8 ⑧) */
.sidebar-nav .nav-leaf.active {
    background: rgba(37,99,235,.18); color: #60A5FA; font-weight: 600;
    border-left: 0; box-shadow: inset 3px 0 0 #2563EB;
}

/* 메뉴 컨트롤 바 (§2.8 ⑦) — nav 스크롤 밖·로고 아래 고정, 버튼 우측 정렬 */
.sidebar-menu-ctrl {
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: flex-end; gap: 2px;
    padding: 4px 10px;
    border-bottom: 1px solid rgba(255,255,255,.06);
}
.menu-ctrl-sep { width: 1px; height: 14px; background: rgba(255,255,255,.14); margin: 0 4px; flex-shrink: 0; }
.menu-ctrl-btn {
    width: 28px; height: 26px; border: 0; background: transparent;
    color: #64748B; border-radius: 5px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; font-size: 12px;
    transition: background .12s, color .12s;
}
.menu-ctrl-btn:hover { background: rgba(255,255,255,.08); color: #CBD5E1; }
html.embed .sidebar-menu-ctrl { display: none !important; }

/* 커스텀 사이드바 툴팁 (§2.8 ⑦ — 네이티브 title 대체, 즉시 표시) */
.ws-tip {
    position: fixed; z-index: 1300; display: none;
    background: #fff; color: var(--primary); font-size: 12px; font-weight: 600;
    padding: 5px 9px; border-radius: 6px; white-space: nowrap;
    pointer-events: none; box-shadow: 0 4px 12px rgba(0,0,0,.15);
    border: 1px solid var(--primary);
}

/* 그리드 셀 말줄임 커스텀 툴팁 (§2.5) — 네이티브 title 대체. 말줄임 셀에만(JS), 긴 내용은 줄바꿈 허용 */
.grid-tip {
    position: fixed; z-index: 1300; display: none;
    background: #fff; color: var(--primary); font-size: 12px; font-weight: 600;
    padding: 5px 9px; border-radius: 6px;
    max-width: 420px; white-space: normal; word-break: break-all;
    pointer-events: none; box-shadow: 0 4px 12px rgba(0,0,0,.15);
    border: 1px solid var(--primary);
}

/* ================================================================
   탭 바 외관 — 다크 톤 시각 표준 (ADMIN_PAGE_RULE §2.13, 포스트링 세션 추가분 반영)
   탭 바 = 사이드바 연장(다크). 비활성=다크+흐림 / 활성=본문과 동일한 밝은 배경(대비로 강조).
   ================================================================ */
.ws-header { background: #1E293B; border-bottom: 0; }

.ws-tabs { gap: 3px; } /* 탭 사이 미세 간격(첫 탭은 left 0 유지) — 라운드 코너가 보이게 */
.ws-tab { color: #94A3B8; border-right: 0; border-radius: 8px 8px 0 0; } /* 상단만 라운드(폴더 탭) */
.ws-tab:hover { background: rgba(255,255,255,.06); color: #CBD5E1; }
/* 활성 탭 = 컨텐츠 바디(var(--bg))와 동일한 밝은 배경 → 본문과 이어짐 (파란 액센트 없음) */
.ws-tab.is-active {
    background: var(--bg); color: var(--text-primary); font-weight: 600;
}
.ws-tab.is-active::after { display: none; } /* 기존 하단 밑줄 제거 — 강조는 다크↔라이트 대비 */
.ws-tab.is-shown:not(.is-active) { color: #CBD5E1; }
.ws-tab-home { color: #64748B; }
.ws-tab.is-active .ws-tab-home { color: var(--primary); }
.ws-tab-close { color: #94A3B8; }
.ws-tab-close:hover { background: rgba(239,68,68,.28); color: #fff; }
.ws-tab.is-active .ws-tab-close { color: var(--text-secondary); }
.ws-tab.is-active .ws-tab-close:hover { background: var(--danger-light); color: var(--danger); }

/* 컨트롤/프로필 — 다크 헤더에 맞춰 밝은 아이콘 */
.ws-controls { border-left: 1px solid rgba(255,255,255,.08); }
.ws-controls button { color: #94A3B8; }
.ws-controls button:hover { background: rgba(255,255,255,.08); color: #fff; }
.ws-controls button.is-on { background: rgba(37,99,235,.28); color: #93C5FD; }
.ws-ctrl-sep { background: rgba(255,255,255,.14); }
.ws-header .ws-user { color: #CBD5E1; border-left: 1px solid rgba(255,255,255,.08); }

/* 첫 탭 좌측 = 컨텐츠 영역 시작선(좌측 패딩 0) + 탭 묶음 위 약간의 여백(헤더 최상단에 안 붙게) */
.ws-header { height: 50px; }
.ws-tabbar { padding-left: 0; padding-top: 6px; }
