@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css');
/* Cool English admin — dark sidebar + light main */
:root {
    --bg-app: #f6f8fb;
    --bg-panel: #ffffff;
    --border-soft: #e2e8f0;
    --border-mid: #cbd5e1;
    --text-base: #0f172a;
    --text-muted: #475569;
    --text-faint: #64748b;

    --sidebar-bg: #14264a;
    --sidebar-bg-2: #0c1830;
    --sidebar-text: #ffffff;
    --sidebar-text-muted: #ffffff;
    --sidebar-section-label: #93c5fd;
    --sidebar-active-bg: #2d4b70;
    --sidebar-active-fg: #ffffff;
    --sidebar-active-bar: #93c5fd;

    --accent: #2a5f5e;
    --accent-strong: #1f4a4a;
    --positive: #15803d;
    --negative: #b91c1c;
    --neutral: #475569;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, .08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-app);
    color: var(--text-base);
    font-size: 17px;
    line-height: 1.55;
    letter-spacing: -.005em;
    -webkit-font-smoothing: antialiased;
}
.muted { color: var(--text-muted); }
.muted.small { color: var(--text-faint); }

a { color: inherit; text-decoration: none; }

.app-shell {
    display: flex;
    min-height: 100vh;
}

/* ===== Sidebar ===== */

.sidebar {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    width: 248px;
    flex-shrink: 0;
    background: linear-gradient(180deg, #14264a 0%, #1a3a6b 42%, #0b1730 100%);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    scrollbar-width: none;        /* Firefox: 스크롤바 숨김 */
    -ms-overflow-style: none;     /* 구 Edge/IE */
}
/* Chrome/Safari: 사이드바 우측 세로 스크롤바(경계선처럼 보이던 것) 숨김. 휠/터치 스크롤은 유지 */
.sidebar::-webkit-scrollbar { width: 0; height: 0; display: none; }

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    background: rgba(0,0,0,.08);
}
.brand-mark {
    width: 38px; height: 38px;
    border-radius: 9px;
    background: linear-gradient(135deg, #34d399, #059669);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; letter-spacing: -0.5px;
    font-size: 16px;
    flex-shrink: 0;
}
.brand-logo-img {
    width: 38px; height: 38px;
    border-radius: 9px;
    object-fit: cover;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,.25);
    flex-shrink: 0;
}
.brand-text strong {
    display: block;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.2px;
}
.brand-text span {
    display: block;
    color: var(--sidebar-text-muted);
    font-size: 11.5px;
    margin-top: 2px;
}

.sidebar-section {
    padding: 16px 12px 4px;
}
.section-label {
    color: var(--sidebar-section-label);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0 8px 6px;
}
.sidebar-nav {
    display: flex; flex-direction: column;
    gap: 2px;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-radius: 7px;
    color: var(--sidebar-text);
    font-size: 16px;
    font-weight: 450;
    letter-spacing: -0.01em;
    transition: background-color .15s, color .15s;
    position: relative;
}
.nav-item i {
    font-size: 15px;
    width: 16px;
    color: var(--sidebar-text-muted);
    flex-shrink: 0;
}
.nav-item > span {
    font-style: normal;
}
.nav-item > span > i {
    font-style: normal;
    font-family: inherit;
}
.nav-item:hover {
    background: #93c5fd;
    color: #0f172a;
}
.nav-item:hover > i,
.nav-item:hover > span > i { color: #0f172a; }
.nav-item.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-fg);
    font-weight: 600;
}
.nav-item.active > i { color: var(--sidebar-active-bar); }
.nav-item.active > span > i { color: var(--sidebar-active-fg); }
.nav-item.active::before {
    content: "";
    position: absolute;
    left: -12px;
    top: 6px; bottom: 6px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--sidebar-active-bar);
}
.badge-count {
    margin-left: auto;
    background: rgba(255,255,255,0.08);
    color: #cbd5e1;
    font-size: 13px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 999px;
}

/* Logout button styled as a nav-item */
.sidebar-nav .nav-item-form {
    margin: 0; padding: 0; display: block; width: 100%;
}
.nav-item-logout {
    background: none;
    border: 0;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
}

.sidebar-foot {
    margin-top: auto;
    padding: 16px;
}
.academy-card {
    background: var(--sidebar-bg-2);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    padding: 12px 14px;
}
.ac-label {
    color: var(--sidebar-text-muted);
    font-size: 13px;
    margin-top: 4px;
}
.ac-name {
    color: #fff;
    font-weight: 600;
    font-size: 14.5px;
    margin-bottom: 8px;
}
.ac-switch {
    color: #60a5fa;
    font-size: 13px;
    display: inline-flex; align-items: center; gap: 4px;
}

