/* 오딧세이 본사 관리자 — 꾸밈 (V405 전면 재작성, 시안 「HQ Admin Redesign」 토큰 기준)
   ★ 변수 이름은 옛 판 그대로 두고 값만 새 판으로 바꿨다 — 탭 파일들이 인라인 style 에서 var(--text-muted) 처럼 쓰고 있다.
   시안 이름(--ink · --brand …)도 별칭으로 같이 둔다. 1층 = .tabs/.tab · 2층 = .stabs/.stab · 폰 = 맨 아래 @media. */
:root {
    /* 시안 토큰 (원본 이름) */
    --ink: #14181F;
    --ink2: #4A525E;
    --ink3: #7C8492;
    --ink4: #A7AEB9;
    --line: #E2E5EA;
    --line2: #EDEFF2;
    --bg: #F3F4F6;
    --surf: #FFFFFF;
    --surf2: #F8F9FB;
    --brand: #1C4E8A;
    --brand-ink: #123A69;
    --brand-soft: #E9F0F9;
    --brand-line: #BCD2EA;
    --amber: #8A5200;
    --amber-soft: #FFF2DC;
    --amber-line: #F0D3A3;
    --red: #AC241D;
    --red-soft: #FCEBE9;
    --red-line: #F0C4C0;
    --green: #0B6448;
    --green-soft: #E6F3EE;
    --green-line: #B8DCCD;
    --r1: 6px;
    --r2: 10px;
    --r3: 16px;
    --sh1: 0 1px 2px rgba(20,24,31,.06);
    --sh2: 0 6px 20px rgba(20,24,31,.10);
    /* 옛 이름 (탭 파일 인라인 style 이 쓴다 — 지우지 말 것) */
    --bg-app: #F3F4F6;
    --bg-surface: #FFFFFF;
    --bg-panel: #F8F9FB;
    --bg-thead: #F8F9FB;
    --bg-row-hover: #F8F9FB;
    --bg-row-selected: #E9F0F9;
    --border-row: #EDEFF2;
    --border-strong: #E2E5EA;
    --border-card: #E2E5EA;
    --text-strong: #14181F;
    --text-body: #14181F;
    --text-sub: #4A525E;
    --text-muted: #7C8492;
    --text-faint: #7C8492;
    --text-disabled: #A7AEB9;
    --accent: #1C4E8A;
    --accent-hover: #123A69;
    --accent-on: #FFFFFF;
    --success-dot: #0B6448;
    --success-text: #0B6448;
    --success-bg: #E6F3EE;
    --warn-dot: #8A5200;
    --warn-text: #8A5200;
    --warn-bg: #FFF2DC;
    --warn-border: #F0D3A3;
    --warn-text-strong: #8A5200;
    --stopped-dot: #A7AEB9;
    --stopped-text: #7C8492;
    --danger: #AC241D;
    --danger-border: #F0C4C0;
    --danger-on: #FFFFFF;
    --badge-bg: #AC241D;
    --font-sans: "Pretendard Variable",Pretendard,system-ui,-apple-system,"Malgun Gothic",sans-serif;
    --font-mono: ui-monospace,SFMono-Regular,Menlo,monospace;
    --fs-title: 20px;
    --fs-brand: 14px;
    --fs-tab: 14px;
    --fs-metric: 16px;
    --fs-table: 13px;
    --fs-table-sm: 12.5px;
    --fs-thead: 12px;
    --fs-button: 12px;
    --fs-meta: 12px;
    --fs-label: 11px;
    --radius-sm: 6px;
    --radius-md: 6px;
    --radius-lg: 10px;
    --radius-pill: 99px;
    --cell-y: 11px;
    --cell-y-sm: 9px;
    --cell-x: 14px;
    --pad-section: 22px;
    --control-h: 32px;
    --panel-w: 452px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--ink);
    line-height: 1.55;
    font-size: 13px;
    -webkit-font-smoothing: antialiased
}

button {
    font-family: inherit;
    cursor: pointer
}

input, select, textarea {
    font-family: inherit
}

.mono {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums
}

.num {
    text-align: right !important;
    font-variant-numeric: tabular-nums
}

.nowrap {
    white-space: nowrap
}

/* ── 로그인 ── */
#loginView {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px
}

