/* 백오피스 화면 스타일: tokens.css의 의미 토큰만 사용 */
@font-face {
    font-family: "Pretendard Variable";
    src: url("/fonts/PretendardVariable-302ec55f5b4320354ec6b35a53dead87.woff2") format("woff2-variations");
    font-weight: 45 920;
    font-style: normal;
    font-display: swap;
}

* { box-sizing: border-box; }
/* display를 지정한 요소도 hidden 속성이면 숨김 */
[hidden] { display: none !important; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: var(--t6);
    line-height: var(--t6-lh);
}

a { color: var(--text-link); }
h1, h2, p { margin: 0; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.muted { color: var(--text-3); }
.caption { font-size: var(--t7); line-height: var(--t7-lh); color: var(--text-3); }
.mono { font-family: var(--font-mono); font-size: 12px; line-height: 18px; color: var(--text-3); }
.num { font-variant-numeric: tabular-nums; }
/* 큰 글자일수록 자간을 조임 */
.page-title { font-size: 28px; line-height: 32px; font-weight: 700; letter-spacing: -0.018em; }
.section-title { font-size: var(--t5); line-height: var(--t5-lh); font-weight: 600; letter-spacing: -0.01em; }

/* 화면 뼈대 크기: 운영 경고 띠 높이(없으면 0), 펼친·접은 사이드바 폭, 센터 문맥 바 높이 */
:root { --band-h: 0px; --sidenav-w: 248px; --sidenav-rail: 68px; --context-h: 52px; }
:root:has(.prod-band) { --band-h: 32px; }
/* 위에 붙는 띠·문맥 바에 오류 칸이나 #앵커가 가리지 않게 */
html { scroll-padding-top: calc(var(--band-h) + var(--space-4)); }

/* 운영 환경 경고 띠: 스크롤해도 맨 위에 붙어 있음 */
.prod-band {
    position: sticky;
    top: 0;
    z-index: 30;
    height: var(--band-h);
    padding: 6px var(--space-4);
    box-sizing: border-box;
    overflow: hidden;
    background: var(--env-prod);
    color: var(--env-prod-text);
    font-size: var(--t7);
    line-height: 20px;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* 실행 환경 배지 */
.env-badge {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 var(--space-2);
    border-radius: var(--radius-xs);
    background: var(--env-local);
    color: var(--env-local-text);
    font-size: var(--t7);
    font-weight: 700;
}
.env-badge.env-dev { background: var(--env-dev); color: var(--env-dev-text); }
.env-badge.env-prod { background: var(--env-prod); color: var(--env-prod-text); }

/* 사이드바 머리: 로고, 환경 배지, 접기 버튼 */
.sidenav-head { display: flex; align-items: center; gap: var(--space-2); min-height: 44px; padding-left: var(--space-2); }
.brand, .solo-brand { display: flex; align-items: center; gap: var(--space-2); min-width: 0; color: var(--text); text-decoration: none; }
/* 로고: 회원 앱과 같은 Gymus 글자 로고(478x164) */
.brand-logo { display: block; width: auto; height: 20px; }
.brand-name { font-size: var(--t6); line-height: var(--t6-lh); font-weight: 700; white-space: nowrap; }
.sidenav-head .env-badge { height: 20px; padding: 0 6px; font-size: 12px; }
.sidenav-toggle { margin-left: auto; width: 36px; height: 36px; border-radius: var(--radius-sm); color: var(--text-3); }
.sidenav-toggle-arrow { transform-box: fill-box; transform-origin: center; }

/* 사이드바 작업 대상: 설정에 쓴 이름 그대로, 누르면 작업 대상 화면 */
.target-link { display: flex; align-items: center; gap: 6px; flex-shrink: 0; min-height: 36px; padding: 0 var(--space-3); border-radius: var(--radius-md); color: var(--text-2); font-size: var(--t7); text-decoration: none; }
.target-link:hover { background: var(--surface-2); }
.target-link svg { flex-shrink: 0; color: var(--text-3); }
.target-link .nav-text { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
/* 운영 대상: 아이콘과 이름 앞 점을 운영 띠와 같은 빨간색으로 */
.target-link.target-prod svg { color: var(--env-prod); }
.target-link.target-prod .target-name::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--env-prod); }
.target-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; color: var(--text); }
.target-change { margin-left: auto; white-space: nowrap; font-weight: 600; color: var(--text-3); }

/* 사이드바 아래 프로필 + 설정 메뉴: 화면 테마, 로그아웃 (설정 창은 프로필 위로 열림) */
.sidenav-foot { margin-top: auto; padding-top: var(--space-2); border-top: 1px solid var(--border); }
.settings-menu { position: relative; }
.settings-menu > summary { list-style: none; }
.settings-menu > summary::-webkit-details-marker { display: none; }
.settings-menu > summary:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus-ring); }
.profile-button {
    display: flex; align-items: center; gap: 10px;
    min-height: 52px; padding: 0 var(--space-2);
    border-radius: var(--radius-md); color: var(--text); cursor: pointer;
}
.profile-button:hover, .settings-menu[open] > .profile-button { background: var(--surface-2); }
.profile-avatar {
    flex-shrink: 0; width: 32px; height: 32px; border-radius: var(--radius-full);
    background: var(--text-2); color: var(--surface);
    font-size: var(--t7); font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
}
.profile-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.profile-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-caption { font-size: 12px; line-height: 16px; color: var(--text-3); }
.profile-gear { flex-shrink: 0; color: var(--text-3); }
.settings-panel {
    position: absolute; bottom: calc(100% + var(--space-2)); left: 0; right: 0; z-index: 20;
    padding: var(--space-3);
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl);
    box-shadow: var(--shadow-float);
    display: flex; flex-direction: column; gap: var(--space-3);
}
.settings-group { margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.settings-group legend { padding: 0 var(--space-1); }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 3px; border-radius: var(--radius-md); background: var(--surface-2); }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmented span {
    display: flex; align-items: center; justify-content: center;
    height: var(--control-sm); border-radius: var(--radius-sm);
    font-size: var(--t7); font-weight: 600; color: var(--text-2);
}
.segmented input:checked + span { background: var(--primary-weak); color: var(--text-link); }
.segmented input:focus-visible + span { box-shadow: 0 0 0 3px var(--focus-ring); }
.settings-panel form { margin: 0; padding-top: var(--space-2); border-top: 1px solid var(--border); }
.settings-item {
    width: 100%; height: var(--control-md); padding: 0 var(--space-2);
    display: flex; align-items: center; gap: var(--space-2);
    border: 0; border-radius: var(--radius-sm); background: transparent;
    font: inherit; font-size: var(--t6); color: var(--text); text-align: left; cursor: pointer;
}
.settings-item:hover { background: var(--surface-2); }
.settings-item svg { color: var(--text-3); }

/* 본문 레이아웃: 사이드바(화면 높이 전체, 스크롤해도 붙어 있음) + 본문 열. 상단 바 없음 */
.shell { display: flex; min-height: calc(100vh - var(--band-h)); }
.sidenav {
    position: sticky;
    top: var(--band-h);
    /* 접었을 때 말풍선·설정 창이 본문(표의 relative 줄, 문맥 바) 위로 보이게 */
    z-index: 20;
    flex: 0 0 var(--sidenav-w);
    width: var(--sidenav-w);
    height: calc(100vh - var(--band-h));
    overflow-y: auto;
    padding: var(--space-3);
    box-sizing: border-box;
    background: var(--sidenav-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 2px;
}
/* 메뉴 아이콘은 늘 파랑, 지금 메뉴는 회색 바탕과 굵은 글자 */
.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    height: 36px;
    padding: 0 var(--space-3);
    border-radius: var(--radius-md);
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}
.nav-item svg { flex-shrink: 0; color: var(--text-link); }
.nav-item:hover { background: var(--nav-active); }
.nav-item[aria-current="page"] { background: var(--nav-active); font-weight: 600; }
.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content { flex: 1; min-width: 0; padding: var(--space-8) var(--space-10) var(--space-16); }
/* 폭 제한이 있는 화면은 본문 열 가운데에 둠 */
.container { display: flex; flex-direction: column; gap: var(--space-5); margin: 0 auto; }
.container.narrow { max-width: 720px; }
.container.medium { max-width: 880px; }
/* 열이 4개 이하인 목록 화면 (전체 센터, 홈) */
.container.slim { max-width: 760px; }
.container.wide { max-width: 1120px; }
/* 표가 주인 화면(광고 목록)은 폭 제한 없이 오른쪽 공간까지 씀 */
.container.full { max-width: none; }
.page-head { display: flex; flex-direction: column; gap: var(--space-1); }

