/* ==========================================
   UCOPH Admin Design System
   - 블랙 사이드바 + 따뜻한 중립 캔버스
   - 포인트 컬러: 오일 앰버 (활성 메뉴, 관리자 뱃지에만 사용)
   ========================================== */
:root {
    --ink:        #000000;   /* 사이드바 */
    --ink-raise:  #1a1a1a;   /* hover, 활성 메뉴 배경 */
    --ink-line:   #262626;   /* 구분선 */
    --ink-text:   #e9e5e5;   /* 메뉴 글자 */
    --canvas:     #f4f5f3;   /* 페이지 배경 */
    --surface:    #ffffff;
    --line:       #e3e6e2;
    --text:       #17211e;
    --muted:      #667470;
    --amber:      #e0a232;   /* 포인트 */
    --amber-soft: #fbf1db;
    --amber-deep: #8a5d0a;
    --green-soft: #e3f1e8;
    --green-deep: #1d6b45;
    --radius:     10px;
    --shadow:     0 1px 2px rgba(15, 28, 24, .04);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--canvas);
    color: var(--text);
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.01em;
}

:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

.icon { width: 18px; height: 18px; flex-shrink: 0; }

/* ---------- 레이아웃 ---------- */
.admin-container { display: flex; height: 100vh; overflow: hidden; }

/* ---------- 사이드바 ---------- */
.admin-sidebar {
    width: 248px; flex-shrink: 0;
    background: var(--ink); color: var(--ink-text);
    display: flex; flex-direction: column;
}
.sidebar-header {
    height: 68px; padding: 0 22px;
    display: flex; align-items: center; gap: 10px;
    border-bottom: 1px solid var(--ink-line);
}
.brand-logo { height: 26px; width: auto; display: block; }
.brand-sub  { margin-left: 2px; font-size: .8rem; font-weight: 500; color: var(--ink-text); }