.login-card {
    width: 100%;
    max-width: 404px;
    background: var(--surf);
    border: 1px solid var(--line);
    border-radius: var(--r3);
    box-shadow: var(--sh1);
    padding: 36px 36px 30px
}

    .login-card .brand {
        font-size: 11px;
        letter-spacing: .2em;
        color: var(--ink3);
        font-weight: 700
    }

    .login-card h1 {
        font-size: 17px;
        font-weight: 800;
        color: var(--ink);
        letter-spacing: -.01em;
        margin: 6px 0 6px
    }

    .login-card .lead {
        font-size: 13px;
        color: var(--ink2);
        line-height: 1.6;
        margin-bottom: 22px
    }

    .login-card label {
        display: block;
        font-size: 12px;
        font-weight: 700;
        margin: 16px 0 6px;
        color: var(--ink2)
    }

    .login-card input {
        width: 100%;
        height: 44px;
        padding: 0 13px;
        font-size: 14px;
        color: var(--ink);
        background: var(--surf);
        border: 1px solid var(--line);
        border-radius: var(--r1);
        outline: none
    }

        .login-card input:focus {
            border-color: var(--brand);
            box-shadow: 0 0 0 3px var(--brand-soft)
        }

    .login-card button {
        width: 100%;
        height: 46px;
        margin-top: 22px;
        font-size: 14px;
        font-weight: 700;
        color: #fff;
        background: var(--brand);
        border: none;
        border-radius: var(--r1)
    }

        .login-card button:hover {
            background: var(--brand-ink)
        }

    .login-card .foot {
        margin-top: 14px;
        font-size: 12px;
        color: var(--ink3);
        text-align: center
    }

#loginMsg {
    margin-top: 12px;
    font-size: 12.5px;
    color: var(--red);
    text-align: center;
    min-height: 18px
}

/* ── 맨 위 줄 ── */
#mainView {
    display: none
}

.bar {
    height: 56px;
    background: var(--surf);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px
}

    .bar .t {
        display: flex;
        align-items: center;
        gap: 9px;
        font-size: var(--fs-brand);
        font-weight: 800;
        letter-spacing: -.01em;
        color: var(--ink)
    }

        .bar .t::before {
            content: "";
            width: 22px;
            height: 22px;
            border-radius: 6px;
            background: var(--brand);
            flex: none
        }

        .bar .t small {
            font-weight: 400;
            color: var(--ink3);
            font-size: 12.5px;
            font-variant-numeric: tabular-nums
        }

    .bar .r {
        font-size: 12.5px;
        color: var(--ink2);
        display: flex;
        align-items: center;
        gap: 16px
    }

        .bar .r b {
            color: var(--ink);
            font-weight: 700
        }

        .bar .r .sep {
            width: 1px;
            height: 14px;
            background: var(--line);
            font-size: 0;
            overflow: hidden
        }

        .bar .r button {
            height: 28px;
            padding: 0 11px;
            font-size: 12px;
            font-weight: 600;
            color: var(--ink2);
            background: var(--surf);
            border: 1px solid var(--line);
            border-radius: var(--r1)
        }

            .bar .r button:hover {
                background: var(--surf2)
            }

/* ── 1층 (서랍 6칸) ── */
.tabs {
    background: var(--surf);
    border-bottom: 1px solid var(--line);
    padding: 0 24px;
    display: flex;
    gap: 4px
}

.tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 46px;
    padding: 0 16px;
    font-size: var(--fs-tab);
    font-weight: 600;
    color: var(--ink2);
    background: none;
    border: none
}

    .tab:hover {
        color: var(--ink)
    }

    .tab.on {
        color: var(--brand);
        font-weight: 700;
        box-shadow: inset 0 -2px 0 var(--brand)
    }

    .tab.quiet {
        color: var(--ink3)
    }

.badge {
    min-width: 17px;
    height: 17px;
    padding: 0 5px;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: var(--badge-bg);
    border-radius: var(--radius-pill);
    font-variant-numeric: tabular-nums
}

    .badge.show {
        display: inline-flex
    }

/* ── 2층 (소탭) ── */
.stabs {
    background: var(--surf2);
    border-bottom: 1px solid var(--line);
    padding: 9px 24px;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none
}

    .stabs::-webkit-scrollbar {
        display: none
    }

.stab {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 13px;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink2);
    background: none;
    border: 1px solid transparent;
    border-radius: var(--radius-pill)
}

    .stab:hover {
        background: var(--surf);
        border-color: var(--line)
    }

    .stab.on {
        font-weight: 700;
        color: var(--ink);
        background: var(--surf);
        border-color: var(--ink4)
    }

    .stab .badge {
        min-width: 16px;
        height: 16px;
        font-size: 10.5px
    }