/* 센터 문맥 바: 펼친 사이드바에는 센터 칩이 늘 보이므로 숨기고, 접었거나 좁은 화면에서만 위에 붙여 표시 */
.context-bar {
    position: sticky; top: var(--band-h); z-index: 10;
    display: none; align-items: center; gap: var(--space-3);
    height: var(--context-h); padding: 0 var(--space-8);
    box-sizing: border-box;
    background: var(--surface); border-bottom: 1px solid var(--border);
}
.context-center {
    display: inline-flex; align-items: center; gap: var(--space-2); min-width: 0;
    height: 36px; padding: 0 var(--space-2); margin-left: calc(-1 * var(--space-2));
    border: 0; border-radius: var(--radius-sm); background: transparent;
    color: var(--text); font: inherit; cursor: pointer;
}
.context-center:hover { background: var(--surface-2); }
.context-center svg { flex-shrink: 0; color: var(--text-3); }
.context-center-name { font-size: var(--t5); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.context-target { flex-shrink: 0; max-width: 30%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); font-weight: 700; text-decoration: none; }
.context-target:hover { color: var(--text); }
.context-hint { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.context-hint kbd {
    display: inline-flex; align-items: center; height: 22px; padding: 0 6px;
    border: 1px solid var(--border-strong); border-radius: var(--radius-xs);
    font: inherit; font-size: 12px;
}

/* 접은 사이드바(넓은 화면만, html[data-sidebar=collapsed]는 js/theme.js가 CSS보다 먼저 설정): 아이콘 레일, 메뉴 이름은 올리거나 Tab으로 오면 말풍선 */
@media (min-width: 721px) {
    :root[data-sidebar="collapsed"] { scroll-padding-top: calc(var(--band-h) + var(--context-h) + var(--space-4)); }
    :root[data-sidebar="collapsed"] .sidenav { flex-basis: var(--sidenav-rail); width: var(--sidenav-rail); align-items: center; overflow: visible; }
    :root[data-sidebar="collapsed"] .sidenav-head { flex-direction: column; padding-left: 0; gap: var(--space-2); }
    :root[data-sidebar="collapsed"] .brand { display: none; }
    :root[data-sidebar="collapsed"] .sidenav-toggle { order: -1; margin-left: 0; width: 44px; height: 44px; }
    :root[data-sidebar="collapsed"] .sidenav-toggle-arrow { transform: rotate(180deg); }
    :root[data-sidebar="collapsed"] .nav-item,
    :root[data-sidebar="collapsed"] .nav-back,
    :root[data-sidebar="collapsed"] .target-link,
    :root[data-sidebar="collapsed"] .scope-chip { position: relative; width: 44px; height: 44px; min-height: 44px; padding: 0; justify-content: center; }
    :root[data-sidebar="collapsed"] .scope-chip svg { margin-left: 0; }
    :root[data-sidebar="collapsed"] .scope-main,
    :root[data-sidebar="collapsed"] .scope-chevron { display: none; }
    /* 이름은 화면 낭독기가 읽도록 숨기지 않고 투명하게 두었다가 말풍선으로 띄움 */
    :root[data-sidebar="collapsed"] .nav-text,
    :root[data-sidebar="collapsed"] .scope-label {
        position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%); z-index: 40;
        padding: 6px 10px; border-radius: var(--radius-sm);
        background: var(--text); color: var(--surface);
        font-size: var(--t7); line-height: 18px; font-weight: 600; white-space: nowrap;
        opacity: 0; pointer-events: none;
    }
    :root[data-sidebar="collapsed"] :is(.nav-item, .nav-back, .target-link, .scope-chip):is(:hover, :focus-visible) :is(.nav-text, .scope-label) { opacity: 1; }
    /* 말풍선 안에서는 말풍선 글자색을 따름 */
    :root[data-sidebar="collapsed"] .target-link :is(.target-name, .target-change) { color: inherit; }
    :root[data-sidebar="collapsed"] .nav-dot { position: absolute; top: 9px; right: 9px; box-shadow: 0 0 0 2px var(--surface); }
    /* 묶음 이름 대신 짧은 구분선 */
    :root[data-sidebar="collapsed"] .nav-label { width: 28px; height: 1px; margin: var(--space-2) 0; overflow: hidden; background: var(--border); color: transparent; }
    :root[data-sidebar="collapsed"] .sidenav-foot { align-self: stretch; display: flex; justify-content: center; }
    :root[data-sidebar="collapsed"] .profile-button { width: 44px; min-height: 44px; padding: 0; justify-content: center; border-radius: var(--radius-full); }
    :root[data-sidebar="collapsed"] .profile-main,
    :root[data-sidebar="collapsed"] .profile-gear { display: none; }
    :root[data-sidebar="collapsed"] .settings-panel { left: calc(100% + var(--space-3)); right: auto; bottom: 0; width: 260px; }
    :root[data-sidebar="collapsed"] .context-bar { display: flex; }
}

/* 좁은 화면: 사이드바를 위에 펼쳐 두고(접기 없음) 메뉴는 가로로 줄바꿈, 센터 문맥 바는 늘 표시 */
@media (max-width: 720px) {
    :root { --band-h: 0px; }
    :root:has(.prod-band) { --band-h: 0px; }
    html { scroll-padding-top: calc(var(--context-h) + var(--space-4)); }
    .prod-band { position: static; height: auto; white-space: normal; }
    .shell { flex-direction: column; }
    .sidenav { position: static; flex: none; width: auto; height: auto; overflow: visible; flex-direction: row; flex-wrap: wrap; align-items: center; border-right: 0; border-bottom: 1px solid var(--border); }
    .sidenav-head { flex-basis: 100%; }
    .sidenav-toggle { display: none; }
    .sidenav-head .env-badge { margin-left: auto; }
    .scope-chip, .target-link { flex-basis: 100%; }
    .sidenav-foot { margin: 0 0 0 auto; padding-top: 0; border-top: 0; }
    .profile-main, .profile-gear { display: none; }
    .settings-panel { top: calc(100% + var(--space-2)); bottom: auto; left: auto; right: 0; width: 260px; }
    .context-bar { display: flex; padding: 0 var(--space-4); }
    .context-hint { display: none; }
    .content { padding: var(--space-6) var(--space-4) var(--space-10); }
}

/* 위치 표시 */
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: var(--t7); line-height: var(--t7-lh); color: var(--text-3); }
.breadcrumb a { color: var(--text-2); font-weight: 600; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* 카드 */
.card { background: var(--surface); border-radius: var(--radius-2xl); }
.card-pad { padding: var(--space-6); }
.card-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-2); padding: var(--space-5) var(--space-6) var(--space-3); }
.card-clip { overflow: hidden; }
.stack { display: flex; flex-direction: column; gap: 10px; }

/* 버튼 */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: var(--control-md);
    min-width: 76px;
    padding: 0 18px;
    border: 0;
    border-radius: var(--radius-full);
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}
/* 누르는 순간 바로 반응 */
.button:active:not(:disabled) { transform: scale(0.97); transition: transform 100ms ease-out; }
@media (prefers-reduced-motion: reduce) { .button:active:not(:disabled) { transform: none; } }
.button:hover { filter: brightness(0.97); }
.button-primary { background: var(--primary); color: var(--on-color); }
.button-primary:hover { background: var(--primary-hover); filter: none; }
.button-weak { background: var(--primary-weak); color: var(--text-link); }
.button-surface { background: var(--surface); }
.button-sm { height: var(--control-sm); min-width: 56px; padding: 0 var(--space-3); font-size: var(--t7); }
/* 큰 버튼은 로그인·홈 검색처럼 큰 입력칸과 한 줄일 때만 */
.button-lg { height: var(--control-lg); min-width: 96px; padding: 0 var(--space-5); font-size: var(--t6); }
/* 글자 버튼: 저장이 일어나지 않는 가벼운 일 (선택 해제) */
.button-text { min-width: 0; padding: 0 var(--space-2); background: transparent; color: var(--text-link); }
.button-text:hover { background: var(--primary-weak); filter: none; }
.button:disabled { background: var(--border); color: var(--text-disabled); cursor: not-allowed; filter: none; }
.button-block { width: 100%; }

/* 입력칸 */
.field { display: flex; flex-direction: column; gap: var(--space-2); }
.field-label { font-size: var(--t7); line-height: var(--t7-lh); font-weight: 600; color: var(--text-2); }
.input {
    width: 100%;
    height: var(--control-md);
    padding: 0 var(--space-3);
    border: 0;
    border-radius: var(--radius-md);
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
}
.input::placeholder { color: var(--text-disabled); }
.input:focus { outline: none; background-color: var(--surface); box-shadow: 0 0 0 2px var(--primary), 0 0 0 5px var(--focus-ring); }
.input-lg { height: var(--control-lg); padding: 0 var(--space-4); border-radius: var(--radius-lg); font-size: var(--t5); }
.input-outline { background-color: var(--surface); box-shadow: inset 0 0 0 1px var(--border-strong); }
/* 입력칸 폭: 화면 폭이 아니라 담는 값의 길이로 (좁은 화면에서는 줄어듦) */
.input.w-md { width: var(--w-md); max-width: 100%; }
.input.w-lg { width: var(--w-lg); max-width: 100%; }
.input.w-xl { width: var(--w-xl); max-width: 100%; }

/* 드롭다운: 브라우저 기본 화살표 대신 직접 그린 화살표 (회색 하나로 라이트·다크 둘 다 보임) */
select.input {
    appearance: none;
    padding-right: var(--space-8);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7684' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-3) center;
    background-size: 16px;
    cursor: pointer;
}
select.input:hover:not(:disabled):not(:focus) { box-shadow: inset 0 0 0 1px var(--border-strong); }
select.input:disabled { cursor: not-allowed; }

/* 펼친 목록: base-select를 지원하는 브라우저(Chrome·Edge 135+)만 꾸밈, 나머지는 목록만 브라우저 기본 모양 */
@supports (appearance: base-select) {
    select.input,
    select.input::picker(select) { appearance: base-select; }
    /* base-select는 고른 값 길이로 폭이 정해져 값을 바꿀 때마다 칸이 흔들리므로 최소 폭을 둠 */
    select.input { align-items: center; min-width: 160px; }
    select.input::picker-icon { display: none; }
    select.input::picker(select) {
        margin-top: var(--space-1);
        padding: var(--space-1);
        border: 1px solid var(--border);
        border-radius: var(--radius-lg);
        background: var(--surface);
        color: var(--text);
        box-shadow: var(--shadow-float);
    }
    select.input option {
        display: flex;
        align-items: center;
        gap: var(--space-2);
        padding: var(--space-2) var(--space-3);
        border-radius: var(--radius-md);
        cursor: pointer;
    }
    select.input option:hover,
    select.input option:focus-visible { outline: none; background: var(--surface-2); }
    select.input option:checked { background: var(--primary-weak); color: var(--text-link); font-weight: 600; }
    select.input option::checkmark { color: var(--text-link); }
}

/* 검색창 */
.search-form { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; margin: 0; }
.search-box { position: relative; display: flex; align-items: center; flex: 1 1 320px; }
.search-box.compact { flex: 0 1 420px; }
.search-box svg { position: absolute; left: var(--space-4); color: var(--text-3); pointer-events: none; }
.search-box.compact svg { left: var(--space-3); }
.search-box .input { padding-left: 48px; }
.search-box.compact .input { padding-left: 38px; }
.search-box kbd {
    position: absolute; right: var(--space-3);
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 24px; height: 24px; padding: 0 6px;
    border: 1px solid var(--border-strong); border-radius: var(--radius-xs);
    color: var(--text-3); font: inherit; font-size: var(--t7);
}
.search-box .input.with-kbd { padding-right: 56px; }
.search-summary { margin-left: auto; }

