/* ======================================================================
   app.css — artmarket 관리자 껍데기만. 그리드 키트(cgrid.css)와 섞지 않는다.
   사이드바 / 사이드바 메뉴 계층 / 대시보드 / 로그인
   ====================================================================== */
/* ---------- 사이드바 접기/펼치기 (§2.8 ⑤) ---------- */
#adminSidebar { transition: margin-left .2s ease; }
body.sidebar-collapsed #adminSidebar { margin-left: -15rem; }   /* w-60 = 15rem 슬라이드 아웃 */
/* 가장자리 핸들: 펼침=사이드바 경계(좌측만 둥글게, 어두운 탭+흰 화살표) / 접힘=화면 왼쪽 끝(우측만 둥글게, 흰 배경+검은 화살표) */
#sidebarHandle { left: calc(15rem - 24px); border-radius: 8px 0 0 8px; box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
    background: #1e293b !important; color: #ffffff !important; transition: left .2s ease, background .2s ease, color .2s ease; }
#sidebarHandle svg { display: block; transition: transform .2s ease; }
body.sidebar-collapsed #sidebarHandle { left: 0; border-radius: 0 8px 8px 0; background: #ffffff !important; color: #111827 !important; border: 1px solid #e2e8f0; }
body.sidebar-collapsed #sidebarHandle svg { transform: scaleX(-1); }   /* 닫힘 = 오른쪽(›) 화살표 */

/* 사이드바 메뉴 스크롤바: 얇고 은은하게(다크 배경) */
#adminSidebar nav { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .2) transparent; padding-bottom: 48px; }   /* §2.8⑦ 하단 여유 — 맨 아래 메뉴/그룹 펼침 공간 */
#adminSidebar nav::-webkit-scrollbar { width: 6px; }
#adminSidebar nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .18); border-radius: 3px; }
#adminSidebar nav::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .32); }
#adminSidebar nav::-webkit-scrollbar-track { background: transparent; }
/* 본문 스크롤바: 얇게 */
main { scrollbar-width: thin; scrollbar-color: rgba(100, 116, 139, .35) transparent; }
main::-webkit-scrollbar { width: 8px; }
main::-webkit-scrollbar-thumb { background: rgba(100, 116, 139, .3); border-radius: 4px; }
main::-webkit-scrollbar-thumb:hover { background: rgba(100, 116, 139, .5); }
main::-webkit-scrollbar-track { background: transparent; }