/* ── 레이아웃 공통 ── */
.wrap {
    padding: 24px 24px 60px;
    max-width: 1440px;
    margin: 0 auto
}

.pane {
    display: none
}

    .pane.on {
        display: block
    }

.toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap
}

    .toolbar h2 {
        font-size: var(--fs-title);
        font-weight: 800;
        letter-spacing: -.01em;
        color: var(--ink)
    }

    .toolbar .sp {
        flex: 1
    }

.search {
    height: var(--control-h);
    width: 300px;
    max-width: 100%;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: var(--r1);
    font-size: 13px;
    color: var(--ink);
    background: var(--surf);
    outline: none
}

    .search:focus {
        border-color: var(--brand);
        box-shadow: 0 0 0 3px var(--brand-soft)
    }

.chip {
    height: 30px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 600;
    background: var(--surf);
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    color: var(--ink2);
    white-space: nowrap
}

    .chip:hover {
        border-color: var(--ink4);
        color: var(--ink)
    }

    .chip.on {
        background: var(--ink);
        border-color: var(--ink);
        color: #fff;
        font-weight: 700
    }

    /* 검토 화면 「묶음」 칩 — 네모꼴 + 고른 것은 파랑 (V405 시안) */
    .chip.kind {
        height: 32px;
        border-radius: var(--r1);
        color: var(--ink)
    }

        .chip.kind.on {
            background: var(--brand);
            border-color: var(--brand);
            color: #fff
        }

    .chip .kn {
        min-width: 18px;
        height: 18px;
        padding: 0 5px;
        display: none;
        align-items: center;
        justify-content: center;
        font-size: 11px;
        font-weight: 700;
        color: #fff;
        background: var(--red);
        border-radius: var(--radius-pill);
        font-variant-numeric: tabular-nums
    }

        .chip .kn.show {
            display: inline-flex
        }

    .chip.on .kn {
        color: var(--brand);
        background: #fff
    }

.btn {
    height: 30px;
    padding: 0 11px;
    font-size: var(--fs-button);
    font-weight: 600;
    color: var(--ink2);
    background: var(--surf);
    border: 1px solid var(--line);
    border-radius: var(--r1);
    white-space: nowrap
}

    .btn:hover {
        background: var(--surf2);
        color: var(--ink)
    }

    .btn:active {
        background: var(--line2)
    }

/* ── 카드·표 ── */
.card {
    background: var(--surf);
    border: 1px solid var(--line);
    border-radius: var(--r2);
    box-shadow: var(--sh1);
    overflow: hidden
}

table {
    border-collapse: collapse;
    width: 100%;
    background: var(--surf)
}

thead th {
    background: var(--surf2);
    border-bottom: 1px solid var(--line);
    padding: 10px var(--cell-x);
    font-size: var(--fs-thead);
    font-weight: 700;
    letter-spacing: .02em;
    color: var(--ink2);
    text-align: left;
    white-space: nowrap
}

tbody td {
    border-bottom: 1px solid var(--line2);
    padding: var(--cell-y) var(--cell-x);
    font-size: var(--fs-table);
    vertical-align: middle
}

tbody tr:last-child td {
    border-bottom: none
}

.aca-row {
    cursor: pointer
}

    .aca-row:hover {
        background: var(--surf2)
    }

    .aca-row.sel {
        background: var(--brand-soft);
        box-shadow: inset 3px 0 0 var(--brand)
    }

.tfoot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    background: var(--surf2);
    border-top: 1px solid var(--line2);
    padding: 10px 14px;
    font-size: 12px;
    color: var(--ink3);
    font-variant-numeric: tabular-nums
}

/* ── 상태 표기 ── */
.st {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    font-weight: 600
}

    .st i {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        display: inline-block;
        flex: 0 0 auto
    }

    .st.ok i {
        background: var(--green)
    }

    .st.ok {
        color: var(--green)
    }

    .st.stop i {
        background: var(--red)
    }

    .st.stop {
        color: var(--red)
    }

/* ── 홈 「처리 대기」 카드 (V405) ── */
.kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(170px,1fr));
    gap: 12px;
    margin-bottom: 20px
}