/* 알림 */
.alert { padding: var(--space-3) var(--space-4); border-radius: var(--radius-lg); }
.alert-error { background: var(--danger-weak); color: var(--text-danger); }
.alert-info { background: var(--primary-weak); color: var(--text-link); font-weight: 600; }

/* 목록 */
.list { list-style: none; margin: 0; padding: 0 var(--space-3) var(--space-3); }
.list-link {
    display: flex; align-items: center; gap: var(--space-3);
    min-height: 56px; padding: 0 var(--space-3);
    border-radius: var(--radius-lg);
    color: var(--text); text-decoration: none;
}
.list-link:hover { background: var(--surface-2); }
.list-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.list-title { font-weight: 600; }
.chevron { color: var(--text-3); flex-shrink: 0; }
.empty { padding: var(--space-6) var(--space-6) var(--space-8); color: var(--text-3); }
.empty-center { padding: 56px var(--space-5); display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }

/* 표 */
.table-scroll { overflow-x: auto; }
.table { width: 100%; min-width: 640px; border-collapse: collapse; }
.table th {
    height: 40px; padding: 0 var(--space-5);
    border-bottom: 1px solid var(--border);
    font-size: var(--t7); font-weight: 600; color: var(--text-3); text-align: left;
}
.table td { height: 48px; padding: 0 var(--space-5); border-bottom: 1px solid var(--border); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table .col-id { width: 140px; color: var(--text-2); }
.table .col-go { width: 40px; text-align: right; }
.table .row-link { color: var(--text); font-weight: 600; text-decoration: none; }
.table .row-link::after { content: ""; position: absolute; inset: 0; }
.table tbody tr { position: relative; }

/* 페이지 이동 */
.pagination { display: flex; justify-content: center; align-items: center; gap: var(--space-1); }
.page-link {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 32px; height: 32px; padding: 0 var(--space-2);
    border-radius: var(--radius-sm);
    color: var(--text-2); font-size: var(--t7); font-weight: 600; text-decoration: none;
}
.page-link:hover { background: var(--surface-2); }
.page-link[aria-current="page"] { background: var(--primary-weak); color: var(--text-link); }
.page-link.disabled { color: var(--text-disabled); pointer-events: none; }

/* 설정 항목과 스위치 */
/* 설정 섹션은 넓으면 2개씩, 카드 하나가 440px보다 좁아지면 1개씩. 카드 높이는 내용만큼(옆 카드에 맞춰 늘리지 않음) */
.setting-grid { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: var(--space-5); margin: 0; }
.setting-row { margin: 0; display: flex; align-items: center; gap: var(--space-4); padding: var(--space-4) var(--space-6); border-top: 1px solid var(--border); }
.setting-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
/* 카드 제목을 화면에 보이지 않게 둔 카드(카드가 하나뿐인 화면)는 첫 줄 위 선 없음 */
.card > .sr-only + .setting-row { border-top: 0; }
.setting-label { display: flex; align-items: center; gap: var(--space-2); font-weight: 600; }
/* 스위치 옆 켜짐/꺼짐 글자는 보이지 않음: 스위치 색과 aria-checked가 상태를 알림 (backoffice.js는 글자를 계속 채움) */
.setting-state { display: none; }
/* 메뉴 섹션 제목 줄: 메뉴 노출 스위치와 앱 노출 상태, 아래 버튼 항목과는 항목 위 구분선으로 나뉨 */
.setting-row.menu-head { border-top: 0; padding: var(--space-5) var(--space-6) var(--space-4); }
.menu-status { font-size: var(--t7); font-weight: 600; color: var(--text-3); text-align: right; white-space: nowrap; }
.menu-status.on { color: var(--text-success); }
/* 메뉴 노출이 꺼진 메뉴의 버튼 항목: 모두 꺼짐이고 메뉴를 켜기 전에는 바꿀 수 없음 */
.setting-row.dimmed .setting-main, .setting-row.dimmed .setting-state { opacity: 0.55; }

.switch {
    appearance: none;
    position: relative;
    flex-shrink: 0;
    width: 44px;
    height: 26px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: var(--radius-full);
    background: var(--border-strong);
    cursor: pointer;
    transition: background 0.15s;
}
.switch::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 22px;
    height: 22px;
    border-radius: var(--radius-full);
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.15s;
}
.switch[aria-checked="true"] { background: var(--switch-on); }
.switch[aria-checked="true"]::after { transform: translateX(18px); }
.switch:disabled { cursor: progress; opacity: 0.6; }
.setting-row.dimmed .switch:disabled { cursor: not-allowed; }
.switch:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .switch, .switch::after { transition: none; } }

/* 로그인·오류 화면 */
.page-plain { min-height: 100vh; display: flex; flex-direction: column; }
.plain-header { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-5) var(--space-8); }
/* 로그인·오류 화면은 로고 없이 환경 배지만 오른쪽에 표시 */
.plain-header .env-badge { margin-left: auto; }
.plain-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-5); padding: var(--space-6) var(--space-4) 96px; }
.login-card { width: 100%; max-width: 420px; padding: var(--space-10); border-radius: 20px; display: flex; flex-direction: column; gap: 28px; }
.login-title { font-size: var(--t2); line-height: var(--t2-lh); font-weight: 700; }
.error-card { width: 100%; max-width: 460px; padding: var(--space-10); display: flex; flex-direction: column; gap: var(--space-3); align-items: flex-start; }
.error-status { font-size: var(--t1); line-height: var(--t1-lh); font-weight: 700; color: var(--text-3); }

/* v2: 글자 보조 */
.text-2 { color: var(--text-2); }
.text-link { color: var(--text-link); }
.strong { font-weight: 600; }
.page-title.large { font-size: 32px; line-height: 38px; }
.page-head-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-3); }
.row-between { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); }
.list-flush { padding: 0; }
.empty-inline { padding: var(--space-4); border-radius: var(--radius-lg); background: var(--surface-2); color: var(--text-2); }

/* v2: 버튼 변형 */
/* 보조 버튼은 기본 버튼과 같은 회색 바탕 (테두리 버튼 없음), 위험 버튼은 옅은 빨강 바탕 */
.button-outline { gap: var(--space-2); }
.button-danger { background: var(--danger-weak); color: var(--text-danger); }
.icon-button { width: 44px; height: 44px; border: 0; border-radius: var(--radius-lg); background: transparent; color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.icon-button:hover { background: var(--surface-2); }
.icon-button:disabled { color: var(--text-disabled); background: transparent; cursor: not-allowed; }

/* v2: 사이드바 센터 칩, 한 번에 한 센터만 수정하므로 센터 안에서는 항상 센터명과 ID 표시 */
.scope-chip {
    display: flex; align-items: center; gap: 10px; flex-shrink: 0;
    min-height: 52px; margin: var(--space-2) 0 var(--space-1); padding: 6px var(--space-2);
    border: 1px solid var(--border); border-radius: var(--radius-lg);
    background: var(--bg); color: var(--text);
    font: inherit; text-align: left; text-decoration: none; cursor: pointer;
}
.scope-chip:hover { border-color: var(--border-strong); }
.scope-chip-global { cursor: default; color: var(--text-2); font-weight: 600; }
.scope-chip-global:hover { border-color: var(--border); }
.scope-chip-empty { border-style: dashed; border-color: var(--border-strong); background: transparent; color: var(--text-3); font-weight: 600; }
.scope-chip-global svg, .scope-chip-empty svg { flex-shrink: 0; margin-left: 6px; }
.scope-initial {
    flex-shrink: 0; width: 32px; height: 32px; border-radius: var(--radius-sm);
    background: var(--primary-weak); color: var(--text-link);
    font-size: var(--t6); font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
}
.scope-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.scope-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scope-id { font-size: var(--t7); line-height: 18px; color: var(--text-3); }
.scope-chip svg { color: var(--text-3); }
.scope-chevron { flex-shrink: 0; }

/* v2: 센터 메뉴 */
.nav-back { display: flex; align-items: center; gap: 6px; flex-shrink: 0; height: 36px; padding: 0 var(--space-3); border-radius: var(--radius-md); color: var(--text-3); font-size: var(--t7); font-weight: 600; text-decoration: none; }
.nav-back:hover { background: var(--surface-2); }
.nav-label { margin: var(--space-3) var(--space-3) var(--space-1); font-size: var(--t7); line-height: var(--t7-lh); font-weight: 600; color: var(--text-3); }
.nav-text { flex: 1; }
.nav-dot { width: 8px; height: 8px; border-radius: var(--radius-full); background: var(--danger); }
@media (max-width: 720px) {
    .sidenav { flex-wrap: wrap; align-items: center; }
    .nav-label { display: none; }
}

/* v2: 확인 필요 알림 */
.attention { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-4); padding: var(--space-4) var(--space-5); border-radius: var(--radius-2xl); background: var(--danger-weak); }
.attention-icon { color: var(--text-danger); flex-shrink: 0; }
.attention-main { flex: 1 1 360px; display: flex; flex-direction: column; gap: 2px; }