/* ---------- 사이드바 메뉴 계층 (§2.8 ⑦: 0뎁스 그룹 / 1뎁스 리프) ---------- */
.nav-link, .nav-group-head { display: flex; align-items: center; gap: 6px; width: 100%; font-size: 14px; color: #cbd5e1; line-height: 1.2; text-align: left; }
.nav-group-head { padding: 10px 16px; }                  /* 1뎁스 그룹: 라벨 16px (꺽쇠 우측) */
.nav-top { padding: 10px 16px; }                          /* 1뎁스 독립 리프(대시보드): 그룹헤더와 동일 16px (꺽쇠 우측 이동) */
.nav-leaf { padding: 9px 16px 9px 36px; }                /* 2뎁스 리프: 1뎁스(16) + 20 들여쓰기 */
.nav-link:hover, .nav-group-head:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-link.is-active { background: #1e293b; color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 0 #10b981; }
.nav-link.is-active .nav-label { color: #fff; }
.nav-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }   /* 말줄임 */
/* 꺽쇠 = 행 오른쪽 끝(ADMIN_PAGE_RULE §2.8⑦) */
.nav-chevron { order: 9; margin-left: auto; width: 14px; height: 14px; flex-shrink: 0; transition: transform .15s; color: #64748b; }
.nav-mini-btn { width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; color: #94a3b8; }
.nav-mini-btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav-mini-btn svg { width: 16px; height: 16px; }
.nav-group.is-open > .nav-group-head .nav-chevron { transform: rotate(90deg); }
.nav-group-body { display: none; }
.nav-group.is-open > .nav-group-body { display: block; }
/* 커스텀 툴팁 (네이티브 title 금지, 지연 0) */
.nav-tooltip { position: fixed; z-index: 200; transform: translateY(-50%); background: #fff; color: var(--primary); border: 1px solid var(--primary); font-size: 12px;
    padding: 4px 9px; border-radius: 6px; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .07s; box-shadow: 0 4px 14px rgba(0, 0, 0, .35); }
.nav-tooltip.show { opacity: 1; }
/* §2.5 그리드 셀 말줄임 커스텀 툴팁 (커서 추종, 긴 내용은 줄바꿈) */
.admin-celltip { position: fixed; z-index: 200; transform: translateY(-50%); background: #fff; color: var(--primary); border: 1px solid var(--primary); font-size: 12px;
    padding: 5px 9px; border-radius: 6px; max-width: 60vw; white-space: normal; word-break: break-word; line-height: 1.4;
    pointer-events: none; opacity: 0; transition: opacity .07s; box-shadow: 0 4px 14px rgba(0, 0, 0, .35); }
.admin-celltip.show { opacity: 1; }
/* .admin-tip 은 키트(cgrid.css)가 정한다 — 여기서 바깥 상자에 바탕·테두리를 다시 입히면 툴팁이 두 겹이 된다(2026-10-02 제거) */

/* ============================================================
   colon-money 추가분 — 공통 컴포넌트(§1.6 atom/molecule) 확장
   화면 JTE 에 인라인 <style> 을 두지 않기 위해 전부 여기에 둔다.
   ============================================================ */

/* ---------- 대시보드 ---------- */

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; display: block; transition: all .15s; }
a.stat-card:hover { background: var(--primary); border-color: var(--primary); }
a.stat-card:hover .stat-label, a.stat-card:hover .stat-value, a.stat-card:hover .stat-sub { color: #fff; }
.stat-label { font-size: 12px; color: var(--text-secondary); font-weight: 600; display: flex; align-items: center; gap: 7px; }
.stat-label::before { content: ""; width: 4px; height: 13px; border-radius: 2px; background: var(--primary); }
.stat-value { font-size: 26px; font-weight: 800; color: var(--primary); line-height: 1.25; margin-top: 8px; }
.stat-value .unit { font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-left: 3px; }
.stat-sub { font-size: 11px; color: var(--text-secondary); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }   /* 설명은 한 줄 — 넘치면 … */
.panel { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.panel-head { padding: 13px 18px; border-bottom: 1px solid var(--border); font-size: 13px; font-weight: 700; color: var(--primary); display: flex; align-items: center; gap: 8px; }
.panel-head::before { content: ""; width: 4px; height: 14px; border-radius: 2px; background: var(--primary); }
.mini-table { width: 100%; border-collapse: collapse; }
.mini-table th { background: #f8fafc; font-size: 11px; font-weight: 600; color: var(--text-secondary); padding: 8px 14px; text-align: center; border-bottom: 1px solid var(--border); white-space: nowrap; }
.mini-table td { font-size: 12.5px; padding: 10px 14px; border-bottom: 1px solid var(--border); color: var(--text-primary); white-space: nowrap; }
.mini-table tr:last-child td { border-bottom: none; }
.mini-table tbody tr:hover td { background: var(--primary-light); }
/* 숫자는 자릿수가 세로로 맞아야 대소가 눈에 들어온다(tabular-nums) + 본문보다 크고 진하게 */
.mini-table td.num { text-align: right; font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.mini-table td.amt { font-size: 14.5px; font-weight: 700; color: var(--primary); letter-spacing: -.01em; }
.mini-table td.amt .cur { font-size: 10.5px; font-weight: 600; color: var(--text-secondary); margin-left: 2px; }
.mini-table td.cnt { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.mini-table td.cnt .unit { font-size: 10.5px; font-weight: 500; color: var(--text-secondary); margin-left: 1px; }
.mini-table td.ym { font-size: 12.5px; font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.mini-table td.amt.zero { color: var(--text-secondary); font-weight: 500; }   /* 0 은 눈에 덜 걸리게 */
.mini-empty { padding: 26px 14px; text-align: center; color: var(--text-secondary); font-size: 13px; }

/* ---------- 로그인 ---------- */
body:has(.login-wrap) { margin: 0; padding: 0; background: #0f172a; }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: #0f172a; position: relative; }
.login-card { width: 100%; max-width: 360px; background: #fff; border-radius: 16px; padding: 34px 30px 30px; box-shadow: 0 20px 60px rgba(0, 0, 0, .45); }
.login-logo { font-size: 21px; font-weight: 800; color: #0f172a; letter-spacing: -.02em; text-align: center; }
.login-logo span { color: #64748b; font-weight: 700; }
.login-form { margin-top: 24px; display: flex; flex-direction: column; gap: 10px; }
.login-form .filter-input { height: 44px; font-size: 14px; }
.login-form .btn { height: 44px; justify-content: center; font-size: 14px; }
.login-error { font-size: 12.5px; color: var(--danger); font-weight: 600; text-align: center; }
/* Caps Lock 경고 — 오류 문구(빨강)와 **다른 색**을 쓴다. 이건 '틀렸다'가 아니라
   '이대로 치면 틀린다'는 예고라서, 같은 빨강이면 이미 실패한 것으로 읽힌다. */
.login-caps {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    margin: 0; padding: 7px 10px;
    font-size: 12.5px; font-weight: 600; color: #b45309;
    background: #fffbeb; border: 1px solid #fde68a; border-radius: var(--radius-sm);
}
/* ⚠️ footgun: `display:flex` 는 브라우저 기본 `[hidden]{display:none}` 을 **이긴다**
   (작성자 스타일이 UA 스타일보다 우선). 숨김을 명시하지 않으면 늘 켜진 것처럼 보인다. */
.login-caps[hidden] { display: none; }
.login-version { position: fixed; left: 16px; bottom: 12px; font-size: 11px; color: rgba(255, 255, 255, .45); }

/* 모바일: 사이드바 = 오프캔버스 드로어 (키트가 아니라 앱 껍데기다) */
@media (max-width: 768px) {
    /* ----- 사이드바 = 오프캔버스 드로어 ----- */
    #adminSidebar { position: fixed; left: 0; top: 0; bottom: 0; height: 100%; z-index: 60; margin-left: 0 !important; transform: translateX(0); transition: transform .22s ease; }
    body.sidebar-collapsed #adminSidebar { transform: translateX(-100%); }
    #sidebarBackdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 55; opacity: 0; pointer-events: none; transition: opacity .2s ease; }
    body:not(.sidebar-collapsed) #sidebarBackdrop { opacity: 1; pointer-events: auto; }

    /* 모바일: 가장자리 핸들 대신 우하단 햄버거 FAB */
    #sidebarHandle { display: none; }
    #sidebarFab {
        display: flex; align-items: center; justify-content: center;
        position: fixed; right: 16px; bottom: 16px; z-index: 65;
        width: 52px; height: 52px; border-radius: 50%; border: none; cursor: pointer;
        background: #111827; color: #fff; box-shadow: 0 6px 20px rgba(0, 0, 0, .3);
    }
    #sidebarFab:active { transform: scale(.94); }
}

/* 데스크탑에서는 오프캔버스 보조요소를 숨긴다(가장자리 핸들 사용) */
#sidebarBackdrop { display: none; }
#sidebarFab { display: none; }

/* 모달 폼 — 여백은 모달 본문(p-6) 하나만. 폼 맨 앞의 hidden id 때문에 space-y-4 가 첫 섹션 위에 16px 을 더 얹던 것을 뺀다 */
.cg-modal-body form.space-y-4 > .form-grid { margin-top: 0; }
.cg-modal-body form.space-y-4 > .form-error + .form-grid { margin-top: 12px; }
/* 텍스트에어리어(비고·내용 상세) 칸은 언제나 한 줄 전체 — 템플릿에서 col-full 을 빠뜨려도 여기서 맞춘다 */
.form-grid .field:has(> textarea) { grid-column: 1 / -1; }
/* 섹션 띠 앞뒤 간격 축소 — 키트 기본(위 16px + 줄간격 14px = 30px)은 팝업에서 휑하다 → 위 18px · 아래 10px */
.form-grid .form-section { margin: 4px 0 -4px; }
.form-grid .form-section:first-child { margin-top: 0; }
/* 폼 라벨 앞 막대는 연하게 — 섹션 띠(진한 막대)와 위계를 가른다. 검색카드 라벨 막대는 그대로 */
.form-grid .field-label::before { background: #94a3b8; }


/* ============================================================
   artmarket 추가분
   ============================================================ */
/* 브랜드 — 관리자 사이드바 로고·로그인 로고는 쇼핑몰 텍스트 로고(Black Han Sans, ART + 주황 MARKET)와 같은 톤 */
:root { --brand-ink: #111111; --brand-accent: #FF5A36; }
.brand-word { font-family: 'Black Han Sans', 'Noto Sans KR', sans-serif; font-weight: 400; letter-spacing: -.01em; }
.brand-word .accent { color: var(--brand-accent); }
.sb-brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; }
.sb-brand img { width: 26px; height: 26px; border-radius: 7px; box-shadow: 0 0 0 1px rgba(255,255,255,.12); }
.sb-brand .brand-word { font-size: 19px; color: #fff; }
.sb-brand .sb-admin { font-family: 'Noto Sans KR', sans-serif; font-size: 11px; font-weight: 700; color: #94a3b8; letter-spacing: .08em; margin-left: 2px; }
.login-logo { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.login-logo img { width: 48px; height: 48px; border-radius: 13px; }
.login-logo .brand-word { font-size: 26px; color: var(--brand-ink); }
.login-logo .login-sub { font-size: 12px; font-weight: 700; color: #64748b; letter-spacing: .12em; }
.nav-link.is-active { box-shadow: inset 3px 0 0 0 var(--brand-accent); }
/* 사이트 보기 — 사이드바 최하단 고정(§2.8 ③) */
.sb-site { display: block; text-align: center; font-size: 12px; padding: 8px 0; border-radius: 6px; background: #1e293b; color: #e2e8f0; }
.sb-site:hover { background: #334155; }
/* 상품 목록 썸네일(키트 thumb 셀) — 작품은 정사각 크롭 */
.data-table img.thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; background: #f1f5f9; }
/* 상품 팝업 — 이미지 미리보기 */
.img-preview { width: 120px; height: 120px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); background: #f8fafc; }
.field-row { display: flex; gap: 12px; align-items: flex-start; }
.field-row > .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.check-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-primary); margin-right: 16px; }
/* 대시보드 소제목 */
.panel-title-sm { font-size: 13px; font-weight: 700; color: var(--text-secondary); margin-bottom: -8px; }
/* 주문 상세 팝업 — 주문 상품 표 */
.order-items { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.order-items .oi-name { display: inline-flex; align-items: center; gap: 10px; }
.order-items .oi-name img { width: 36px; height: 36px; object-fit: cover; border-radius: 6px; background: #f1f5f9; }