.kpi {
    background: var(--surf);
    border: 1px solid var(--line);
    border-radius: var(--r2);
    padding: 14px 16px;
    text-align: left;
    display: block
}

    .kpi:hover {
        border-color: var(--brand-line);
        box-shadow: var(--sh1)
    }

    .kpi .kl {
        font-size: 12.5px;
        color: var(--ink2)
    }

    .kpi .kv {
        display: flex;
        align-items: baseline;
        gap: 5px;
        margin-top: 5px
    }

        .kpi .kv b {
            font-size: 26px;
            font-weight: 800;
            font-variant-numeric: tabular-nums
        }

        .kpi .kv span {
            font-size: 12px;
            color: var(--ink3)
        }

    .kpi.hot {
        border-color: var(--brand-line)
    }

        .kpi.hot .kl {
            color: var(--brand);
            font-weight: 600
        }

        .kpi.hot .kv b {
            color: var(--brand)
        }

    .kpi.zero {
        cursor: default
    }

        .kpi.zero .kl {
            color: var(--ink3)
        }

        .kpi.zero .kv b, .kpi.zero .kv span {
            color: var(--ink4)
        }

.kpi-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    color: var(--ink3);
    margin-bottom: 10px
}

/* ── 학원 관리 배치 ── */
.aca-grid {
    display: grid;
    grid-template-columns: 1fr var(--panel-w);
    gap: 20px;
    align-items: start
}

.panel {
    background: var(--surf);
    border: 1px solid var(--line);
    border-radius: var(--r2);
    box-shadow: var(--sh1);
    padding: 20px var(--pad-section)
}

    .panel .pid {
        font-size: 11px;
        color: var(--ink3);
        font-variant-numeric: tabular-nums
    }

    .panel h3 {
        font-size: var(--fs-title);
        font-weight: 800;
        letter-spacing: -.01em;
        color: var(--ink);
        margin: 2px 0 4px
    }

    .panel .sub {
        font-size: 12.5px;
        color: var(--ink2)
    }

.metrics {
    display: grid;
    grid-template-columns: repeat(4,1fr);
    border: 1px solid var(--line);
    border-radius: var(--r2);
    background: var(--surf);
    margin: 16px 0;
    overflow: hidden
}

.metric {
    padding: 12px 14px
}

    .metric + .metric {
        border-left: 1px solid var(--line2)
    }

    .metric b {
        display: block;
        font-size: var(--fs-label);
        font-weight: 600;
        color: var(--ink3);
        margin-bottom: 4px
    }

    .metric span {
        font-size: var(--fs-metric);
        font-weight: 800;
        font-variant-numeric: tabular-nums;
        color: var(--ink)
    }

.stopbox {
    background: var(--red-soft);
    border: 1px solid var(--red-line);
    border-radius: var(--r2);
    padding: 12px 14px;
    font-size: 12.5px;
    color: var(--red);
    margin-bottom: 16px
}

.codes-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin: 4px 0 10px;
    gap: 10px;
    flex-wrap: wrap
}

    .codes-head h4 {
        font-size: 13.5px;
        font-weight: 800;
        color: var(--ink)
    }

    .codes-head small {
        font-size: 12px;
        color: var(--ink3)
    }

.code-card {
    background: var(--surf);
    border: 1px solid var(--line);
    border-radius: var(--r2);
    overflow: hidden
}

    .code-card td {
        padding: var(--cell-y-sm) 10px;
        font-size: var(--fs-table-sm);
        white-space: nowrap        /* 좁은 패널이라 칸이 세로로 찌그러지지 않게 */
    }

    .code-card table {
        table-layout: auto
    }

.rvk {
    height: 28px;
    padding: 0 10px;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--red);
    background: var(--surf);
    border: 1px solid var(--red-line);
    border-radius: var(--r1);
    white-space: nowrap
}

    .rvk:hover {
        background: var(--red);
        color: #fff;
        border-color: var(--red)
    }

.dash {
    color: var(--ink4)
}

/* ── 입금 관리 ── */
.pay-cell {
    cursor: pointer
}

    .pay-cell:hover {
        background: var(--surf2)
    }

    .pay-cell.cur {
        background: var(--brand-soft)
    }

.pay-zero {
    color: var(--ink4)
}

.mform label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    margin: 14px 0 6px;
    color: var(--ink2)
}

.mform input, .mform select, .mform textarea {
    width: 100%;
    padding: 10px 12px;
    font-size: 13.5px;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: var(--r1);
    background: var(--surf);
    outline: none
}

    .mform input:focus, .mform select:focus, .mform textarea:focus {
        border-color: var(--brand);
        box-shadow: 0 0 0 3px var(--brand-soft)
    }