/* v2: 센터 개요의 설정 그룹 줄 */
.overview-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-4); min-height: 52px; padding: var(--space-2) var(--space-6); border-top: 1px solid var(--border); color: var(--text); text-decoration: none; }
.overview-row:hover { background: var(--surface-2); }
/* 설정 줄: 이름 | 요약 한 줄 | 화살표, 요약 조각 사이에만 가운뎃점 */
.overview-name { flex: 0 0 160px; }
.overview-summary { flex: 1 1 240px; min-width: 0; color: var(--text-2); }
.overview-summary > * + *::before { content: "·"; margin: 0 6px; color: var(--text-3); }
/* 준비 상태: 문제 항목만 줄로 펼치고 나머지는 접음 */
.readiness-counts { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-3); }
.readiness-counts .problem { color: var(--text-danger); font-weight: 700; }
.readiness-counts .ok { color: var(--text-success); font-weight: 700; }
.readiness-problem { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); padding: var(--space-3) var(--space-6); border-top: 1px solid var(--border); }
.readiness-problem > svg { flex-shrink: 0; color: var(--text-danger); }
.readiness-problem-main { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; overflow-wrap: anywhere; }
.readiness-rest { border-top: 1px solid var(--border); }
.readiness-rest > summary { padding: var(--space-3) var(--space-6); font-weight: 600; color: var(--text-2); cursor: pointer; }
.readiness-rest > summary:hover { background: var(--surface-2); }
.overview-main { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.overview-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2); }
.value-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.value-chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 var(--space-2); border-radius: var(--radius-xs); background: var(--surface-2); font-size: var(--t7); }
.value-state { font-weight: 600; color: var(--text-3); }
.value-state.on { color: var(--text-success); }

/* 센터 개요의 센터 준비 상태: 영역별 묶음 안에 항목 타일 (판정 칩 + 이름, 값, 설명), 넓은 화면 3열 → 2열 → 1열, 순서는 고정 */
.readiness-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--space-2) var(--space-3); margin: 0; padding: var(--space-3) var(--space-6); border-top: 1px solid var(--border); }
.readiness-group { padding: var(--space-3) var(--space-6) var(--space-4); border-top: 1px solid var(--border); }
.readiness-group-title { display: flex; align-items: baseline; gap: var(--space-2); margin: 0 0 var(--space-2); font-size: var(--t7); line-height: var(--t7-lh); font-weight: 700; color: var(--text-2); }
.readiness-group-title .num { color: var(--text-danger); }
.readiness-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.readiness-grid > li { display: flex; min-width: 0; }
/* 강사별 PG 같은 대상 목록은 한 칸에 들어가지 않으므로 줄 전체 */
.readiness-grid > li.span-all { grid-column: 1 / -1; }
.readiness-tile { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); text-decoration: none; }
.readiness-tile.problem { box-shadow: inset 3px 0 0 var(--danger); }
a.readiness-tile:hover { background: var(--surface-2); border-color: var(--border-strong); }
.readiness-tile-head { display: flex; align-items: center; gap: var(--space-2); }
.readiness-tile-head > strong { flex: 1; min-width: 0; }
.readiness-tile .text-2 { overflow-wrap: anywhere; }
.readiness-details { display: flex; flex-direction: column; gap: 2px; padding-left: var(--space-3); border-left: 2px solid var(--border-strong); margin-top: var(--space-1); }
.readiness-foot { margin: 0; padding: var(--space-3) var(--space-6); border-top: 1px solid var(--border); }
.st-ok { background: var(--success-weak); color: var(--text-success); }
.st-problem { background: var(--danger-weak); color: var(--text-danger); }
.st-not-used { background: var(--surface-2); color: var(--text-3); }

/* 앱 회원 연동: 표 위 역할 안내 한 줄, 처리 칸은 판정 칩 옆에 넣을 내용 */
/* 위 여백을 늘 둠: 도구 줄이 파란 선택 줄이 될 때 글이 파란 띠에 붙지 않고, 고를 때 표가 밀리지도 않음 */
.app-members-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.app-members-actions { display: flex; align-items: center; gap: var(--space-4); min-width: 0; margin-left: auto; }
.app-members-actions .button { flex-shrink: 0; }
/* 표 위 도구 줄 한 줄 (앱 회원 연동·동의서 PDF): 칩 왼쪽, 검색과 주 버튼 오른쪽, 아래 선 없이 표 머리글로 이어짐. 고르면 파란 바탕이 되고 칩·검색 대신 고른 수와 선택 해제 */
.select-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); padding: var(--space-4) var(--space-6); }
/* flex-basis가 아니라 width: 묶음 너비를 잴 때 280px로 잡혀야 버튼이 아래로 떨어지지 않음 */
.select-bar .search-form { width: 280px; min-width: 0; }
.select-bar-picked { display: none; font-weight: 600; }
.select-bar:has([data-app-member-clear]:not([hidden])) { background: var(--primary-weak); }
.select-bar:has([data-app-member-clear]:not([hidden])) .select-bar-picked { display: inline; }
.select-bar:has([data-app-member-clear]:not([hidden])) :is(.app-members-chips, .search-form) { display: none; }
.app-member-table tbody tr:has(input[data-app-member-target]:checked) { background: var(--primary-weak); }
.app-member-table td { height: auto; padding-top: var(--space-3); padding-bottom: var(--space-3); }
/* 표 첫 칸·끝 칸은 도구 줄과 같은 세로선(24px) */
.app-member-table th:first-child, .app-member-table td:first-child { padding-left: var(--space-6); }
.app-member-table th:last-child, .app-member-table td:last-child { padding-right: var(--space-6); }
.app-member-table .col-check { padding-right: var(--space-3); }
.app-member-reason { display: block; margin-top: 2px; }
/* 빠진 것: 칩 배경 없이 글자만, 여러 개면 가운뎃점으로 나눔 */
.missing-tags { display: flex; flex-wrap: wrap; gap: 0 6px; }
.missing-tag { color: var(--text-2); font-size: var(--t7); white-space: nowrap; }
.missing-tag + .missing-tag::before { content: "·"; margin-right: 6px; color: var(--text-3); }
/* 동의 값 점 8개: 동의 초록, 미동의 빈 회색, 값 없음 옅은 점, 그 밖의 값 빨강 */
.agree-dots { display: inline-flex; align-items: center; gap: 5px; }
.agree-dot { width: 8px; height: 8px; border-radius: 50%; box-sizing: border-box; }
.agree-dot.yes { background: var(--text-success); }
.agree-dot.no { border: 1.5px solid var(--text-3); }
.agree-dot.none { width: 4px; height: 4px; margin: 0 2px; background: var(--border-strong); }
.agree-dot.bad { background: var(--danger); }


/* v2: 창 (센터 전환, 운영 환경 저장 확인) */
.dialog {
    width: min(560px, calc(100vw - 32px));
    padding: var(--space-6);
    border: 0;
    border-radius: 20px;
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-float);
}
.dialog[open] { display: flex; flex-direction: column; gap: var(--space-4); }
.dialog::backdrop { background: var(--scrim); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin: -8px -8px 0 0; }
.dialog-head form { margin: 0; }
.dialog-title { margin: 0; font-size: var(--t4); line-height: var(--t4-lh); font-weight: 700; }
.dialog-label { font-size: var(--t7); line-height: var(--t7-lh); font-weight: 600; color: var(--text-3); }
.dialog-icon { width: 44px; height: 44px; border-radius: var(--radius-xl); background: var(--danger-weak); color: var(--text-danger); display: inline-flex; align-items: center; justify-content: center; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-2); }
.dialog-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-2); padding-top: var(--space-3); border-top: 1px solid var(--border); }
.switcher { margin-top: 88px; }
.switcher-search { margin: 0; }
.switcher-recent { display: flex; flex-direction: column; gap: var(--space-1); }
.switcher .list { padding: 0; }
.switcher .empty { padding: var(--space-2) 0; }

/* 타석 운영: 시각·숫자 입력 줄, 줄별 오류, 하루 흐름 막대, 저장 줄 */
.setting-row.form-row { flex-wrap: wrap; row-gap: var(--space-2); }
.time-range, .inline-field { display: flex; align-items: center; gap: var(--space-2); }
.input-time { width: 128px; }
.input-number { width: var(--w-xs); text-align: right; }
.input:disabled { color: var(--text-disabled); cursor: not-allowed; }
/* 날짜 칸: 기본 날짜 입력은 브라우저 언어 형식으로 보여 yyyy-MM-dd 텍스트 칸 + 달력 버튼(숨긴 기본 날짜 입력의 달력)으로 씀 */
.date-field { position: relative; display: flex; align-items: center; flex: 0 0 auto; width: var(--w-date); }
.date-field .input { padding-right: 40px; }
.date-field-button { position: absolute; right: 4px; width: 30px; height: 30px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-3); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.date-field-button:hover:not(:disabled) { background: var(--border); color: var(--text-2); }
.date-field-button:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--primary); }
.date-field-button:disabled { color: var(--text-disabled); cursor: not-allowed; }
.date-field-picker { position: absolute; left: 0; bottom: 0; width: 100%; height: 100%; padding: 0; border: 0; opacity: 0; pointer-events: none; }
.next-day { font-size: var(--t7); font-weight: 600; color: var(--text-link); white-space: nowrap; }
.field-error { flex-basis: 100%; margin: 0; font-size: var(--t7); line-height: var(--t7-lh); font-weight: 600; color: var(--text-danger); }
.setting-row.invalid { background: var(--danger-weak); }
.setting-row.invalid .input:not(:disabled) { background-color: var(--surface); box-shadow: 0 0 0 2px var(--danger); }
.setting-note { margin: 0; padding: var(--space-3) var(--space-6) var(--space-5); border-top: 1px solid var(--border); font-size: var(--t7); line-height: var(--t7-lh); color: var(--text-3); }

.day-flow { display: flex; flex-direction: column; gap: var(--space-4); }
.day-legend { display: flex; flex-wrap: wrap; gap: var(--space-4); }
.day-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.day-swatch { width: 14px; height: 10px; border-radius: 3px; }
.day-row { display: flex; align-items: center; gap: var(--space-4); }
.day-label { width: 88px; flex-shrink: 0; font-weight: 600; }
.day-track { position: relative; flex: 1; min-width: 0; height: 32px; border-radius: var(--radius-sm); background: var(--surface-2); overflow: hidden; }
.day-op, .day-break { position: absolute; top: 0; bottom: 0; }
.day-swatch.op, .day-op { background: var(--primary-weak); box-shadow: inset 0 0 0 1px var(--primary); }
.day-op { border-radius: var(--radius-sm); display: flex; align-items: center; padding: 0 10px; font-size: var(--t7); font-weight: 600; color: var(--text-link); white-space: nowrap; overflow: hidden; }
.day-swatch.break, .day-break { background: repeating-linear-gradient(135deg, var(--hatch) 0 2px, transparent 2px 5px); box-shadow: inset 0 0 0 1px var(--hatch); }
.day-break { min-width: 3px; }
.day-ticks { flex: 1; display: flex; justify-content: space-between; font-size: 12px; line-height: 18px; color: var(--text-3); }