.sidebar-menu { list-style: none; padding: 16px 12px; display: flex; flex-direction: column; gap: 2px; }
.sidebar-menu li a,
.menu-link-ghost {
    position: relative;
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px; border-radius: 8px;
    color: var(--ink-text); text-decoration: none;
    font-weight: 500; font-size: .93rem;
    transition: background-color .15s, color .15s;
}
.sidebar-menu li a:hover,
.menu-link-ghost:hover { background: var(--ink-raise); color: #fff; }

/* 활성 메뉴: 채우기 대신 앰버 인디케이터 바 */
.sidebar-menu li a.active { background: var(--ink-raise); color: #fff; font-weight: 600; }
.sidebar-menu li a.active::before {
    content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px;
    width: 3px; border-radius: 0 3px 3px 0; background: var(--amber);
}
.sidebar-menu li a.active .icon { color: var(--amber); }

/* 한글 + 영문 라벨 */
.menu-label { display: flex; flex-direction: column; line-height: 1.3; }
.menu-label small { font-size: .72rem; font-weight: 400; color: #737373; letter-spacing: 0; }
.sidebar-menu li a:hover .menu-label small,
.sidebar-menu li a.active .menu-label small,
.menu-link-ghost:hover .menu-label small { color: var(--ink-text); }

.sidebar-footer { margin-top: auto; padding: 12px; border-top: 1px solid var(--ink-line); }

/* ---------- 메인 ---------- */
.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow-y: auto; }
.admin-header {
    position: sticky; top: 0; z-index: 5;
    height: 68px; padding: 0 40px;
    flex-shrink: 0;            /* ← 이 줄 추가: 내용이 길어도 헤더 높이 그대로 */
    display: flex; align-items: center;
    background: rgba(255, 255, 255, .88);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
}
.admin-header h1 { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.02em; }
.admin-header h1 small { margin-left: 10px; font-size: .85rem; font-weight: 500; color: var(--muted); }
.admin-content { padding: 36px 40px 56px; width: 100%; max-width: 1360px; margin: 0 auto; flex: 1; }

/* 모바일 전용 요소 (데스크톱에서는 숨김) */
.nav-toggle { display: none; }
.sidebar-overlay { display: none; }

/* ---------- 통계 카드 ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-bottom: 28px; }
.stat-card {
    background: var(--surface); padding: 22px 24px;
    border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.stat-title { color: var(--muted); font-size: .85rem; font-weight: 500; }
.stat-value { margin-top: 10px; font-size: 1.9rem; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat-unit { margin-left: 4px; font-size: .95rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }

/* ---------- 패널 + 테이블 ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.panel-head {
    display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
    padding: 18px 24px; border-bottom: 1px solid var(--line);
}
.panel-title { font-size: 1rem; font-weight: 700; letter-spacing: -0.02em; }
.panel-meta { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }

.table-scroll { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; text-align: left; }
.admin-table th {
    padding: 12px 24px; white-space: nowrap;
    background: #fafbf9; border-bottom: 1px solid var(--line);
    color: var(--muted); font-size: .8rem; font-weight: 600;
}
.admin-table td { padding: 15px 24px; border-bottom: 1px solid #eef0ec; color: var(--text); font-size: .9rem; }
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table tbody tr { transition: background-color .12s; }
.admin-table tbody tr:hover { background: #fafbf9; }

/* 가입일(5번째 칸)과 최종 접속(6번째 칸)만 글자 크기 줄이기 */
.admin-table td:nth-child(5),
.admin-table td:nth-child(6) {
    font-size: 0.75rem; /* 원하는 크기로 조절 가능 (예: 0.75rem은 약 12px) */
}
.cell-num   { font-variant-numeric: tabular-nums; color: var(--muted); }
.cell-muted { color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- 뱃지 ---------- */
.badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 10px; border-radius: 9999px;
    font-size: .76rem; font-weight: 600;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-admin { background: var(--amber-soft); color: var(--amber-deep); }
.badge-user  { background: var(--green-soft); color: var(--green-deep); }

/* ---------- 상태 화면 (로딩 / 비어있음 / 오류) ---------- */
.state-box { padding: 56px 24px; text-align: center; color: var(--muted); }
.state-box strong { display: block; margin-bottom: 4px; color: var(--text); font-size: .95rem; }
.state-box button {
    margin-top: 16px; padding: 8px 16px; cursor: pointer;
    border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
    font: inherit; font-weight: 600; color: var(--text);
}
.state-box button:hover { background: var(--canvas); }

.skeleton { border-radius: 6px; background: linear-gradient(90deg, #eceee9 25%, #f5f6f3 50%, #eceee9 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- 모바일 (사이드바 → 햄버거 드로어) ---------- */
@media (max-width: 860px) {
    .admin-container { height: 100dvh; }

    .admin-sidebar {
        position: fixed; top: 0; bottom: 0; left: 0; z-index: 30;
        width: 264px;
        transform: translateX(-100%);
        transition: transform .25s ease;
    }
    body.nav-open .admin-sidebar { transform: translateX(0); }

    .sidebar-overlay {
        display: block; position: fixed; inset: 0; z-index: 20;
        background: rgba(0, 0, 0, .55);
        opacity: 0; pointer-events: none;
        transition: opacity .25s ease;
    }
    body.nav-open .sidebar-overlay { opacity: 1; pointer-events: auto; }

    .nav-toggle {
        display: grid; place-items: center;
        width: 40px; height: 40px; margin: 0 8px 0 -8px;
        border: 0; border-radius: 8px; background: none;
        color: var(--text); cursor: pointer;
    }
    .nav-toggle:hover { background: var(--canvas); }

    .admin-header { padding: 0 16px; }
    .admin-content { padding: 20px 16px 40px; }
    .panel-head { padding: 16px; }
    .admin-table th, .admin-table td { padding: 12px 16px; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}

/* ===== admin.css 맨 아래에 추가: 회원 테이블 전용 ===== */
.panel-head { align-items: center; flex-wrap: wrap; }
.panel-title-area { display: flex; align-items: baseline; gap: 12px; }
.panel-controls { display: flex; gap: 10px; align-items: center; }

.search-box input,
.filter-box select {
    height: 36px; padding: 0 12px;
    border: 1px solid var(--line); border-radius: 8px;
    background: var(--surface); color: var(--text);
    font: inherit; font-size: .88rem;
}
.search-box input { width: 220px; }
.search-box input::placeholder { color: #9aa5a1; }
.search-box input:focus, .filter-box select:focus { outline: none; border-color: #000; }

.admin-table th, .admin-table td { white-space: nowrap; }
.admin-table th:last-child, .admin-table td:last-child { text-align: right; }

.cell-email { font-weight: 500; }
.cell-empty { color: #b4bcb8; }

/* 접수 상태 뱃지 */
.badge-done { background: var(--green-soft); color: var(--green-deep); }
.badge-none { background: #eef0ec; color: var(--muted); }

/* 관리 버튼 */
.btn-sm {
    height: 30px; padding: 0 14px; cursor: pointer;
    border-radius: 7px; font: inherit; font-size: .8rem; font-weight: 600;
    transition: background-color .15s, color .15s, border-color .15s;
}
.btn-danger { background: var(--surface); color: #b42318; border: 1px solid #f0cbc6; }
.btn-danger:hover { background: #b42318; color: #fff; border-color: #b42318; }
.btn-ghost { background: var(--surface); color: var(--text); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--canvas); }

@media (max-width: 860px) {
    .panel-controls { width: 100%; }
    .search-box { flex: 1; }
    .search-box input { width: 100%; }
}