/* ── 본사 공지 — 대상 학원 체크 목록 ── */
.nt-targets {
    max-height: 180px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: var(--r1);
    padding: 6px 10px;
    background: var(--surf);
    font-size: 13px
}

    .nt-targets label {
        display: block;
        margin: 4px 0;
        font-weight: 400;
        font-size: 13px;
        color: inherit
    }

    .nt-targets input {
        width: auto;
        margin-right: 6px
    }

.nt-body {
    white-space: pre-wrap;
    color: var(--ink2);
    font-size: 12.5px;
    margin-top: 3px;
    max-width: 520px
}

tr.nt-off td {
    opacity: .55
}

/* ── 문의 — 답변 대기 · 답변 칸 · 종류 칩 ── */
.st.wait i {
    background: var(--amber)
}

.st.wait {
    color: var(--amber)
}

.iq-reply {
    white-space: pre-wrap;
    font-size: 12.5px;
    margin-top: 6px;
    padding: 9px 12px;
    border-radius: var(--r1);
    background: var(--green-soft);
    border: 1px solid var(--green-line);
    color: var(--green);
    max-width: 520px
}

.iq-cat {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    background: var(--surf2);
    border: 1px solid var(--line);
    color: var(--ink2);
    margin-right: 6px;
    vertical-align: middle
}

/* ── 교재 ── */
.bk-thumb {
    width: 34px;
    height: 46px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--line);
    background: var(--surf2);
    display: block
}

.bk-nocover {
    width: 34px;
    height: 46px;
    border-radius: 4px;
    border: 1px dashed var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9.5px;
    color: var(--ink3)
}

.ord-item {
    display: flex;
    align-items: center;
    gap: 10px
}

    .ord-item .tt {
        font-weight: 700;
        color: var(--ink)
    }

    .ord-item small {
        display: block;
        color: var(--ink2);
        font-weight: 400;
        margin-top: 2px
    }

.bk-mini {
    height: 28px;
    padding: 0 10px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--ink2);
    background: var(--surf);
    border: 1px solid var(--line);
    border-radius: var(--r1);
    white-space: nowrap;
    margin-right: 4px
}

    .bk-mini:hover {
        background: var(--surf2);
        color: var(--ink)
    }

.bk-stock {
    cursor: pointer;
    border: none;
    background: none;
    font-size: 11.5px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: var(--radius-pill)
}

    .bk-stock.on {
        background: var(--green-soft);
        color: var(--green);
        border: 1px solid var(--green-line)
    }

    .bk-stock.off {
        background: var(--amber-soft);
        color: var(--amber);
        border: 1px solid var(--amber-line)
    }

.bk-prev {
    width: 124px;
    height: 168px;
    object-fit: cover;
    border-radius: var(--r1);
    border: 1px solid var(--line);
    background: var(--surf2);
    display: block;
    margin: 0 auto 12px
}

.bk-off td {
    color: var(--ink4)
}

/* ── 주문 ── */
.ord-row {
    cursor: pointer
}

    .ord-row:hover {
        background: var(--surf2)
    }

    .ord-row.open {
        background: var(--brand-soft)
    }

.ord-pill {
    display: inline-block;
    font-size: 11.5px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    white-space: nowrap
}

    .ord-pill.received {
        background: var(--amber-soft);
        color: var(--amber);
        border: 1px solid var(--amber-line)
    }

    .ord-pill.shipping {
        background: var(--brand-soft);
        color: var(--brand);
        border: 1px solid var(--brand-line)
    }

    .ord-pill.done {
        background: var(--green-soft);
        color: var(--green);
        border: 1px solid var(--green-line)
    }

    .ord-pill.canceled {
        background: var(--surf2);
        color: var(--ink3);
        border: 1px solid var(--line)
    }

.ord-detail td {
    background: var(--surf2);
    padding: 16px var(--cell-x)
}

.ord-lines {
    width: 100%;
    background: var(--surf);
    border: 1px solid var(--line);
    border-radius: var(--r2);
    overflow: hidden
}

    .ord-lines th, .ord-lines td {
        font-size: var(--fs-table-sm);
        padding: var(--cell-y-sm) var(--cell-x)
    }

.ord-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 28px;
    margin-top: 12px;
    font-size: 12.5px;
    color: var(--ink2)
}

    .ord-meta b {
        color: var(--ink3);
        font-weight: 700;
        margin-right: 8px
    }

.ord-acts {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    flex-wrap: wrap
}

    .ord-acts .now {
        font-size: 12px;
        color: var(--ink3);
        margin-right: 4px
    }