.save-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-5); padding: var(--space-4) var(--space-6); }
.save-actions { display: flex; gap: var(--space-2); margin-left: auto; }
/* 설정 폼 저장 줄: 화면 아래에 붙어 따라오고, 왼쪽에 바뀐 항목 수 (바뀌면 파란 점과 글자) */
/* 내용 폭만큼만 차지하는 반투명 줄을 가운데에 띄움 */
.save-bar-sticky {
    position: sticky; bottom: var(--space-5); z-index: 5;
    width: fit-content; max-width: 100%; margin-left: auto; margin-right: auto;
    gap: var(--space-2) var(--space-5); padding: var(--space-2) var(--space-2) var(--space-2) var(--space-5);
    border-radius: 26px; background: var(--float-bg);
    -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
    box-shadow: var(--shadow-float), inset 0 0 0 1px var(--border);
}
@media (prefers-reduced-transparency: reduce) { .save-bar-sticky { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; } }
.save-status { display: flex; align-items: center; gap: var(--space-2); margin: 0; font-size: var(--t7); line-height: var(--t7-lh); color: var(--text-3); }
.save-status::before { content: ""; flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); }
.save-status.dirty { font-weight: 600; color: var(--text-link); }
.save-status.dirty::before { background: var(--primary); }
.button[aria-disabled="true"] { background: var(--border); box-shadow: none; color: var(--text-disabled); cursor: not-allowed; pointer-events: none; filter: none; }
/* 처음 그린 값과 달라진 설정 줄: 파란 바탕, 이름 아래에 저장 전 값, 바뀐 칸은 파란 테두리 */
.setting-row.changed:not(.invalid) { background: var(--primary-weak); }
.changed-note { font-size: var(--t7); line-height: var(--t7-lh); font-weight: 600; color: var(--text-link); }
.setting-row.changed:not(.invalid) .input.changed-input { background-color: var(--surface); box-shadow: inset 0 0 0 2px var(--primary); }
/* 설정 안내 줄을 여러 줄로 나눔 (레슨 운영 수강 접수 예시) */
.note-line { display: block; }
.enrollment-segmented { flex-shrink: 0; width: 200px; }

/* 광고: 모든 센터 공통 화면 표시, 보조 글자 */
.scope-chip-global { padding: 0 var(--space-3); cursor: default; font-weight: 600; }
.scope-chip-global:hover { box-shadow: none; }
.scope-chip-global svg { color: var(--text-3); }
.stack-tight { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nowrap { white-space: nowrap; }
.req { margin-left: 2px; color: var(--text-danger); }
.caption-inherit { font-size: var(--t7); line-height: var(--t7-lh); }

/* 광고 배너 틀: 앱과 같은 343:56 비율, 이미지는 앱처럼 잘라 채움(cover), 외부 광고는 왼쪽 위 AD 표시 */
/* cqw는 배너 안의 AD 표시가 배너 폭에 맞춰 줄도록 쓰고, 배너 모서리는 앱(343 폭에 18)과 비슷하게 크기별 px로 지정 */
.ad-banner { position: relative; display: block; aspect-ratio: 343 / 56; overflow: hidden; border-radius: 14px; container-type: inline-size; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); }
.ad-thumb { border-radius: 8px; }
.phone-banner, .ad-drop-preview { border-radius: 18px; }
.ad-banner img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ad-badge { position: absolute; top: 1.75cqw; left: 1.75cqw; padding: 0.45cqw 1.45cqw; border-radius: 1.2cqw; background: rgba(0, 0, 0, 0.42); color: rgba(255, 255, 255, 0.92); font-size: max(2.62cqw, 8px); font-weight: 700; letter-spacing: 0.15cqw; line-height: 1.1; }
.ad-safe { position: absolute; top: 0; left: 0; width: 11cqw; height: 8cqw; border: 1.5px dashed var(--yellow-500); border-radius: 0 0 1.2cqw 0; background: rgba(255, 195, 66, 0.18); }

