/* AIPM 과 같은 SUITE 서체를 쓴다 */
@font-face { font-family: 'SUITE'; font-weight: 400; font-display: swap; src: url('/gw/ui/assets/fonts/SUITE-Regular.ttf') format('truetype'); }
@font-face { font-family: 'SUITE'; font-weight: 500; font-display: swap; src: url('/gw/ui/assets/fonts/SUITE-Medium.ttf') format('truetype'); }
@font-face { font-family: 'SUITE'; font-weight: 600; font-display: swap; src: url('/gw/ui/assets/fonts/SUITE-SemiBold.ttf') format('truetype'); }
@font-face { font-family: 'SUITE'; font-weight: 700; font-display: swap; src: url('/gw/ui/assets/fonts/SUITE-Bold.ttf') format('truetype'); }

:root {
    --sidebar-w: 232px;
    --bg: #0f172a;
    --panel: rgba(30, 41, 59, 0.8);
    --line: rgba(255, 255, 255, 0.1);
    --text: #f1f5f9;
    --muted: #b6c2d1;
    --accent: #818cf8;
}

* { box-sizing: border-box; }

body {
    font-family: 'SUITE', 'Noto Sans KR', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    font-size: 16px;           /* 어드민은 표·숫자가 많아 본문을 크게 잡는다 */
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

/* ─── 사이드 메뉴 ─── */
.layout { display: flex; min-height: 100vh; }

.side {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: #0b1120;
    border-right: 1px solid var(--line);
    padding: 18px 12px 24px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.side-head {
    display: flex; align-items: flex-start; gap: 6px;
    padding: 0 4px 14px; margin-bottom: 8px;
    border-bottom: 1px solid var(--line);
}
.side-brand { flex: 1; min-width: 0; font-size: 16px; font-weight: 700; color: #fff; padding-left: 6px; }
.side-brand small { display: block; font-size: 12.5px; font-weight: 500; color: var(--muted); margin-top: 3px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.side-toggle {
    flex-shrink: 0; width: 26px; height: 26px; line-height: 1;
    background: rgba(255,255,255,0.06); border: 1px solid var(--line); border-radius: 7px;
    color: var(--muted); font-size: 16px; cursor: pointer; font-family: inherit;
}
.side-toggle:hover { background: rgba(255,255,255,0.12); color: #fff; }

/* 본문 좌상단 열기 버튼 — 접혀 있을 때만 보인다 */
.side-open {
    display: none;
    position: sticky; top: 12px; z-index: 20;
    margin: 12px 0 -6px 16px;
    width: 34px; height: 34px; line-height: 1;
    background: rgba(30,41,59,0.9); border: 1px solid var(--line); border-radius: 9px;
    color: var(--text); font-size: 16px; cursor: pointer; font-family: inherit;
}
.side-open:hover { background: rgba(51,65,85,0.95); }

/* ─── 접힌 상태 ─── */
.layout.side-collapsed .side { display: none; }
.layout.side-collapsed .side-open { display: block; }

.side-group { margin-bottom: 4px; }
.side-group > summary {
    list-style: none; cursor: pointer;
    display: flex; align-items: center; justify-content: space-between;
    padding: 9px 10px; border-radius: 8px;
    font-size: 13px; font-weight: 700; letter-spacing: .05em;
    color: #cbd5e1; user-select: none;
}
.side-group > summary::-webkit-details-marker { display: none; }
.side-group > summary:hover { background: rgba(255, 255, 255, 0.04); color: var(--text); }
.side-group > summary::after { content: '▾'; font-size: 12px; transition: transform .15s; }
.side-group:not([open]) > summary::after { transform: rotate(-90deg); }

.side-items { display: flex; flex-direction: column; gap: 1px; padding: 2px 0 6px; }
.side-items a {
    display: block; padding: 9px 12px 9px 18px; border-radius: 8px;
    color: #dde5ee; text-decoration: none; font-size: 16px; font-weight: 500;
}
.side-items a:hover { background: rgba(255, 255, 255, 0.05); color: #fff; }
.side-items a.active { background: rgba(99, 102, 241, 0.18); color: var(--accent); font-weight: 600; }

.side-foot { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.side-foot a { display: block; padding: 8px 12px; border-radius: 8px; color: #f87171; text-decoration: none; font-size: 15px; font-weight: 600; }
.side-foot a:hover { background: rgba(239, 68, 68, 0.12); }

.main { flex: 1; min-width: 0; }

/* 모바일 — 사이드를 위로 접는다 */
@media (max-width: 820px) {
    .layout { flex-direction: column; }
    .side { width: 100%; height: auto; position: relative; padding: 12px; }
    .side-items { flex-direction: row; flex-wrap: wrap; }
    .side-items a { padding: 7px 12px; }
}

/* ─── 공통 ─── */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.card h3 { font-size: 16px; font-weight: 700; }

.btn { padding: 9px 16px; border-radius: 8px; font-weight: 600; font-size: 16px; cursor: pointer; border: none; transition: all .2s; font-family: inherit; }
.btn-primary { background: #6366f1; color: #fff; }
.btn-primary:hover { background: #818cf8; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #f87171; }
.btn-sm { padding: 6px 12px; font-size: 15px; }

input, select, textarea {
    background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); border-radius: 8px;
    padding: 10px 12px; color: #fff; font-size: 16px; width: 100%;
    font-family: inherit; line-height: 1.5;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: #6366f1; }
input::placeholder, textarea::placeholder { color: #7c8899; }

/* ─── 셀렉트 ───
   기본 select 는 목록(option)을 OS 가 그린다. 배경이 흰색으로 나와 흰 글씨가
   안 보이므로 option 배경·색을 명시한다. 화살표도 직접 그린다. */
select {
    appearance: none; -webkit-appearance: none; -moz-appearance: none;
    background-color: #1e293b;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23b6c2d1' d='M1 1.5 6 6.5l5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 34px;
    cursor: pointer;
}
select:hover { background-color: #243247; }
select option {
    background: #1e293b;
    color: #f1f5f9;
    padding: 8px 12px;
}
select option:checked { background: #4f46e5; color: #fff; }
select:disabled { opacity: .5; cursor: not-allowed; }

/* 필터용으로 버튼처럼 쓰는 select — 폭을 내용에 맞추고 테두리를 버튼과 맞춘다 */
select.btn {
    width: auto;
    background-color: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--line);
    color: var(--text);
    font-weight: 600;
    padding: 8px 34px 8px 12px;
}
select.btn:hover { background-color: rgba(255, 255, 255, 0.12); }
label { font-family: inherit; }

table { width: 100%; border-collapse: collapse; font-size: 16px; }
th { text-align: left; padding: 11px 12px; color: #cbd5e1; font-weight: 700; font-size: 15px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 12px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
tr:hover td { background: rgba(255, 255, 255, 0.02); }

.badge { display: inline-block; padding: 3px 9px; border-radius: 6px; font-size: 14px; font-weight: 700; }
.badge-green { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.badge-red { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.badge-blue { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.badge-yellow { background: rgba(234, 179, 8, 0.15); color: #facc15; }

.modal-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.65); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.modal { background: #1e293b; border: 1px solid var(--line); border-radius: 16px; padding: 24px; width: 100%; max-width: 480px; }
.modal h3 { font-size: 17px; }

.stat-box { text-align: center; padding: 18px 14px; }
.stat-box .value { font-size: 32px; font-weight: 700; line-height: 1.2; }
.stat-box .label { font-size: 15px; color: var(--muted); margin-top: 5px; font-weight: 500; }
.stat-box .note { font-size: 13px; color: #94a3b8; margin-top: 3px; }

.toggle { position: relative; width: 48px; height: 26px; background: #475569; border-radius: 13px; cursor: pointer; transition: .3s; }
.toggle.on { background: #6366f1; }
.toggle::after { content: ''; position: absolute; width: 20px; height: 20px; background: #fff; border-radius: 50%; top: 3px; left: 3px; transition: .3s; }
.toggle.on::after { left: 25px; }

h2 { font-size: 22px; font-weight: 700; }