/* ── 빈 상태 · 불러오는 중 · 실패 (시안 「상태들」) ── */
.empty {
    background: var(--surf);
    border: 1px solid var(--line);
    border-radius: var(--r2);
    padding: 38px 24px;
    text-align: center;
    color: var(--ink2);
    font-size: 12.5px;
    line-height: 1.55
}

    .empty::before {
        content: "";
        display: block;
        width: 36px;
        height: 36px;
        margin: 0 auto 12px;
        border-radius: var(--r2);
        background: var(--surf2);
        border: 1px solid var(--line)
    }

    .empty b {
        display: block;
        font-size: 14px;
        font-weight: 700;
        color: var(--ink);
        margin-bottom: 5px
    }

    .empty.bad::before {
        background: var(--red-soft);
        border-color: var(--red-line)
    }

    .empty.bad b {
        color: var(--red)
    }

.skel {
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding: 14px
}

    .skel i {
        display: block;
        height: 15px;
        border-radius: 4px;
        background: var(--line2)
    }

        .skel i:nth-child(1) { width: 88% }
        .skel i:nth-child(2) { width: 72% }
        .skel i:nth-child(3) { width: 80% }
        .skel i:nth-child(4) { width: 56% }

/* ── 신청·승인 카드 ── */
.app-card {
    background: var(--surf);
    border: 1px solid var(--line);
    border-radius: var(--r2);
    box-shadow: var(--sh1);
    padding: 18px 20px;
    margin-bottom: 14px
}

.app-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px
}

    .app-head .name {
        font-size: 16px;
        font-weight: 800;
        color: var(--ink)
    }

        .app-head .name small {
            color: var(--ink3);
            font-weight: 400;
            font-size: 12px;
            margin-left: 8px
        }

.pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap
}

    .pill.wait {
        background: var(--amber-soft);
        color: var(--amber);
        border: 1px solid var(--amber-line)
    }

    .pill.done {
        background: var(--green-soft);
        color: var(--green);
        border: 1px solid var(--green-line)
    }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill,minmax(220px,1fr));
    gap: 8px 18px;
    margin-top: 12px;
    font-size: 13px
}

    .grid b {
        color: var(--ink3);
        font-weight: 700;
        font-size: 11px;
        display: block
    }

.memo {
    margin-top: 10px;
    font-size: 12.5px;
    color: var(--ink2);
    background: var(--surf2);
    border: 1px solid var(--line2);
    border-radius: var(--r1);
    padding: 10px 12px
}

.approve-btn {
    height: 34px;
    margin-top: 14px;
    padding: 0 15px;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    background: var(--brand);
    border: none;
    border-radius: var(--r1);
    white-space: nowrap
}

    .approve-btn:hover {
        background: var(--brand-ink)
    }

    .approve-btn:disabled {
        background: var(--ink4);
        cursor: not-allowed
    }

.codes-box {
    margin-top: 14px;
    background: var(--ink);
    color: #fff;
    border-radius: var(--r2);
    padding: 14px 16px
}

    .codes-box .ct {
        font-size: 11px;
        color: var(--amber-line);
        font-weight: 700;
        letter-spacing: .08em;
        margin-bottom: 8px
    }

    .codes-box .cl {
        display: flex;
        align-items: center;
        gap: 10px;
        margin: 5px 0;
        font-size: 13px;
        flex-wrap: wrap
    }

        .codes-box .cl b {
            width: 130px;
            color: var(--ink4);
            font-weight: 600;
            font-size: 12px
        }

    .codes-box .code {
        font-size: 15px;
        letter-spacing: .05em;
        font-family: var(--font-mono);
        white-space: nowrap
    }

.copy {
    background: transparent;
    color: var(--amber-line);
    border: 1px solid var(--amber-line);
    border-radius: var(--r1);
    padding: 2px 10px;
    font-size: 11.5px
}

/* ── 확인창 ── */
#overlay {
    position: fixed;
    inset: 0;
    background: rgba(20,24,31,.45);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 50
}