/* 광고 목록 */
.ad-tabs { display: flex; gap: var(--space-6); border-bottom: 1px solid var(--border); }
.ad-tab { display: inline-flex; align-items: center; gap: var(--space-2); height: 44px; padding: 0 var(--space-1); border-bottom: 2px solid transparent; color: var(--text-3); font-weight: 600; text-decoration: none; }
.ad-tab[aria-current="page"] { border-bottom-color: var(--text); color: var(--text); }
.ad-live { display: flex; flex-direction: column; gap: var(--space-4); }
.ad-live-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-4); }
.ad-live-slot { flex: 1 1 220px; max-width: 300px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ad-live-caption { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ad-live-n { width: 20px; height: 20px; flex-shrink: 0; border-radius: var(--radius-xs); background: var(--surface-2); color: var(--text-2); font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.ad-live-title { font-size: var(--t7); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ad-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: 0; padding: var(--space-3) var(--space-5); border-bottom: 1px solid var(--border); }
.card-foot-note { margin: 0; padding: var(--space-3) var(--space-5); border-top: 1px solid var(--border); }
.ad-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-right: auto; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; height: var(--control-sm); padding: 0 14px; border-radius: var(--radius-full); background: var(--surface-2); border: 0; color: var(--text-2); font: inherit; font-size: var(--t7); font-weight: 600; text-decoration: none; cursor: pointer; }
.filter-chip:hover { background: var(--border); }
.filter-chip.on { background: var(--text); color: var(--surface); }
.filter-count { font-weight: 700; opacity: 0.75; }
.ad-center-select { display: flex; align-items: center; gap: var(--space-2); }
.select { width: auto; max-width: 260px; padding-right: var(--space-8); }
.ad-table { min-width: 980px; }
.ad-table td { height: auto; padding-top: var(--space-3); padding-bottom: var(--space-3); }
.ad-table .col-order { width: 124px; }
.ad-table .col-clicks { text-align: right; }
.ad-table .col-switch { width: 104px; }
.ad-table .col-switch form { margin: 0; }
.row-ended td { color: var(--text-3); }
.row-ended .ad-thumb img { filter: grayscale(1); opacity: 0.55; }
.order-cell { display: flex; align-items: center; gap: 2px; }
.order-cell > .num { width: 18px; }
.order-buttons { display: flex; }
.order-buttons form { margin: 0; }
.order-button { width: var(--control-sm); height: var(--control-sm); padding: 0; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-3); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.order-button:hover:not(:disabled) { background: var(--border); color: var(--text); }
.order-button:disabled { color: var(--text-disabled); cursor: default; }
.ad-cell { display: flex; align-items: center; gap: 14px; min-width: 0; }
.ad-thumb { width: 150px; flex-shrink: 0; }
.ad-cell-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ad-cell-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.row-link-plain { color: var(--text); font-weight: 600; text-decoration: none; }
.row-link-plain:hover { color: var(--text-link); text-decoration: underline; }
.ad-link-label { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.type-badge { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: 4px; font-size: 12px; font-weight: 700; letter-spacing: 0.2px; white-space: nowrap; }
.type-house { background: var(--surface-2); color: var(--text-2); }
.type-ad { background: var(--grey-800); color: #ffffff; }
.status-chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 var(--space-2); border-radius: var(--radius-xs); font-size: var(--t7); font-weight: 700; white-space: nowrap; }
.status-chip::before { content: ""; width: 6px; height: 6px; border-radius: var(--radius-full); background: currentColor; }
/* 상태 칩은 바탕 없이 색 점과 글자만 (st-* 색 클래스의 바탕보다 우선) */
.status-chip.status-chip { height: auto; padding: 0; background: transparent; font-weight: 600; }
.status-chip.status-chip::before { width: 7px; height: 7px; }
.st-live { background: var(--success-weak); color: var(--text-success); }
.st-scheduled { background: var(--primary-weak); color: var(--text-link); }
.st-hidden { background: var(--surface-2); color: var(--text-2); }
.st-ended { background: var(--surface-2); color: var(--text-3); }

/* 광고 등록·수정: 왼쪽 폼, 오른쪽 앱 미리보기 (좁으면 미리보기가 아래로) */
.ad-title-row { display: flex; align-items: center; gap: 10px; }
.ad-edit { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--space-6); }
.ad-edit-main { flex: 1 1 560px; min-width: 0; display: flex; flex-direction: column; gap: var(--space-5); }
.ad-edit-main .save-bar { margin-top: 0; }
.ad-edit-aside { flex: 0 1 400px; min-width: 0; display: flex; flex-direction: column; gap: var(--space-4); }
.card-body { padding: var(--space-3) var(--space-6) var(--space-6); display: flex; flex-direction: column; gap: var(--space-5); }
.card-body-tight { gap: var(--space-3); }
.card-invalid { box-shadow: 0 0 0 2px var(--danger); }
.fieldset { margin: 0; padding: 0; border: 0; }
.fieldset legend { padding: 0; margin-bottom: var(--space-2); }
.field-label-row { display: flex; justify-content: space-between; gap: var(--space-2); max-width: var(--w-xl); }
.value-box { display: flex; align-items: center; width: fit-content; max-width: 100%; min-height: var(--control-md); padding: 0 var(--space-3); border-radius: var(--radius-md); background: var(--surface-2); color: var(--text-2); }
.input-invalid { box-shadow: 0 0 0 2px var(--danger); }
/* 2지선다는 카드 폭이 아니라 글자 폭만큼 */
.segmented-2 { grid-template-columns: repeat(2, 1fr); width: fit-content; max-width: 100%; border-radius: var(--radius-lg); }
.segmented-2 span { height: var(--control-sm); padding: 0 var(--space-4); font-size: 14px; gap: 6px; }
.segmented-2 input:checked + span { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 23, 51, 0.12); }
.choice { display: flex; align-items: flex-start; gap: var(--space-3); padding: 14px var(--space-4); border-radius: var(--radius-lg); box-shadow: inset 0 0 0 1px var(--border); cursor: pointer; }
.choice:has(input:checked) { background: var(--primary-weak); box-shadow: inset 0 0 0 2px var(--primary); }
.choice input { flex-shrink: 0; width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--primary); }
.choice-indent { padding-left: 46px; }
.ad-drop { position: relative; display: block; padding: var(--space-4); border-radius: var(--radius-lg); background: var(--surface-2); cursor: pointer; }
.ad-drop:focus-within { box-shadow: 0 0 0 2px var(--primary), 0 0 0 5px var(--focus-ring); }
.ad-drop-preview { background: var(--surface); }
.ad-drop-empty { aspect-ratio: 343 / 56; border-radius: var(--radius-xl); border: 1.5px dashed var(--border-strong); display: flex; align-items: center; justify-content: center; gap: 14px; }
.card-invalid .ad-drop-empty { border-color: var(--danger); background: var(--danger-weak); }
.ad-drop-icon { width: 40px; height: 40px; border-radius: var(--radius-lg); background: var(--surface); color: var(--text-link); display: inline-flex; align-items: center; justify-content: center; }
.ad-warn, .payment-warn, .sync-warn-box { display: flex; align-items: flex-start; gap: 10px; padding: var(--space-3) var(--space-4); border-radius: var(--radius-lg); background: var(--warn-weak); color: var(--text-warn); }
.ad-warn svg, .payment-warn svg, .sync-warn-box svg { flex-shrink: 0; margin-top: 2px; }
.ad-period { display: flex; flex-wrap: wrap; gap: var(--space-4) var(--space-8); }
.ad-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.preset { height: 30px; padding: 0 10px; border: 0; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text-2); font: inherit; font-size: var(--t7); font-weight: 600; cursor: pointer; }
.preset:hover:not(:disabled) { background: var(--border); }
.preset:disabled { color: var(--text-disabled); cursor: not-allowed; }
.check { display: inline-flex; align-items: center; gap: var(--space-2); margin-left: auto; font-weight: 500; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--primary); }
.ad-scope { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: var(--space-3); }
.ad-picker { display: flex; flex-direction: column; gap: var(--space-3); padding-top: var(--space-1); }
.button-ghost { background: transparent; color: var(--text-3); }
.button-danger-text { background: transparent; color: var(--text-danger); gap: 6px; }
.button-danger-text:hover { background: var(--danger-weak); filter: none; }
.center-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.center-chips:empty { display: none; }
.center-chip { display: inline-flex; align-items: center; gap: 6px; height: var(--control-sm); padding: 0 var(--space-1) 0 10px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: 14px; font-weight: 600; }
.center-chip-id { font-size: 12px; font-weight: 500; color: var(--text-3); }
.chip-x { width: 24px; height: 24px; padding: 0; border: 0; border-radius: var(--radius-xs); background: transparent; color: var(--text-3); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.chip-x:hover { background: var(--border); color: var(--text); }
.picker-box { border-radius: var(--radius-lg); box-shadow: inset 0 0 0 1px var(--border); overflow: hidden; }
.picker-box .search-box svg { left: 14px; }
.picker-box .input { padding-left: 40px; border-radius: 0; background: var(--surface); }
.picker-results { max-height: 264px; overflow-y: auto; border-top: 1px solid var(--border); background: var(--surface); }
.picker-result { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 var(--space-3); border-top: 1px solid var(--border); }
.picker-result:first-child { border-top: 0; }
.picker-result-main { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: var(--space-2); }
.picker-added { font-size: var(--t7); font-weight: 600; color: var(--text-success); }
.ad-preview { display: flex; flex-direction: column; gap: 14px; }
.phone { align-self: center; width: 359px; max-width: 100%; padding: 6px; border-radius: 32px; background: var(--grey-900); }
.phone-screen { height: 520px; padding: var(--space-4) var(--space-2) 0; border-radius: 27px; overflow: hidden; background: var(--grey-100); display: flex; flex-direction: column; gap: var(--space-3); }
.phone-card { height: 150px; padding: var(--space-4); border-radius: 18px; background: #ffffff; display: flex; flex-direction: column; gap: 10px; }
.phone-card-sm { height: 92px; }
.phone-label { font-size: 11px; line-height: 14px; font-weight: 600; color: var(--grey-500); }
.phone-bar { height: 10px; border-radius: 5px; background: var(--grey-200); }
.phone-bar-strong { height: 16px; border-radius: 8px; background: var(--grey-300); }
.w35 { width: 35%; } .w40 { width: 40%; } .w50 { width: 50%; } .w55 { width: 55%; } .w70 { width: 70%; } .w80 { width: 80%; }
.phone-banner { flex-shrink: 0; background: var(--grey-200); box-shadow: 0 0 0 2px var(--primary), 0 0 0 5px var(--focus-ring); }
.phone-banner-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: var(--grey-600); }
.ad-facts { margin: 0; display: grid; grid-template-columns: 76px 1fr; gap: var(--space-2) var(--space-3); font-size: var(--t7); line-height: var(--t7-lh); }
.ad-facts dt { color: var(--text-3); font-weight: 600; }
.ad-facts dd { margin: 0; color: var(--text-2); overflow-wrap: anywhere; }
.ad-facts-box { padding: var(--space-3) var(--space-4); border-radius: var(--radius-lg); background: var(--surface-2); }
.ad-summary { display: flex; flex-direction: column; gap: 10px; }
@media (max-width: 720px) {
    .choice-indent { padding-left: 0; }
    .check { margin-left: 0; }
    .sync-toolbar-checks { margin-left: 0; }
}

/* 약관: 태블릿·회원 앱과 같은 평문 줄바꿈 미리보기 */
.terms-title-row { display: flex; align-items: center; gap: 10px; }
.terms-version { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); padding: var(--space-3) var(--space-6); border-top: 1px solid var(--border); }
.terms-version-date { flex: 1 1 auto; color: var(--text-2); }
.terms-alert { margin: 0 var(--space-6) var(--space-3); }
.terms-required-select { width: auto; max-width: 320px; }
/* 약관 기본 정보 줄: 오류 문구는 줄 아래로 내림 */
.setting-row.terms-row { flex-wrap: wrap; row-gap: var(--space-2); }
.setting-row.terms-row .input.w-xl { flex: 0 1 var(--w-xl); min-width: 0; }
.terms-textarea { height: auto; min-height: 360px; padding: var(--space-3); line-height: var(--t6-lh); resize: vertical; }
.terms-preview { max-height: 480px; overflow: auto; padding: var(--space-4); border-radius: var(--radius-lg); background: var(--surface-2); color: var(--text); font-size: var(--t6); line-height: var(--t6-lh); white-space: pre-wrap; overflow-wrap: anywhere; }
.terms-preview:empty::before { content: "내용을 넣으면 여기에 보입니다."; color: var(--text-3); }
/* 약관 편집기(Jodit) 색을 토큰에 연결: 라이트·다크 전환을 그대로 따름.
   jodit.min.css가 :root에 같은 변수를 두고 뒤에 읽히므로 html:root로 우선 */