/* ===== Main ===== */
.main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: 60px;
    /* 좌측은 사이드바 이음새 색, 우측으로 갈수록 밝은 로열 블루 그라디언트 */
    background: linear-gradient(90deg, #14264a 0%, #24457e 55%, #2f5aa0 100%);
    border-bottom: 1px solid rgba(0,0,0,0.15);
    box-shadow: 0 2px 8px rgba(15, 23, 42, .18);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 10;
    color: #ecfdf5;
}
.topbar-left, .topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
.btn-icon {
    width: 36px; height: 36px;
    border: none;
    background: transparent;
    color: #cbd5e1;
    border-radius: 8px;
    display: inline-flex;
    align-items: center; justify-content: center;
    position: relative;
    cursor: pointer;
    transition: background-color .15s, color .15s;
}
.btn-icon:hover { background: rgba(255,255,255,.1); color: #fff; }
.btn-icon .dot {
    position: absolute;
    top: 9px; right: 10px;
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #f87171;
    border: 2px solid #1f3a5f;
}
.search-input {
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 8px;
    background: rgba(255,255,255,.08);
    padding: 8px 14px;
    font-size: 15px;
    width: 320px;
    color: #f8fafc;
    outline: none;
    transition: border-color .15s, background .15s;
}
.search-input::placeholder { color: #94a3b8; }
.search-input:focus {
    background: rgba(255,255,255,.14);
    border-color: #60a5fa;
    box-shadow: 0 0 0 2px rgba(96,165,250,.15);
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 10px 4px 4px;
    border-radius: 999px;
    cursor: pointer;
    transition: background-color .15s;
}
.user-chip:hover { background: rgba(255,255,255,.08); }
.avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 600;
    font-size: 15px;
    box-shadow: 0 2px 4px rgba(29,78,216,.35);
}
.user-meta strong { display: block; font-size: 15px; line-height: 1.2; color: #fff; }
.user-meta span { display: block; font-size: 13px; color: #94a3b8; }

/* ===== Page ===== */
.page {
    padding: 28px 32px 60px;
    max-width: 1480px;
    width: 100%;
}
.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
}
.page-title {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.6px;
    margin: 0;
    line-height: 1.25;
    color: #0f172a;
}
.page-sub {
    color: var(--text-muted);
    font-size: 16px;
    margin: 6px 0 0;
    line-height: 1.5;
}
.page-actions {
    display: flex;
    gap: 8px;
}
.page-actions .btn-dark {
    background: linear-gradient(135deg, #3a6fc0 0%, #223f66 100%);
    border-color: #2a4d7a;
    color: #fff;
}
.page-actions .btn-dark:hover {
    background: linear-gradient(135deg, #4a7fd0 0%, #2a4d7a 100%);
    border-color: #345a95;
    color: #fff;
}

/* KPI */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}
.kpi-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    padding: 18px 20px;
    position: relative;
    overflow: hidden;
}
/* 학생화면 톤과 통일 — 좌측 5px accent bar + 상단 옅은 컬러 워시 */
.kpi-card--blue   { border-left: 5px solid #3b82f6; background: linear-gradient(180deg, #eff6ff 0%, #fff 45%); }
.kpi-card--yellow { border-left: 5px solid #f59e0b; background: linear-gradient(180deg, #fef3c7 0%, #fff 45%); }
.kpi-card--green  { border-left: 5px solid #22c55e; background: linear-gradient(180deg, #dcfce7 0%, #fff 45%); }
.kpi-card--pink   { border-left: 5px solid #ec4899; background: linear-gradient(180deg, #fce7f3 0%, #fff 45%); }
.kpi-card--purple { border-left: 5px solid #8b5cf6; background: linear-gradient(180deg, #ede9fe 0%, #fff 45%); }

.kpi-card--blue   .kpi-label { color: #1d4ed8; }
.kpi-card--yellow .kpi-label { color: #b45309; }
.kpi-card--green  .kpi-label { color: #15803d; }
.kpi-card--pink   .kpi-label { color: #be185d; }
.kpi-card--purple .kpi-label { color: #6d28d9; }

.kpi-label {
    color: var(--text-muted);
    font-size: 14.5px;
    font-weight: 600;
    margin-bottom: 8px;
}
.kpi-value {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-base);
}
.kpi-value .unit {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-muted);
    margin-left: 4px;
}
.kpi-delta {
    margin-top: 8px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}
.kpi-delta.up { color: var(--positive); }
.kpi-delta.down { color: var(--negative); }
.kpi-delta.neutral { color: var(--neutral); }

/* Charts row */
.chart-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}
.panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
}
/* 패널 색상 variants — 헤더 배경 + 좌측 라인 (학생화면 톤) */
.panel--blue   { border-left: 5px solid #3b82f6; }
.panel--yellow { border-left: 5px solid #f59e0b; }
.panel--green  { border-left: 5px solid #22c55e; }
.panel--pink   { border-left: 5px solid #ec4899; }
.panel--purple { border-left: 5px solid #8b5cf6; }

.panel--blue   .panel-head { background: linear-gradient(90deg, #eff6ff 0%, #fff 60%); }
.panel--yellow .panel-head { background: linear-gradient(90deg, #fef3c7 0%, #fff 60%); }
.panel--green  .panel-head { background: linear-gradient(90deg, #dcfce7 0%, #fff 60%); }
.panel--pink   .panel-head { background: linear-gradient(90deg, #fce7f3 0%, #fff 60%); }
.panel--purple .panel-head { background: linear-gradient(90deg, #ede9fe 0%, #fff 60%); }

.panel--blue   .panel-title { color: #1e40af; }
.panel--yellow .panel-title { color: #92400e; }
.panel--green  .panel-title { color: #15803d; }
.panel--pink   .panel-title { color: #be185d; }
.panel--purple .panel-title { color: #6d28d9; }

.panel-head {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-soft);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.panel-title {
    font-size: 15.5px;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.3px;
    color: #0f172a;
}
.panel-tools {
    color: var(--text-muted);
    font-size: 13px;
}
.legend { display: inline-flex; align-items: center; gap: 6px; }
.dot-line, .dot-bar {
    display: inline-block;
    width: 10px; height: 10px;
    background: var(--accent);
    border-radius: 2px;
}
.dot-line { border-radius: 50%; }
.panel-body {
    padding: 18px 20px 20px;
}

.link-more {
    color: var(--text-muted);
    font-size: 13px;
    display: inline-flex; align-items: center; gap: 2px;
}
.link-more:hover { color: var(--accent); }

/* Bottom grid */
.bottom-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    /* 카드 높이를 서로 맞추면 짧은 쪽에 빈칸이 남는다 — 각자 내용만큼 */
    align-items: start;
}

/* Activity list */
.activity-list {
    list-style: none;
    margin: 0; padding: 0;
}
.activity-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px solid var(--border-soft);
}
.activity-list li:last-child { border-bottom: none; }
.activity-list .ico {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--bg-app);
    color: var(--text-muted);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}
.activity-list .ico.ok { background: #ecfdf5; color: #16a34a; }
.activity-list .ico.audio { background: #eff6ff; color: #2563eb; }
.activity-list .ico.test { background: #fef3c7; color: #b45309; }
.activity-list .ico.warn { background: #fee2e2; color: #dc2626; }
.activity-list .meta {
    flex: 1;
    min-width: 0;
    font-size: 15px;
    line-height: 1.5;
    /* 이름·활동과 시각을 한 줄에 — 시각은 오른쪽 끝 */
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.activity-list .meta strong { font-weight: 600; }
.activity-list .meta .txt {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.activity-list .meta .time {
    color: var(--text-muted);
    font-size: 13px;
    flex-shrink: 0;
}

/* Data table — 가독성 스케일 up */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14.5px;
}
.data-table th {
    text-align: left;
    color: #334155;
    font-weight: 700;
    font-size: 15px;
    padding: 8px 14px;
    background: #f1f5f9;
    border-bottom: 1px solid var(--border-soft);
    border-top: 1px solid #e2e8f0;
    letter-spacing: -.005em;
}
.data-table thead tr:first-child th:first-child { border-top-left-radius: 6px; }
.data-table thead tr:first-child th:last-child { border-top-right-radius: 6px; }
.data-table th.num { text-align: right; }
.data-table td {
    padding: 5px 14px;
    border-bottom: 1px solid var(--border-soft);
    color: var(--text-base);
}
.data-table tbody tr:hover td { background: #f8fafc; }

/* 행 높이 표준화 — 리스트마다 행 높이가 달라지던 원인 두 가지를 여기서 잡는다.
   1) 배지·버튼이 좁은 컬럼에서 2줄로 깨져 행이 두 배가 됐다 ("승인", "선생님" 등).
   2) 액션 버튼(.btn-sm)이 37px 라 행 높이를 혼자 지배했다. */
.data-table .btn,
.data-table .status,
.data-table .role-chip,
.data-table .chip { white-space: nowrap; }

.data-table .btn-sm {
    padding: 3px 10px;
    font-size: 12.5px;
    line-height: 1.6;
}

/* 학원·반 같은 짧은 메타 컬럼 — 좁은 폭에서 2줄로 깨지지 않게. */
.data-table td.nw, .data-table th.nw { white-space: nowrap; }
.data-table tr:last-child td { border-bottom: none; }
.data-table td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* 길어지는 목록: 내용만큼 늘어나다 약 10줄에서 스크롤.
   고정높이로 잡으면 데이터가 적을 때 빈칸이 생기므로 max-height 상한만 준다.
   스크롤 중에도 컬럼명이 보이도록 thead 는 sticky. */
.table-scroll { max-height: 420px; overflow-y: auto; }
/* 결과관리 목록 — 페이지당 22건. 페이지 이동을 쓰므로 내부 스크롤은 두지 않는다. */
.table-scroll.rows-22 { max-height: none; overflow-y: visible; }
.table-scroll.rows-22 thead th { position: static; }
/* 결과관리 목록 — 표준(학습설정) 화면과 폰트·줄간격 맞춤 */
.rows-22 .data-table th, .rows-22 .data-table td { padding-top: 8px; padding-bottom: 8px; }
.rows-22 .data-table .small { font-size: 14px; }
/* 페이지 번호는 가운데, 건수는 왼쪽 */
.pager.pager-center { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.pager.pager-center > .muted { grid-column: 1; }
.pager.pager-center > nav { grid-column: 2; justify-self: center; }
.table-scroll thead th { position: sticky; top: 0; z-index: 2; }
.data-table .rate {
    display: inline-block;
    padding: 2px 8px;
    background: #ecfdf5;
    color: #15803d;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
}

/* ===== Mini KPI strip (student list) ===== */
.kpi-strip {
    background: var(--bg-panel);
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 24px;
}
.ks-item { display: flex; flex-direction: column; gap: 2px; }
.ks-label { font-size: 13px; color: var(--text-muted); }
.ks-value { font-size: 20px; font-weight: 700; }
.ks-value.warn { color: #dc2626; }
.ks-divider { width: 1px; height: 30px; background: var(--border-soft); }

/* Filter bar */
.filter-bar {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-soft);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.fb-group { display: flex; gap: 8px; flex-wrap: wrap; }
.fb-group .form-select { width: auto; min-width: 110px; }
.fb-search {
    position: relative;
    width: 280px;
    max-width: 100%;
}
.fb-search .bi-search {
    position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); font-size: 15px;
}
.fb-search .form-control { padding-left: 30px; }

/* Students table */
.students-table th, .students-table td { padding-left: 14px; padding-right: 14px; }
.student-cell { display: flex; align-items: center; gap: 10px; }
.sc-name { font-weight: 600; }
.sc-meta { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }
.avatar-sm {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}
.avatar-lg {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 22px;
    font-weight: 600;
    flex-shrink: 0;
}
.chip {
    display: inline-block;
    padding: 3px 10px;
    background: #eef2f6;
    color: #334155;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #e2e8f0;
    line-height: 1.5;
}

/* Bootstrap 버튼/폼 크기 표준화 */
.btn {
    font-size: 16px;
    font-weight: 500;
    letter-spacing: -.005em;
    border-radius: 6px;
}
.btn-sm {
    font-size: 15px;
    padding: 6px 12px;
}
.btn-dark { background: linear-gradient(135deg, #3a6fc0 0%, #223f66 100%); border-color: #2a4d7a; color: #fff; }
.btn-dark:hover { background: linear-gradient(135deg, #4a7fd0 0%, #2a4d7a 100%); border-color: #345a95; color: #fff; }
/* outline-dark 버튼 hover/active — 새까맣게 채워지던 걸 밝은 로열블루로(관리자 톤 통일) */
.btn-outline-dark:hover, .btn-outline-dark:focus, .btn-outline-dark:active, .btn-outline-dark.active {
    background: #3a6fc0 !important; border-color: #3a6fc0 !important; color: #fff !important;
}
.form-control, .form-select {
    font-size: 16px;
    border-color: var(--border-soft);
    border-radius: 6px;
}
.form-control:focus, .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(31, 58, 95, .12);
}
.form-label {
    font-size: 15px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}
.row-clickable { cursor: pointer; }
.row-clickable:hover { background: #f8fafc; }

/* 학원명 편집 링크 — 강조 + hover 시 편집 아이콘 노출 */
.academy-name-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent);
    text-decoration: none;
    transition: color .15s;
}
.academy-name-link:hover { color: #3b82f6; text-decoration: underline; }
.academy-name-link .edit-hint {
    color: var(--text-faint);
    font-size: 13px;
    opacity: 0;
    transition: opacity .15s;
}
.academy-name-link:hover .edit-hint { opacity: 1; }
.row-actions { text-align: right; }

/* 얇은 막대 + 퍼센트는 오른쪽 바깥.
   글씨를 막대 안에 두면 얇을수록 눌려서 안 보인다. */
.rate-bar {
    position: relative;
    background: var(--bg-app);
    border-radius: 999px;
    height: 10px;
    min-width: 70px;
    display: inline-block;
    width: 100%;
    max-width: 96px;
    margin-right: 40px;      /* 바깥으로 뺀 퍼센트가 앉을 자리 */
    vertical-align: middle;
}
.rate-bar-fill {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    border-radius: 999px;
    /* 수행률은 주황 — 옆의 점수(파랑)와 눈으로 구분되게 */
    background: linear-gradient(90deg, #fb923c, #ea580c);
}
.rate-bar span {
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    font-weight: 700;
    color: #c2410c;
    line-height: 1;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.mt-1 { margin-top: 6px; }
.mt-3 { margin-top: 16px; }

.status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11.5px;
    font-weight: 600;
}
.status-on { background: #ecfdf5; color: #15803d; }
.status-warn { background: #fef3c7; color: #b45309; }
.status-off { background: #f3f4f6; color: #64748b; }

.pager {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--border-soft);
}
.pager nav { display: flex; gap: 4px; }
.pager .btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ===== Student detail ===== */
.breadcrumb-row { margin-bottom: 12px; }
.back-link {
    color: var(--text-muted);
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}
.back-link:hover { color: var(--accent); }

.student-head { align-items: center; }
.sh-left { display: flex; align-items: center; gap: 16px; }
.sh-left .page-title { font-size: 22px; }
.tag {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    margin-left: 6px;
}

.kpi-grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.kpi-sub { font-size: 13px; color: var(--text-muted); margin-top: 6px; }

/* 컴팩트 KPI — 라벨/값/부가 3줄짜리 카드가 상단을 과하게 먹어서,
   값과 부가정보를 한 줄로 붙여 2라인으로 만들고 높이를 약 110px → 55px 로 줄인다.
   긴 학원명·선생님명은 줄바꿈 대신 말줄임(카드 높이가 들쭉날쭉해지는 걸 막는다). */
.kpi-compact .kpi-card { padding: 9px 14px; }
.kpi-compact .kpi-label { font-size: 12.5px; margin-bottom: 3px; }
.kpi-compact .kpi-line { display: flex; align-items: baseline; gap: 7px; min-width: 0; }
.kpi-compact .kpi-value {
    font-size: 15px;
    letter-spacing: 0;
    flex: 0 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.kpi-compact .kpi-value .unit { font-size: 12.5px; }
.kpi-compact .kpi-sub {
    margin-top: 0;
    font-size: 12px;
    flex: 0 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.book-list { list-style: none; padding: 0; margin: 0; }
.book-list li {
    display: flex;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-soft);
    align-items: flex-start;
}
.book-list li:last-child { border-bottom: none; }
.bl-cover {
    width: 48px; height: 48px;
    background: var(--bg-app);
    border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.bl-done { opacity: 0.5; }
.bl-meta { flex: 1; }
.bl-title { font-weight: 600; font-size: 16px; }
.bl-sub { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.done-mark {
    display: inline-block;
    padding: 1px 6px;
    background: #ecfdf5;
    color: #15803d;
    font-size: 13px;
    border-radius: 3px;
    margin-left: 6px;
}

.badge-soft {
    display: inline-block;
    padding: 2px 8px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 13px;
    font-weight: 600;
    border-radius: 4px;
    margin-left: 8px;
    vertical-align: middle;
}

/* Responsive */
@media (max-width: 1200px) {
    .kpi-grid-5 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1100px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .kpi-grid-5 { grid-template-columns: repeat(2, 1fr); }
    .chart-grid { grid-template-columns: 1fr; }
    .bottom-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    .sidebar { display: none; }
    .search-input { width: 180px; }
    .page { padding: 18px; }
    .kpi-grid, .kpi-grid-5 { grid-template-columns: 1fr; }
    .kpi-strip { flex-wrap: wrap; gap: 12px; }
    .ks-divider { display: none; }
}

/* Laravel Bootstrap 페이지네이션 뷰가 prev/next 를 원본 사이즈 SVG 로 렌더 —
   전역으로 크기 제한. */
.pagination .page-link svg {
    width: 14px; height: 14px;
    display: inline-block; vertical-align: middle;
}
.pagination .page-link { display: inline-flex; align-items: center; justify-content: center; }

/* 한글만 시각적으로 1단계 작게 (unicode-range 기반) */
@font-face {
    font-family: 'Noto Sans KR Scaled';
    src: local('Noto Sans KR');
    unicode-range: U+AC00-D7AF, U+1100-11FF, U+3130-318F, U+A960-A97F, U+D7B0-D7FF;
    size-adjust: 90%;
}
.student-body { font-family: 'Noto Sans KR Scaled', 'Noto Sans KR', sans-serif; }

/* 학습명 hover 시 단계 상세 tooltip */
.step-tooltip {
    display: none;
    position: absolute;
    left: 0;
    top: 100%;
    z-index: 100;
    background: #fff;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(15,23,42,.12);
    padding: 4px 0;
    min-width: 240px;
    margin-bottom: 4px;
    font-size: 11px;
    color: #1e40af;
    font-weight: 400;
}

.study-name-link:hover .step-tooltip { display: block; }

.step-tooltip.tt-up { top: auto; bottom: 100%; margin-bottom: 4px; margin-top: 0; }
.step-tooltip.tt-down { bottom: auto; top: 100%; margin-top: 4px; margin-bottom: 0; }

/* 학습결과 페이지 하단 tooltip 여백 확보 */
body:has(.data-table .study-name-link) main { padding-bottom: 240px; }

/* 클릭 가능한 요소는 블루계열로 통일 — '여기 누를 수 있다'를 한 가지 색으로 알린다.
   (학습명·학생명·점수 등. 예전엔 study-name-link 만 검정이라 클릭 가능한지 몰랐다) */
a.study-name-link, a.student-link, a.score-link { color: #2563eb; text-decoration: none; cursor: pointer; }
/* 행 전체가 클릭되는 목록의 제목 — 링크 태그가 아니어서 위 규칙에 안 걸리므로 따로 둔다.
   (.study-name-link 를 쓰면 하단 240px 패딩 규칙까지 딸려온다) */
.row-title { color: #2563eb; font-weight: 500; }
/* 학생·선생 목록의 이름 — 행 전체가 클릭되는 표에서만 블루.
   .sc-name 자체를 바꾸면 클릭과 무관한 화면의 이름까지 파래진다. */
tr.row-clickable .sc-name { color: #2563eb; font-weight: 500; }
tr.row-clickable:hover .sc-name { text-decoration: underline; }
tr:hover .row-title { text-decoration: underline; }
a.study-name-link:hover, a.student-link:hover, a.score-link:hover { color: #1d4ed8; text-decoration: underline; }

/* 사이드바 서브메뉴 */
.nav-group { list-style: none; }
.nav-group summary { list-style: none; cursor: pointer; }
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group > summary::after { content: '▸'; float: right; opacity: .5; transition: transform .2s; }
.nav-group[open] > summary::after { content: '▾'; }
.nav-sub {
    display: block;
    position: relative;
    padding: 7px 16px 7px 44px;
    font-size: 15px;
    color: #ffffff;
    font-weight: 400;
    text-decoration: none;
    border-radius: 6px;
}
.nav-sub:hover { color: #fff; background: rgba(255,255,255,.20); }
.nav-sub.active {
    color: #fff;
    font-weight: 400;
    background: rgba(255,140,71,.22);
    box-shadow: inset 0 0 0 1px rgba(255,140,71,.4);
}
.nav-sub.active::before {
    content: "";
    position: absolute;
    left: 30px; top: 50%;
    transform: translateY(-50%);
    width: 4px; height: 16px;
    border-radius: 3px;
    background: #ff8c47;
}

/* 필터 폼 가로 정렬 (녹음결과 페이지) */
.filter-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filter-field { display: flex; flex-direction: column; gap: 4px; min-width: 140px; }
.filter-field.flex-grow-1 { flex: 1; min-width: 200px; }
.filter-panel { padding: 12px 16px; margin-bottom: 12px; }
.filter-field label { font-size: 12px; color: #64748b; margin: 0; }

.nav-item.nav-item-tight { letter-spacing: 0; }

/* Sharper borders for readability (global admin) */
.card, .panel, .kpi-card, .block, .list-group-item,
.hub-tile, .content-card, .item-card,
.form-control, .form-select, table.table {
    border-color: #94a3b8 !important;
}
.card, .panel, .kpi-card, .block, .content-card, .item-card {
    border-width: 2px !important;
    border-style: solid !important;
}

.nav-item .nav-label-4 { letter-spacing: 0.5em; margin-right: -0.5em; }

/* ========== 관리자 모바일 사이드 드로어 ========== */
[x-cloak] { display: none !important; }
.admin-mburger {
    display: none;
    position: fixed; top: 12px; left: 12px; z-index: 1060;
    width: 40px; height: 40px; border-radius: 8px;
    background: #1a2f4a; color: #fff; border: 0;
    font-size: 20px; cursor: pointer;
    box-shadow: 0 4px 12px rgba(15,23,42,.2);
    align-items: center; justify-content: center;
}
.admin-mback {
    display: none;
    position: fixed; inset: 0;
    background: rgba(15,23,42,.55);
    z-index: 1040;
}
@media (max-width: 720px) {
    .admin-mburger { display: inline-flex; }
    .admin-mback { display: block; }
    .sidebar {
        display: flex !important;
        position: fixed !important;
        top: 0; left: 0; bottom: 0;
        width: 260px; max-width: 82vw;
        z-index: 1050;
        transform: translateX(-100%);
        transition: transform .22s cubic-bezier(.4,0,.2,1);
        box-shadow: 4px 0 20px rgba(15,23,42,.35);
    }
    .app-shell.mside-open .sidebar { transform: translateX(0); }
    .page { padding: 14px 12px 60px; }
    .page-head, .page-title { font-size: 18px; }
    /* 제목·설명·탭·버튼을 한 줄에 밀어넣으면 폭이 모자라 글자가 세로로 쌓인다.
       좁은 화면에서는 위에서 아래로 흐르게 둔다. */
    .page-head { flex-direction: column; align-items: stretch; gap: 10px; }
    .page-sub { margin: 0; }
    /* 테이블 가로 스크롤 */
    .card > .table-responsive-wrap, .card table {
        display: block; overflow-x: auto; -webkit-overflow-scrolling: touch;
    }
    .lt-list-table, .pay-table, table.table {
        min-width: 640px;
    }
}

/* 관리자 하단 고정 탭바 (모바일 전용) */
.admin-bottombar {
    display: none;
    position: fixed; left: 0; right: 0; bottom: 0;
    background: #fff;
    border-top: 1px solid #e5e9ef;
    padding: 6px 0 max(6px, env(safe-area-inset-bottom));
    z-index: 1030;
    justify-content: space-around;
    box-shadow: 0 -4px 12px rgba(15,23,42,.04);
}
.admin-bottombar a {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 6px 4px;
    text-decoration: none;
    color: #64748b;
    font-size: 11px; font-weight: 600;
    -webkit-tap-highlight-color: transparent;
}
.admin-bottombar a i { font-size: 19px; line-height: 1; }
.admin-bottombar a.active { color: #1d4ed8; }
.admin-bottombar a.active i { color: #1d4ed8; }
@media (max-width: 720px) {
    .admin-bottombar { display: flex; }
    .page { padding-bottom: 90px !important; }
}

/* 반 미선택 시 안내 (교재 선택 패널) */
.reg-empty-hint {
    padding: 40px 16px; text-align: center; color: #64748b;
    background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 8px;
}
.reg-empty-hint i { font-size: 26px; color: #94a3b8; display: block; margin-bottom: 8px; }
.reg-empty-hint .dov-title { font-weight: 600; font-size: 14px; color: #1f3a5f; margin-bottom: 4px; }
.reg-empty-hint .dov-sub { font-size: 12px; }


/* 설정/로그아웃 푸터 구분 여백 (형아 2026-07-13) */
.nav-item.nav-footer-sep {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,.08);
}


/* 필터바 필드 라벨 숨김 — placeholder로 충분 (조회 페이지 공통) */
.filter-field .form-label { display: none; }

/* ── 리스트 상단 필터 폰트 표준 ────────────────────────────────
   화면마다 13~14px 로 갈려 있어 같은 기능인데 다른 화면처럼 보였다.
   본문(17px)보다 한 단계 작은 15px 로 맞춘다. sm 클래스의 좁은 패딩만으로는
   글자가 답답해져서 세로 패딩도 함께 살짝 키운다. */
.filter-bar .form-select, .filter-bar .form-control,
.fb-group .form-select, .fb-group .form-control,
.filter-field .form-select, .filter-field .form-control,
.filter-panel .form-select, .filter-panel .form-control {
    font-size: 15px;
    padding-top: 5px;
    padding-bottom: 5px;
}
.filter-field label, .filter-bar label { font-size: 13px; }

/* ===== 고객센터 (공지·문의) 제목 표준 =====
   예전엔 화면마다 h2/h3/h4 가 뒤섞여 크기가 제각각이었다.
   태그는 의미(문서 구조)대로 두고, 크기는 이 두 클래스로만 정한다. */
.sc-title {                  /* 목록 화면 페이지 타이틀 */
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    color: #1f3a5f;
}
.sc-title i { font-size: 19px; margin-right: 2px; }
.sc-body {                   /* 공지·문의 상세의 본문 — 기본보다 한 단계 작게 */
    font-size: 16px;
    line-height: 1.6;
    white-space: pre-wrap;   /* 줄바꿈을 쓴 그대로 보여준다 */
}
.sc-subject {                /* 공지·문의 상세의 글 제목 */
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    line-height: 1.4;
    color: #1f3a5f;
}

/* ===== 위험 구역 (학원 삭제 등) =====
   되돌리기 어려운 동작은 본문과 분리하고, 이름을 정확히 입력해야 실행되게 한다. */
/* .card 계열이 border-color 를 !important 로 못박아서 여기도 !important 가 필요하다 */
.card.danger-zone { border: 1px solid #fecaca !important; margin-top: 18px; }
.dz-head {
    background: #fef2f2; border-bottom: 1px solid #fecaca;
    padding: 10px 16px; font-weight: 600; font-size: 14px; color: #b91c1c;
}
.dz-body { padding: 16px; }
.dz-desc { font-size: 13px; color: #64748b; line-height: 1.7; margin: 0 0 12px; }
.dz-desc strong { color: #b91c1c; }
.dz-label { font-size: 13px; color: #475569; display: block; margin-bottom: 6px; }
.dz-label strong { color: #0f172a; }
.dz-row { display: flex; gap: 8px; align-items: center; }
.dz-input { max-width: 320px; }
.danger-zone .btn-danger[disabled] { opacity: .45; cursor: not-allowed; }

/* 설정이 삭제된 학습의 결과 — 기록은 남기되 구분해서 보여준다 */
.tag-removed {
    display: inline-block;
    margin-left: 6px;
    padding: 0 6px;
    border: 1px solid #cbd5e1;
    border-radius: 3px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
    line-height: 17px;
    vertical-align: middle;
    white-space: nowrap;
}

/* 목록의 '수정' 버튼 — 클릭 가능한 제목과 같은 파란색으로 통일 */
.btn-edit {
    font-size: 16px;
    color: #2563eb;
}
.btn-edit:hover { color: #1d4ed8; }

/* ===== AI 회화 전사 (관리자 조회) =====
   학생 화면과 같은 말풍선 모양. student.css 를 관리자에 통째로 물리면
   학생용 레이아웃 규칙까지 딸려 와서, 필요한 것만 여기 옮겨 적는다. */
.cv-stream {
    display: flex; flex-direction: column; gap: 12px;
    padding: 18px 16px; background: #fbfbfe; overflow-y: auto;
}
.cv-stream-done { border: 1px solid #e2e8f0; border-radius: 12px; }
.cv-msg { max-width: 72%; }
.cv-msg p {
    margin: 0; padding: 10px 13px; border-radius: 14px;
    font-size: 14px; line-height: 1.55; word-break: break-word;
}
.cv-msg-who { display: block; font-size: 11px; color: #94a3b8; margin-bottom: 4px; font-weight: 600; }
.cv-msg.is-ai p { background: #fff; border: 1px solid #e2e8f0; color: #1e293b; border-top-left-radius: 4px; }
.cv-msg.is-me { align-self: flex-end; text-align: right; }
.cv-msg.is-me p { background: #6d28d9; color: #fff; border-top-right-radius: 4px; text-align: left; }
@media (max-width: 640px) { .cv-msg { max-width: 88%; } }