.modal {
    width: 100%;
    max-width: 452px;
    background: var(--surf);
    border-radius: var(--r3);
    box-shadow: var(--sh2);
    padding: 24px
}

    .modal h4 {
        font-size: 17px;
        font-weight: 800;
        color: var(--ink);
        margin-bottom: 9px
    }

    .modal p {
        font-size: 13px;
        color: var(--ink2);
        line-height: 1.65;
        margin-bottom: 8px
    }

    .modal .mrow {
        display: flex;
        justify-content: space-between;
        gap: 10px;
        font-size: 12.5px;
        padding: 7px 0;
        border-bottom: 1px solid var(--line2)
    }

        .modal .mrow b {
            color: var(--ink3);
            font-weight: 700;
            white-space: nowrap
        }

    .modal .mtype {
        margin-top: 16px
    }

        .modal .mtype div {
            font-size: 12px;
            font-weight: 700;
            color: var(--ink2);
            margin-bottom: 6px
        }

        .modal .mtype input {
            width: 100%;
            height: 40px;
            padding: 0 12px;
            font-size: 13.5px;
            border: 1px solid var(--line);
            border-radius: var(--r1);
            outline: none
        }

            .modal .mtype input:focus {
                border-color: var(--brand);
                box-shadow: 0 0 0 3px var(--brand-soft)
            }

    .modal .btns {
        display: flex;
        gap: 8px;
        margin-top: 20px
    }

        .modal .btns button {
            flex: 1;
            height: 42px;
            font-size: 13.5px;
            font-weight: 700;
            border-radius: var(--r1)
        }

.rvk-final {
    color: #fff;
    background: var(--red);
    border: none
}

.modal .btns button:disabled {
    background: var(--ink4);
    border-color: var(--ink4);
    color: #fff;
    cursor: not-allowed
}

.modal .btns .cancel {
    color: var(--ink2);
    background: var(--surf);
    border: 1px solid var(--line)
}

/* ── 검토 화면 판정 단추 (V405 시안) — 지금 판정이 눌린 채로 보이고, AI 와 다르면 호박색 ── */
.jbtn {
    height: 32px;
    min-width: 56px;
    padding: 0 12px;
    margin-right: 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--ink2);
    background: var(--surf);
    border: 1px solid var(--line);
    border-radius: var(--r1)
}

    .jbtn:hover {
        border-color: var(--ink4);
        color: var(--ink)
    }

    .jbtn.on {
        color: var(--brand-ink);
        background: var(--brand-soft);
        border-color: var(--brand);
        box-shadow: inset 0 0 0 1px var(--brand)
    }

    .jbtn.on.diff {
        color: #fff;
        background: var(--amber);
        border-color: var(--amber);
        box-shadow: none
    }

.jmark {
    display: inline-block;
    margin-left: 2px;
    padding: 3px 7px;
    font-size: 11px;
    font-weight: 800;
    color: var(--amber);
    background: var(--amber-soft);
    border: 1px solid var(--amber-line);
    border-radius: var(--radius-pill)
}

tr.kor-diff td {
    background: #FFFBF4
}

tr.kor-teacher td {
    background: #FBFDFC
}