html:root {
    --jd-font-default: var(--font-sans);
    --jd-border-radius-default: var(--radius-md);
    --jd-color-background-default: var(--surface);
    --jd-color-background-light-gray: var(--surface);
    --jd-color-background-gray-hover: var(--surface-2);
    --jd-color-panel: var(--surface-2);
    --jd-color-text: var(--text);
    --jd-color-default: var(--text);
    --jd-color-dark: var(--text-2);
    --jd-color-icon: var(--text-2);
    --jd-color-text-icons: var(--text-2);
    --jd-color-label: var(--text-3);
    --jd-color-placeholder: var(--text-3);
    --jd-color-gray-dark: var(--text-3);
    --jd-color-border: var(--border-strong);
    --jd-color-separator: var(--border);
    --jd-color-border-selected: var(--primary);
    --jd-color-background-active: var(--primary);
    --jd-color-background-selection: var(--primary-weak);
    --jd-color-button-background-hover: var(--border);
    --jd-color-background-button-hover: var(--border);
    --jd-color-button-background-hover-opacity40: var(--border);
    --jd-color-button-background-hover-opacity60: var(--border);
}
/* 적용된 버전 보기: 저장한 HTML을 그대로 그림 (편집기와 같은 표 테두리) */
.terms-html { white-space: normal; }
.terms-html > :first-child { margin-top: 0; }
.terms-html p { margin: 0; }
.terms-html h2, .terms-html h3, .terms-html h4 { margin: var(--space-3) 0 var(--space-2); }
.terms-html ul, .terms-html ol { margin: var(--space-2) 0; padding-left: 1.5em; }
.terms-html table { border-collapse: collapse; max-width: 100%; margin: var(--space-3) 0; }
.terms-html th, .terms-html td { border: 1px solid var(--border-strong); vertical-align: middle; }
/* 표 칸 여백: 워드처럼 위아래를 좁게 두어 행 높이를 끌어 줄일 여지를 둠 (편집기·보기 화면 같은 값, Jodit 기본 0.4em보다 우선) */
html .jodit-wysiwyg table tr td, html .jodit-wysiwyg table tr th, .terms-html th, .terms-html td { padding: 0.15em 0.5em; }
/* 표 칸을 두 개 이상 끌어 골랐을 때 칠하는 색 (Jodit table.selectionCellStyle이 이 변수를 씀) */
.jodit-wysiwyg.terms-cells-selected { --terms-cell-selection: var(--border-strong); }
/* 행 높이 끌기 안내선 */
.terms-row-guide { position: fixed; z-index: 1000; height: 0; border-top: 2px solid var(--primary); pointer-events: none; }
/* 편집 중과 보기 화면에 같은 인용·구분선·형광펜 모양 (형광펜은 밝은 색이라 다크 모드에서도 글자를 어둡게) */
.jodit-wysiwyg blockquote, .terms-html blockquote { margin: var(--space-2) 0; padding-left: var(--space-4); border-left: 3px solid var(--text); }
.jodit-wysiwyg hr, .terms-html hr { margin: var(--space-3) 0; border: 0; border-top: 1px solid var(--border-strong); }
.jodit-wysiwyg [style*="background-color"]:not([style^="color"]):not([style*=" color"]):not([style*=";color"]),
.terms-html [style*="background-color"]:not([style^="color"]):not([style*=" color"]):not([style*=";color"]) { color: #191f28; }
/* 글자색·형광펜 목록 항목: 색 견본 "가" + 이름 */
.terms-color-option { display: inline-flex; align-items: center; gap: var(--space-2); }
.terms-color-sample { display: inline-block; min-width: 1.6em; padding: 0 4px; border-radius: var(--radius-xs); font-weight: 700; text-align: center; }
.terms-bytes-over { color: var(--text-danger); font-weight: 700; }

/* 결제 설정: 센터 PG 카드(키 묶음 2열 + 카드 안 저장 줄), 강사 표, 강사 키 수정 서랍. 저장된 키는 가린 값만 글자로, 입력칸은 늘 빈 칸 */
.payment-select { width: auto; }
.payment-inline-alert { margin: 0 var(--space-6) var(--space-3); }
.payment-title-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-3); }
/* 묶음 사이 선: 칸 사이 1px 틈에 테두리 색이 보이게 해서 2열이든 1열이든 같은 선 */
.payment-key-groups { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; background: var(--border); border-top: 1px solid var(--border); }
.payment-key-group { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-4) var(--space-6) var(--space-5); background: var(--surface); }
.payment-group-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) 10px; }
.payment-group-title { margin: 0; font-size: var(--t7); line-height: var(--t7-lh); font-weight: 600; color: var(--text-3); }
/* 키 한 줄: 왼쪽에 이름과 저장된 값, 오른쪽에 값 길이만큼의 입력칸 (가맹점 번호 200, API 키 320), 좁으면 입력칸이 아래로 */
.payment-key-field { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px var(--space-4); }
.payment-key-field.invalid .input { background-color: var(--surface); box-shadow: 0 0 0 2px var(--danger); }
.payment-key-label-row { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.payment-key-input { width: var(--w-lg); max-width: 100%; }
.payment-key-input[data-key-kind="merchant"] { width: var(--w-md); }
.payment-key-current { font-size: var(--t7); line-height: var(--t7-lh); font-weight: 600; color: var(--text-2); overflow-wrap: anywhere; }
.payment-key-current.empty-value { color: var(--text-3); font-weight: 400; }
.payment-key-input.typed { box-shadow: inset 0 0 0 1.5px var(--primary); }
.payment-foot { display: flex; flex-direction: column; gap: var(--space-3); padding: 14px var(--space-6); border-top: 1px solid var(--border); background: var(--surface); }
.payment-foot-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); }
.payment-foot-row .save-actions { margin-left: auto; }
.payment-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); padding: 0 var(--space-6) var(--space-4); }
.payment-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
/* 강사 표 도구 줄: 다른 목록처럼 칩 왼쪽, 검색 오른쪽 */
.instructor-toolbar { justify-content: space-between; padding-top: var(--space-4); }
.payment-table { min-width: 680px; }
.payment-table thead th { border-top: 1px solid var(--border); }
.payment-table td { height: auto; padding-top: 10px; padding-bottom: 10px; }
.payment-table th:first-child, .payment-table td:first-child { padding-left: var(--space-6); }
.payment-table th:last-child, .payment-table td:last-child { padding-right: var(--space-6); text-align: right; }
.payment-table tbody tr.open { background: var(--primary-weak); }
.name-button { padding: 0; border: 0; background: none; color: var(--text); font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
.name-button:hover { color: var(--text-link); text-decoration: underline; }
.payment-kv { display: flex; gap: var(--space-2); font-size: var(--t7); line-height: var(--t7-lh); white-space: nowrap; }
.payment-kv-name { width: 44px; color: var(--text-3); }
.payment-kv-value { min-width: 0; font-weight: 600; color: var(--text-2); white-space: normal; overflow-wrap: anywhere; }
/* 표에서는 긴 API 키를 한 줄로 줄임 (전체 값은 title과 키 수정 서랍에서) */
.payment-table th, .payment-table td { padding-left: var(--space-3); padding-right: var(--space-3); }
.payment-table .payment-kv-value { max-width: 132px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.payment-kv { align-items: center; min-height: 22px; }
/* 저장된 값 전체를 줄바꿈해서 보여 주고 끝에 복사 버튼 (센터 PG 카드, 키 수정 서랍) */
.payment-key-current-row { display: flex; align-items: flex-start; gap: var(--space-1); min-width: 0; }
/* 복사 버튼: 늘 보임, 표에서는 흐리게 두고 줄에 올리거나 Tab으로 오면 진해짐, 복사하면 잠깐 초록 체크 */
.copy-button { flex-shrink: 0; width: 22px; height: 22px; padding: 0; border: 0; border-radius: var(--radius-xs); background: transparent; color: var(--text-3); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.copy-button:hover { background: var(--surface-2); color: var(--text); }
.copy-button .copy-done { display: none; }
.copy-button.copied { color: var(--text-success); }
.copy-button.copied .copy-icon { display: none; }
.copy-button.copied .copy-done { display: block; }
.payment-table .copy-button { opacity: 0.6; }
.payment-table tr:hover .copy-button, .payment-table .copy-button:focus-visible, .payment-table .copy-button.copied { opacity: 1; }
.instructor-toolbar .search-box.compact { flex-basis: var(--w-lg); }
.payment-kv-value.missing { color: var(--text-danger); }
.payment-kv-value.empty-value { color: var(--text-3); font-weight: 400; }
/* 결제 설정 확인 창: 지금 → 바꿀 값 표, 취소 불가 체크 */
.confirm-table { min-width: 0; }
.confirm-table th, .confirm-table td { padding: 0 var(--space-3); }
.confirm-table th:first-child, .confirm-table td:first-child { padding-left: 0; }
.confirm-table th:last-child, .confirm-table td:last-child { padding-right: 0; }
.confirm-table td { height: auto; padding-top: 10px; padding-bottom: 10px; font-size: var(--t7); line-height: var(--t7-lh); overflow-wrap: anywhere; }
.confirm-table td:last-child { font-weight: 600; }
.confirm-table tbody tr:hover { background: none; }
.confirm-check { align-items: flex-start; margin-left: 0; padding: var(--space-3) var(--space-4); border-radius: var(--radius-lg); background: var(--danger-weak); color: var(--text-danger); }
.confirm-check input { flex-shrink: 0; margin-top: 2px; }
.payment-info { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-1) var(--space-3); padding: var(--space-3) var(--space-4); border-radius: var(--radius-lg); background: var(--surface-2); font-size: var(--t7); line-height: var(--t7-lh); color: var(--text-2); }

/* 오른쪽 서랍: 화면 높이 전체, 좁으면 화면 폭 전체(스크롤바 제외) */
.drawer {
    position: fixed; inset: 0 0 0 auto;
    width: min(460px, 100%); height: 100%; max-width: none; max-height: none;
    margin: 0; padding: 0; border: 0; border-radius: 0;
    background: var(--surface); color: var(--text);
    box-shadow: var(--shadow-float);
}
.drawer[open] { display: flex; }
.drawer::backdrop { background: var(--scrim); }
.drawer-form { flex: 1; min-width: 0; display: flex; flex-direction: column; margin: 0; }
.drawer-head { display: flex; align-items: flex-start; gap: var(--space-2); padding: var(--space-5) var(--space-4) var(--space-4) var(--space-6); border-bottom: 1px solid var(--border); }
.drawer-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.drawer-nav { display: flex; gap: 2px; }
.drawer-body { flex: 1; overflow-y: auto; padding: var(--space-5) var(--space-6); display: flex; flex-direction: column; gap: var(--space-5); }
/* 서랍 안 키 묶음은 위아래로, 묶음 사이 선 없이 */
.drawer-body .payment-key-groups { grid-template-columns: 1fr; gap: var(--space-6); background: none; border-top: 0; }
.drawer-body .payment-key-group { padding: 0; }

/* 스키마 맞추기: 센터 DB 표, 변경 내용과 SQL 펼치기 */
.sync-table td { height: auto; padding-top: var(--space-3); padding-bottom: var(--space-3); vertical-align: top; }
.sync-table .col-check, .app-member-table .col-check { width: 48px; }
.sync-table .col-check input, .app-member-table .col-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--primary); }
.sync-table .col-status { width: 132px; }
.sync-error { color: var(--text-danger); word-break: break-word; }
.sync-warn { color: var(--text-warn); }
.sync-elapsed { display: block; margin-top: var(--space-1); }
.sync-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
/* 진행 막대: 처리한 DB 비율, 한 DB가 오래 걸려도 줄무늬가 흘러 작업 중임을 보임 (0%여도 줄무늬가 보이도록 최소 폭) */
.sync-progress { display: flex; flex-direction: column; gap: var(--space-2); }
.sync-progress-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-1) var(--space-3); font-size: var(--t7); line-height: var(--t7-lh); color: var(--text-2); }
.sync-progress-track { height: 8px; border-radius: var(--radius-full); background: var(--surface-2); overflow: hidden; }
.sync-progress-fill {
    min-width: 24px; height: 100%; border-radius: var(--radius-full);
    background: repeating-linear-gradient(-45deg, var(--primary) 0 8px, var(--primary-hover) 8px 16px);
    background-size: 23px 100%;
    transition: width 0.6s ease;
    animation: sync-progress-flow 0.8s linear infinite;
}
@keyframes sync-progress-flow { to { background-position: 23px 0; } }
@media (prefers-reduced-motion: reduce) { .sync-progress-fill { transition: none; animation: none; } }
.sync-toolbar-checks { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); margin-left: auto; }
.sync-toolbar-checks .check { margin-left: 0; }
.sync-empty-filter { margin: 0 var(--space-6) var(--space-4); }
/* 상태 칩 = 거르기 버튼, 다른 화면의 거르기 칩(.filter-chip)과 같은 둥근 모양, 누른 칩은 짙은 바탕 */
.value-chip.sync-filter-chip { height: var(--control-sm); padding: 0 14px; border: 0; border-radius: var(--radius-full); background: var(--surface-2); color: var(--text-2); font: inherit; font-size: var(--t7); font-weight: 600; cursor: pointer; }
.value-chip.sync-filter-chip:hover { background: var(--border); }
.value-chip.sync-filter-chip[aria-pressed="true"] { background: var(--text); color: var(--surface); }
.sync-dialog-list { display: flex; flex-direction: column; gap: var(--space-1); margin: var(--space-2) 0 0; padding: 0; list-style: none; }
.sync-dialog-scroll { max-height: 200px; overflow: auto; padding-top: var(--space-2); border-top: 1px solid var(--border); }
.st-warn { background: var(--warn-weak); color: var(--text-warn); }
/* 요약 조각 사이에만 가운뎃점 */
.sync-summary > * + *::before { content: "·"; margin: 0 6px; color: var(--text-3); font-weight: 400; }
.sync-details summary { cursor: pointer; color: var(--text-link); font-size: var(--t7); font-weight: 600; }
.sync-changes { display: flex; flex-direction: column; gap: var(--space-3); margin: var(--space-2) 0 0; padding: 0; list-style: none; }
.sync-change-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.sync-sql { margin: var(--space-1) 0 0; padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); background: var(--surface-2); font-family: var(--font-mono); font-size: 12px; line-height: 18px; white-space: pre-wrap; word-break: break-all; max-height: 240px; overflow: auto; }
/* 삭제 대상 회원 */
.inactive-rule > summary { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); padding: var(--space-5) var(--space-6); cursor: pointer; border-radius: var(--radius-2xl); }
.inactive-rule > summary::-webkit-details-marker { display: none; }
.inactive-rule > summary:hover { background: var(--surface-2); }
.inactive-rule[open] > summary { padding-bottom: var(--space-3); border-radius: var(--radius-2xl) var(--radius-2xl) 0 0; }
.inactive-rule-brief { flex: 1 1 420px; min-width: 0; }
.inactive-rule-chevron { flex-shrink: 0; color: var(--text-3); transition: transform 0.2s ease; }
.inactive-rule[open] .inactive-rule-chevron { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) { .inactive-rule-chevron { transition: none; } }
.inactive-flow { display: flex; flex-wrap: wrap; align-items: stretch; gap: var(--space-3); }
.inactive-sources { flex: 1 1 340px; display: flex; flex-direction: column; gap: var(--space-2); }
.inactive-source { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-1) var(--space-3); padding: var(--space-2) var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.inactive-arrow { display: flex; align-items: center; color: var(--text-3); }
.inactive-step { flex: 1 1 220px; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: var(--space-3) var(--space-4); border-radius: var(--radius-lg); background: var(--surface-2); }
.inactive-step .caption, .inactive-step .mono { color: var(--text-2); }
.inactive-step-result { background: var(--warn-weak); color: var(--text-warn); }
.inactive-step-result .caption { color: inherit; }
.inactive-notes { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: var(--space-1); color: var(--text-2); }
.inactive-empty-card { display: flex; flex-direction: column; gap: var(--space-3); }
.inactive-card-head { align-items: center; }
.inactive-download { gap: var(--space-2); }
.inactive-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-2); }
.inactive-stat { display: flex; flex-direction: column; gap: 2px; padding: var(--space-3) var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.inactive-stat-label { font-size: var(--t7); line-height: var(--t7-lh); font-weight: 600; color: var(--text-2); }
.inactive-stat-value { font-size: var(--t3); line-height: var(--t3-lh); font-weight: 700; font-variant-numeric: tabular-nums; }
.inactive-stat-caption { font-size: var(--t7); line-height: var(--t7-lh); color: var(--text-2); }
.inactive-stat-primary { background: var(--primary-weak); border-color: transparent; }
.inactive-stat-primary .inactive-stat-value { color: var(--text-link); }
.inactive-toolbar { justify-content: space-between; }
.inactive-table td { height: auto; padding-top: var(--space-3); padding-bottom: var(--space-3); }
.inactive-table .col-num { width: 132px; text-align: right; white-space: nowrap; }
.inactive-table .col-status { width: 280px; }
.inactive-row-waiting td { color: var(--text-3); }
.inactive-error { display: block; margin-top: var(--space-1); }
.inactive-empty { margin: 0 var(--space-6) var(--space-4); }
.inactive-foot { margin-top: 0; border-top: 1px solid var(--border); }

/* 동의서 PDF: 진행 카드는 삭제 대상 회원의 진행 막대·숫자 칸을 같이 씀 */
.consent-blocks, .consent-failures { margin: var(--space-2) 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 2px; }
.consent-failures { max-height: 320px; overflow: auto; font-weight: 400; }
.consent-failure-list summary { cursor: pointer; }

/* 회원 사진: 진행 카드·숫자 칸은 동의서 PDF와 같이 씀 */
.photo-checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--space-2) var(--space-6); margin: 0; padding: 0; list-style: none; }
.photo-checks > li { display: flex; align-items: flex-start; gap: var(--space-2); }
.photo-checks > li > svg { flex-shrink: 0; margin-top: 2px; color: var(--text-success); }
.photo-checks > li.problem > svg { color: var(--text-danger); }
.photo-check-problem { display: block; }
.photo-problem { background: var(--danger-weak); color: var(--text-danger); }
.photo-folder { font-size: var(--t7); line-height: var(--t3-lh); overflow-wrap: anywhere; }
.photo-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-4) var(--space-6); border-top: 1px solid var(--border); }
.photo-actions > .caption { flex: 1 1 320px; margin: 0; }
.photo-buttons { display: flex; gap: var(--space-2); }

/* 작업 대상 화면: 설정의 모든 대상, 한 줄 = 라디오 + 이름 + 지금 대상 + 환경 배지 */
/* 폭은 고정하지 않고 가장 긴 대상 이름에 맞춤(480~720px): 안내 문구와 알림은 폭 계산에서 빼고 카드 폭을 따르게 함 */
.container.target-page { width: fit-content; min-width: min(var(--w-xl), 100%); max-width: min(720px, 100%); }
.target-page > :not(.card) { box-sizing: border-box; width: 0; min-width: 100%; }
.target-row .list-title { white-space: nowrap; }
.target-list { padding-top: var(--space-3); }
.target-row { display: flex; align-items: center; gap: var(--space-3); min-height: 56px; padding: 0 var(--space-3); border-radius: var(--radius-lg); cursor: pointer; }
.target-row:hover { background: var(--surface-2); }
.target-row input { width: 18px; height: 18px; margin: 0; accent-color: var(--primary); }
.target-row-current .list-title { color: var(--text-link); }
.target-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-2); padding: var(--space-3) var(--space-6) var(--space-5); border-top: 1px solid var(--border); }
.target-error { display: block; margin-top: var(--space-1); font-weight: 400; overflow-wrap: anywhere; }
/* 사이드바 없는 위 줄(작업 대상 화면): 왼쪽 로고, 오른쪽 프로필, 설정 창은 아래로 열림 */
.solo-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); min-height: 60px; padding: 0 var(--space-6); }
.solo-bar .sidenav-foot { margin: 0; padding: 0; border: 0; }
.solo-bar .profile-caption { display: none; }
.solo-bar .settings-menu .settings-panel { top: calc(100% + var(--space-2)); bottom: auto; left: auto; right: 0; width: 260px; }
/* 다른 화면에서 사이드바를 접어 둔 상태(html[data-sidebar])가 이 줄의 프로필 모양을 바꾸지 않게 */
@media (min-width: 721px) {
    .solo-bar .settings-menu .profile-button { width: auto; padding: 0 var(--space-2); border-radius: var(--radius-md); }
    .solo-bar .profile-button .profile-main { display: flex; }
    .solo-bar .profile-button .profile-gear { display: block; }
}

/* 게시판 관리자: 시설 목록, 시설별 회원 목록, 등록·이름 수정 창 */
.nav-hint { flex-shrink: 0; font-size: var(--t7); font-weight: 600; color: var(--text-3); }
.nav-item.nav-item-off { color: var(--text-disabled); }
.nav-item.nav-item-off svg { color: var(--text-disabled); }
@media (min-width: 721px) {
    :root[data-sidebar="collapsed"] .nav-hint { display: none; }
}
.board-table .col-board-id { width: 96px; color: var(--text-2); }
.board-table .col-board-num { width: 96px; }
.board-table .col-switch { width: 112px; }
/* 줄 전체를 덮는 링크(::after) 위로 스위치를 올려 스위치만 따로 누를 수 있게 */
.board-table .col-switch form { position: relative; z-index: 1; margin: 0; }
.board-table tbody tr:has(.row-link) { cursor: pointer; }
.board-table tbody tr:hover .row-link { color: var(--text-link); }
.row-link-button { padding: 0; border: 0; background: transparent; font: inherit; text-align: left; cursor: pointer; }
.board-chip-gap { margin-left: var(--space-2); }
.board-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.switch-danger[aria-checked="true"] { background: var(--danger); }
.board-level { display: inline-flex; align-items: center; height: 24px; padding: 0 var(--space-2); border-radius: var(--radius-xs); background: var(--surface-2); color: var(--text-2); font-size: var(--t7); font-weight: 600; white-space: nowrap; }
.board-level-admin { background: var(--primary-weak); color: var(--text-link); }
.board-dialog-form { gap: var(--space-4); margin: 0; }
.board-empty-icon { width: 48px; height: 48px; margin-bottom: 6px; border-radius: var(--radius-xl); background: var(--surface-2); color: var(--text-3); display: inline-flex; align-items: center; justify-content: center; }
.board-empty-action { margin-top: var(--space-3); }