/* ── 탭 「운영 달력」 — md 문서를 그린 것. 30일 안 = 붉은 줄 · 지난 것 = 회색 ── */
.cal-h { margin: 18px 0 8px; font-size: 15px; font-weight: 800 }
.cal-h:first-child { margin-top: 0 }
.cal-note { padding: 11px 14px; margin: 6px 0 12px; font-size: 12.5px; color: var(--amber); background: var(--amber-soft); border: 1px solid var(--amber-line); border-radius: var(--r1) }
.cal-table { margin-bottom: 14px }
.cal-table td { vertical-align: top }
.cal-row-soon td { background: var(--amber-soft); color: var(--amber) }
.cal-row-soon td:first-child { font-weight: 700 }
.cal-row-past td { background: var(--red-soft); color: var(--red) }
.cal-row-past td:first-child { font-weight: 700 }
.cal-tag { display: inline-block; margin-left: 6px; padding: 2px 8px; font-size: 11px; font-weight: 700; border-radius: var(--radius-pill); background: var(--surf2); border: 1px solid var(--line); color: var(--ink2); text-decoration: none; white-space: nowrap }
.cal-tag.cal-soon { background: #fff; border-color: var(--amber-line); color: var(--amber) }
.cal-tag.cal-past { background: #fff; border-color: var(--red-line); color: var(--red) }
.cal-ok { color: var(--ink3); font-size: 13px }
.cal-ul { margin: 6px 0 4px 18px; padding: 0 }
.cal-ul li { margin: 3px 0 }
#calDoc code { font-size: 12px; padding: 1px 5px; background: var(--surf2); border: 1px solid var(--line2); border-radius: 4px }

/* ── 폰 (V405) — 표는 「한 줄 = 카드 한 장」, PC 전용은 숨김 ────────────────────────
   라벨은 core.js 의 cardify() 가 표 머리 글자를 읽어 td[data-l] 로 자동으로 붙인다. */
.pc-only { }

@media (max-width: 1100px) {
    .aca-grid {
        grid-template-columns: 1fr
    }

    .kpis {
        grid-template-columns: repeat(3,1fr)
    }
}

@media (max-width: 760px) {
    body {
        font-size: 13px
    }

    /* ★ 아이폰 자동 확대 막기 (V406) — 사파리는 글자가 16px 보다 작은 입력칸을 탭하면 화면을 저절로 확대하고,
       손을 떼도 되돌리지 않는다. 그래서 로그인 칸(14px)을 누르는 순간부터 화면이 폰 폭을 넘어가 옆으로 밀린다
       (손으로 축소하면 그 배율이 유지돼 그 뒤로는 맞게 보인다). 16px 이상이면 확대하지 않는다.
       inline style(font-size:12.5px) 로 적힌 칸도 있어 !important 로 폰에서만 덮는다.
       maximum-scale=1 로 막는 방법은 두 손가락 확대까지 죽여 쓰지 않는다. */
    input, select, textarea {
        font-size: 16px !important
    }

    .bar {
        height: auto;
        padding: 10px 16px;
        flex-wrap: wrap;
        gap: 6px
    }

        .bar .t {
            font-size: 14px
        }

            .bar .t small {
                font-size: 11.5px
            }

        .bar .r {
            gap: 9px;
            font-size: 11.5px;
            width: 100%;
            justify-content: flex-end
        }

            .bar .r .sep {
                display: none
            }

    .tabs {
        padding: 0;
        gap: 0
    }

    .tab {
        flex: 1;
        height: 42px;
        padding: 0 2px;
        font-size: 13px;
        justify-content: center;
        position: relative;
        gap: 0
    }

        .tab .badge {
            position: absolute;
            top: 4px;
            right: 4px;
            min-width: 15px;
            height: 15px;
            padding: 0 4px;
            font-size: 9.5px
        }

    .stabs {
        padding: 8px 16px
    }

    .wrap {
        padding: 14px 16px 40px
    }

    .toolbar {
        gap: 8px;
        margin-bottom: 12px
    }

        .toolbar h2 {
            font-size: 17px;
            width: 100%
        }

    .search {
        width: 100%
    }

    .kpis {
        grid-template-columns: 1fr 1fr;
        gap: 8px
    }

        .kpi {
            padding: 11px 13px
        }

            .kpi .kv b {
                font-size: 21px
            }

    .metrics {
        grid-template-columns: 1fr 1fr
    }

        .metric:nth-child(odd) + .metric {
            border-left: 1px solid var(--line2)
        }

        .metric:nth-child(3) {
            border-left: none;
            border-top: 1px solid var(--line2)
        }

        .metric:nth-child(4) {
            border-top: 1px solid var(--line2)
        }

    .panel {
        padding: 16px
    }

    /* 표 → 카드 */
    .card table, .card thead, .card tbody, .card tr, .card td {
        display: block;
        width: auto
    }

    .card thead {
        display: none
    }

    .card tbody tr {
        display: flex;
        flex-direction: column;
        border-bottom: 1px solid var(--line);
        padding: 4px 0
    }

        .card tbody tr:last-child {
            border-bottom: none
        }

    .card tbody td {
        border: none;
        padding: 5px 14px;
        display: flex;
        gap: 12px;
        align-items: baseline;
        text-align: left !important;
        min-width: 0;
        overflow-wrap: anywhere    /* 띄어쓰기 없는 긴 값(토큰·지문·주소)이 카드를 밀어내지 않게 (V406) */
    }

        .card tbody td[data-l]::before {
            content: attr(data-l);
            flex: none;
            width: 84px;
            font-size: 11.5px;
            font-weight: 700;
            color: var(--ink3)
        }

        .card tbody td.hd {
            order: -1;                 /* 제목 칸은 카드 맨 위로 */
            font-size: 14.5px;
            font-weight: 700;
            padding-top: 11px
        }

            .card tbody td.hd::before {
                display: none
            }

    /* 폰에서 숨기는 것 = 파일 올리기·내려받기 (PC 에서 하십시오) */
    .pc-only {
        display: none !important
    }

    .pc-note {
        display: block;
        margin: 10px 0;
        padding: 11px 13px;
        font-size: 12.5px;
        color: var(--ink2);
        background: var(--surf2);
        border: 1px dashed var(--line);
        border-radius: var(--r1)
    }

    .modal {
        padding: 18px
    }

    .ord-meta {
        gap: 6px 16px
    }
}

@media (min-width: 761px) {
    .pc-note {
        display: none
    }
}
