/* EduLink 관리자 UI - /Image 목업 기준(네이비 사이드바 + 밝은 카드형 콘텐츠) */
:root {
    --sidebar-width: 244px;
    --sidebar-width-collapsed: 72px;
    --topbar-height: 68px;
    /* 사용자가 "테마 변경"에서 고른 사이드바 색상(--edu-user-sidebar-bg)이 있으면 그걸 쓰고, 없으면 기본 네이비. 버튼 색상과 독립. */
    --sidebar-bg: var(--edu-user-sidebar-bg, #0e1a3a);
    /* 사용자가 "테마 변경"에서 고른 색상(--edu-user-theme)이 있으면 그걸 쓰고, 없으면 기본 파란색을 쓴다. */
    --sidebar-bg-active: var(--edu-user-theme, #1f63ff);
    --sidebar-text: #c3cbe3;
    --sidebar-text-active: #ffffff;
    --sidebar-accent: var(--edu-user-theme, #1f63ff);
    --page-bg: #f3f6fc;
    --card-bg: #ffffff;
    --card-border: #e3e9f4;
    --title-color: #10205a;
    --edu-primary: var(--edu-user-theme, #1f63ff);
    --edu-radius: 18px;
}

[data-bs-theme="dark"] {
    --page-bg: #0b1226;
    --card-bg: #121b34;
    --card-border: #24304f;
    --title-color: #e8edfb;
}

html, body {
    height: 100%;
}

body {
    min-height: 100vh;
    font-family: "Pretendard", "Noto Sans KR", "Malgun Gothic", system-ui, -apple-system, sans-serif;
    background: var(--page-bg);
    font-size: .92rem;
}

.btn-primary {
    --bs-btn-bg: var(--edu-primary);
    --bs-btn-border-color: var(--edu-primary);
    --bs-btn-hover-bg: #1650d6;
    --bs-btn-hover-border-color: #1650d6;
}

.btn-outline-primary {
    --bs-btn-color: var(--edu-primary);
    --bs-btn-border-color: var(--edu-primary);
    --bs-btn-hover-bg: var(--edu-primary);
    --bs-btn-hover-border-color: var(--edu-primary);
}

/* ---------- app shell (sidebar + content) ---------- */

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

.sidebar {
    width: var(--sidebar-width);
    flex: 0 0 var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    transition: width .18s ease;
}

.sidebar.collapsed {
    width: var(--sidebar-width-collapsed);
    flex-basis: var(--sidebar-width-collapsed);
}

.sidebar.collapsed .sidebar-brand {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

.sidebar.collapsed .nav-label,
.sidebar.collapsed .brand-text,
.sidebar.collapsed .sidebar-foot-text {
    display: none;
}

.sidebar.collapsed .sidebar-nav .nav-link {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: 1.2rem 1.15rem 1.4rem;
    color: #fff;
    text-decoration: none;
}

.sidebar-brand .brand-name {
    font-weight: 800;
    font-size: 1.3rem;
    line-height: 1.1;
}

.sidebar-brand .brand-sub {
    font-size: .68rem;
    color: var(--sidebar-text);
    opacity: .85;
}

.sidebar-nav {
    list-style: none;
    margin: 0;
    padding: 0 .75rem;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .72rem .9rem;
    border-radius: .6rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: .95rem;
    margin-bottom: .2rem;
}

.sidebar-nav .nav-link i {
    font-size: 1.15rem;
    width: 1.3rem;
    text-align: center;
    flex: none;
}

.sidebar-nav .nav-link:hover {
    background: rgba(255, 255, 255, .07);
    color: #fff;
}

.sidebar-nav .nav-link.active {
    background: var(--sidebar-bg-active);
    color: #fff;
    font-weight: 600;
}

.sidebar-foot {
    margin-top: auto;
    padding: 1rem 1.25rem 1.25rem;
    font-size: .78rem;
    color: var(--sidebar-text);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
}

.sidebar-settings-btn {
    position: relative;
    flex: none;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .18);
    background: rgba(255, 255, 255, .06);
    color: var(--sidebar-text);
    font-size: 1rem;
}

.sidebar-settings-btn:hover {
    background: rgba(255, 255, 255, .14);
    color: #fff;
}

.sidebar.collapsed .sidebar-foot {
    justify-content: center;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    z-index: 1040;
}

.sidebar-toggle {
    flex: none;
}

.app-content {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: var(--topbar-height);
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 1.5rem;
    background: var(--card-bg);
    border-bottom: 1px solid var(--card-border);
    position: sticky;
    top: 0;
    z-index: 20;
}

.topbar-search {
    flex: 1 1 auto;
    max-width: 640px;
    position: relative;
}

.topbar-search i {
    position: absolute;
    left: .9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--bs-secondary-color);
}

.topbar-search input {
    padding-left: 2.5rem;
    border-radius: .7rem;
    background: var(--page-bg);
    height: 42px;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: .9rem;
}

/* 폭이 좁아지면 글자가 세로로 한 글자씩 줄바꿈되며 깨지는 대신, 안 잘리는 선에서 한 줄을 유지한다
   (실제로 좁아지는 경우는 768px 폭 근처의 태블릿 — 이때는 아래 미디어쿼리가 통째로 숨긴다). */
.topbar-user .user-name {
    white-space: nowrap;
}

.topbar-bell {
    position: relative;
    font-size: 1.3rem;
    color: var(--title-color);
    line-height: 1;
    background: none;
    border: 0;
    padding: .25rem;
}

/* 사이드바 설정 버튼(.sidebar-settings-btn)도 같은 배지를 쓴다 — 부모 한정 없이 재사용 가능하게 뺐다. */
.bell-badge {
    position: absolute;
    top: -2px;
    right: -4px;
    background: #ef4444;
    color: #fff;
    font-size: .62rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    border-radius: 8px;
    text-align: center;
    padding: 0 3px;
}

.topbar-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #dbe4fb;
    color: #6f86c4;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex: none;
}

.page {
    flex: 1 1 auto;
    padding: 1.25rem 1.5rem 2rem;
    min-width: 0;
}

/* ---------- page head (제목 + 설명 + 브레드크럼 + 우측 액션) ---------- */

.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: .75rem 1rem;
    margin-bottom: 1rem;
}

.page-head h1 {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--title-color);
    margin: 0;
    display: inline;
    letter-spacing: -.02em;
}

.page-head .desc {
    color: var(--bs-secondary-color);
    font-size: .88rem;
    margin-left: .75rem;
}

.page-head .actions {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}

/* ---------- cards ---------- */

.edu-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--edu-radius);
    padding: 1.1rem 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 2px rgba(16, 32, 90, .03);
}

.edu-card > h2, .edu-card .card-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--title-color);
    margin: 0 0 .75rem;
}

.edu-card .card-title small {
    font-size: .8rem;
    font-weight: 400;
    color: var(--bs-secondary-color);
    margin-left: .4rem;
}

.filter-card .form-label {
    font-size: .8rem;
    font-weight: 600;
    margin-bottom: .25rem;
    color: var(--title-color);
}

/* ---------- stat cards ---------- */

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--edu-radius);
    padding: 1.05rem 1.25rem;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* 눌러서 해당 화면으로 가는 통계 카드(ui:statCard href) */
a.stat-card.stat-link {
    color: inherit;
    text-decoration: none;
    transition: border-color .15s, box-shadow .15s;
}

a.stat-card.stat-link:hover,
a.stat-card.stat-link:focus-visible {
    border-color: var(--bs-primary);
    box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
}

.stat-icon {
    width: 62px;
    height: 62px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;
    flex: none;
}

.stat-icon.tone-blue { background: #e4edff; color: #1f63ff; }
.stat-icon.tone-green { background: #dcf6e8; color: #17a35b; }
.stat-icon.tone-purple { background: #ebe4ff; color: #6a3df0; }
.stat-icon.tone-red { background: #ffe4e6; color: #e5384b; }
.stat-icon.tone-orange { background: #fff0d9; color: #e58a00; }

.stat-card .stat-label {
    font-size: .82rem;
    color: var(--bs-secondary-color);
}

.stat-card .stat-value {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--title-color);
    line-height: 1.15;
}

.stat-card .stat-value small {
    font-size: .82rem;
    font-weight: 500;
    color: var(--bs-secondary-color);
    margin-left: .3rem;
}

.stat-card .stat-delta {
    font-size: .75rem;
    color: var(--bs-secondary-color);
}

/* ---------- data table ---------- */

.edu-table {
    margin-bottom: 0;
    font-size: .88rem;
}

.edu-table thead th {
    background: #f1f5fc;
    color: var(--title-color);
    font-weight: 700;
    font-size: .82rem;
    white-space: nowrap;
    text-align: center;
    border-bottom: 1px solid var(--card-border);
    padding: .7rem .6rem;
}

[data-bs-theme="dark"] .edu-table thead th {
    background: #18233f;
}

.edu-table td {
    text-align: center;
    vertical-align: middle;
    padding: .62rem .6rem;
}

.edu-table td.text-start, .edu-table th.text-start {
    text-align: left;
}

.edu-table .col-check {
    width: 42px;
}

.table-wrap {
    border: 1px solid var(--card-border);
    border-radius: 10px;
    overflow: hidden;
}

.table-wrap .table-responsive {
    overflow-x: auto;
}

.table-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-top: .9rem;
}

.bulk-bar {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
}

.bulk-bar .form-check-label {
    font-size: .85rem;
}

/* 상태/유형 배지 */
.tag {
    display: inline-block;
    min-width: 56px;
    padding: .18rem .55rem;
    border-radius: .4rem;
    font-size: .78rem;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}

.tag-blue { background: #e4edff; color: #1f63ff; }
.tag-green { background: #dcf6e8; color: #128a4a; }
.tag-red { background: #ffe4e6; color: #d92d40; }
.tag-orange { background: #fff0d9; color: #c77400; }
.tag-purple { background: #ebe4ff; color: #6a3df0; }
.tag-gray { background: #e9edf5; color: #5b6784; }

.progress-mini {
    display: flex;
    align-items: center;
    gap: .5rem;
    justify-content: center;
    white-space: nowrap;
}

.progress-mini .progress {
    width: 84px;
    height: 7px;
}

.btn-line {
    --bs-btn-padding-y: .22rem;
    --bs-btn-padding-x: .75rem;
    --bs-btn-font-size: .8rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--title-color);
}

.btn-line:hover {
    border-color: var(--edu-primary);
    color: var(--edu-primary);
}

.kebab {
    border: 0;
    background: none;
    color: var(--bs-secondary-color);
    padding: .1rem .4rem;
}

/* 페이징 */
.pagination .page-link {
    border-radius: .45rem !important;
    margin: 0 .12rem;
    color: var(--title-color);
    border-color: var(--card-border);
}

.pagination .page-item.active .page-link {
    background: var(--edu-primary);
    border-color: var(--edu-primary);
    color: #fff;
}

/* 영상 썸네일 */
.thumb {
    position: relative;
    display: inline-block;
    width: 132px;
    aspect-ratio: 16 / 9;
    border-radius: .5rem;
    overflow: hidden;
    background: #0f172a;
}

.thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.thumb .dur {
    position: absolute;
    right: 4px;
    bottom: 4px;
    background: rgba(0, 0, 0, .75);
    color: #fff;
    font-size: .68rem;
    padding: 0 .3rem;
    border-radius: .25rem;
}

/* 자료실 폴더 바로가기 */
.folder-card {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .8rem 1rem;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    background: var(--card-bg);
    text-decoration: none;
    color: var(--title-color);
    height: 100%;
}

.folder-card.active {
    border-color: var(--edu-primary);
    box-shadow: 0 0 0 2px rgba(31, 99, 255, .15);
}

.folder-card i {
    font-size: 2rem;
}

.folder-card .fc-name {
    font-weight: 700;
    font-size: .9rem;
}

.folder-card .fc-count {
    font-size: .76rem;
    color: var(--bs-secondary-color);
}

.file-ico {
    font-size: 1.25rem;
    margin-right: .4rem;
    vertical-align: -2px;
}

/* 공지 상세 패널 */
.notice-detail .nd-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--title-color);
}

.notice-detail .nd-body {
    white-space: pre-wrap;
    line-height: 1.65;
}

.pin-on { color: #e5384b; }
.pin-off { color: #b3bacb; }

/* 대시보드 "더보기" 링크 */
.more-link {
    font-size: .8rem;
    text-decoration: none;
    color: var(--edu-primary);
    font-weight: 600;
}

.video-mini {
    display: block;
    text-decoration: none;
    color: inherit;
}

.video-mini .thumb {
    width: 100%;
}

.video-mini .vm-title {
    font-size: .8rem;
    margin-top: .35rem;
    line-height: 1.3;
}

.video-mini .vm-meta {
    font-size: .72rem;
    color: var(--bs-secondary-color);
}

/* 모바일: 사이드바는 화면 밖(오프캔버스), 토글 시 슬라이드 인 */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 1050;
        width: var(--sidebar-width);
        flex-basis: var(--sidebar-width);
        transform: translateX(-100%);
        transition: transform .22s ease;
    }

    .sidebar.collapsed {
        width: var(--sidebar-width);
        flex-basis: var(--sidebar-width);
    }

    .sidebar.collapsed .nav-label,
    .sidebar.collapsed .brand-text,
    .sidebar.collapsed .sidebar-foot-text {
        display: block;
    }

    .sidebar.collapsed .sidebar-nav .nav-link,
    .sidebar.collapsed .sidebar-brand {
        justify-content: flex-start;
        padding-left: .9rem;
        padding-right: .9rem;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .sidebar-backdrop.show {
        display: block;
    }

    .topbar {
        padding: 0 .75rem;
        gap: .5rem;
    }

    .topbar-user .user-name {
        display: none;
    }

    .page {
        padding: 1rem .85rem 1.5rem;
    }

    .page-head h1 {
        font-size: 1.45rem;
    }

    .page-head .desc {
        display: block;
        margin: .25rem 0 0;
    }

    .stat-icon {
        width: 48px;
        height: 48px;
        font-size: 1.3rem;
    }

    .stat-card .stat-value {
        font-size: 1.4rem;
    }
}

/* ---------- login (no sidebar) ---------- */

.auth-shell {
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top, #1a2c66, #0a1230 68%);
    padding: 1.5rem;
}

.auth-card {
    width: 100%;
    max-width: 380px;
    background: var(--card-bg);
    border-radius: 1.1rem;
    padding: 2.25rem 1.85rem;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
}

.auth-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    margin-bottom: 1.5rem;
    font-weight: 800;
    font-size: 1.3rem;
    color: var(--title-color);
}

/* ---------- 탭(시험 목록 / 성적 분석) ---------- */
.edu-tabs {
    border-bottom: 0;
    gap: .25rem;
}

.edu-tabs .nav-link {
    border: 1px solid var(--card-border);
    border-bottom: 0;
    border-radius: 10px 10px 0 0;
    color: var(--bs-secondary-color);
    background: var(--card-bg);
    font-weight: 600;
}

.edu-tabs .nav-link.active {
    color: var(--edu-primary);
    border-top: 2px solid var(--edu-primary);
}

.tabs-body {
    border-top-left-radius: 0;
}

.text-purple { color: #6a3df0; }

.table-active > * { background: rgba(31, 99, 255, .08) !important; }

/* 상단바가 좁은 화면에서 줄바꿈/찌그러지지 않게 */
.topbar-user .btn { white-space: nowrap; }
.topbar-search { min-width: 0; }
.topbar-search input { min-width: 0; }

@media (max-width: 575.98px) {
    .topbar-user .topbar-avatar { display: none; }
    .topbar-user { gap: .5rem; }
}

/* 영상 상세: 16:9 반응형 플레이어 */
.player-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 10px;
    overflow: hidden;
    background: #000;
}

.player-wrap iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--title-color);
}

/* 목록 하단 "선택한 항목을" 문구(체크박스 아님 — 전체 선택은 표 머리의 체크박스로만) */
.bulk-label {
    font-size: .85rem;
    font-weight: 600;
    color: var(--title-color);
}

/* ===== 학생 포털 ===== */

.dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    padding: 1.6rem 1rem;
    text-align: center;
    border: 2px dashed #b9c6e6;
    border-radius: .85rem;
    background: #f7f9ff;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.dropzone i { font-size: 2rem; color: #4a6cf7; }
.dropzone:hover, .dropzone.dragging { background: #eaf0ff; border-color: #4a6cf7; }

.calendar .cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    text-align: center;
}
.calendar .cal-head span { font-size: .78rem; font-weight: 700; color: #7a86a3; padding: .25rem 0; }
.calendar .cal-head span:first-child { color: #d92d40; }
.cal-day {
    border: 0;
    background: transparent;
    border-radius: .5rem;
    padding: .45rem 0;
    font-size: .9rem;
    color: var(--title-color);
}
.cal-day:hover:not(:disabled) { background: #eaf0ff; }
.cal-day:disabled { color: #c3cbdc; cursor: not-allowed; }
.cal-day.today { font-weight: 800; box-shadow: inset 0 0 0 1px #4a6cf7; }
.cal-day.active, .cal-day.active:hover { background: #4a6cf7; color: #fff; }

.slot-btn { text-align: center; }

.new-dot {
    display: inline-block;
    width: .5rem;
    height: .5rem;
    margin-left: .3rem;
    border-radius: 50%;
    background: #ef4444;
    vertical-align: middle;
}

.notice-body {
    white-space: pre-wrap;
    line-height: 1.7;
    word-break: break-word;
}

.result-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: .25rem .75rem;
    padding: .45rem 0;
    border-bottom: 1px solid var(--card-border);
}
.result-row a { font-weight: 600; text-decoration: none; }

/* 모달 제목줄을 잡고 옮길 수 있다(modal-drag.js) */
.modal-header { cursor: move; touch-action: none; user-select: none; }
.modal-header .btn-close { cursor: pointer; }

/* 좌우 이동 목록(반 학생 배정) */
.tl-box { border: 1px solid var(--bs-border-color, #dee2e6); border-radius: .75rem; overflow: hidden; height: 100%; }
.tl-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; padding: .6rem .75rem; background: var(--bs-tertiary-bg, #f4f6fb); border-bottom: 1px solid var(--bs-border-color, #dee2e6); }
.tl-head .tl-search { max-width: 11rem; }
.tl-list { list-style: none; margin: 0; padding: 0; height: 320px; overflow-y: auto; }
.tl-item { display: flex; align-items: center; padding: .4rem .75rem; border-bottom: 1px solid var(--bs-border-color-translucent, #eef1f8); }
.tl-item[hidden] { display: none; }
.tl-item label { display: flex; align-items: center; gap: .5rem; flex: 1; cursor: pointer; margin: 0; }
.tl-item:hover { background: var(--bs-tertiary-bg, #f4f6fb); }
.tl-name { font-weight: 600; }
.tl-meta { font-size: .8rem; color: var(--bs-secondary-color, #6c757d); }
.tl-empty { padding: 1rem; text-align: center; }
.tl-empty[hidden] { display: none; }
@media (max-width: 768px) { .tl-list { height: 200px; } }

/* ===== 다크모드 대비 보정 =====
   라이트모드용 파스텔 배경(연한 하늘색 등)에 어두운 글자색을 고정해 둔 곳은, 다크모드에서 글자색이
   밝은색으로 바뀌면서 정작 배경은 그대로 밝아 대비가 무너진다(드롭존·달력 hover). 배지·아이콘류는
   또렷한 파스텔 배경이 다크 카드 위에서 너무 튀어 보이므로 반투명 배경 + 밝은 글자로 톤을 낮춘다. */
[data-bs-theme="dark"] .dropzone {
    border-color: #2c3c66;
    background: rgba(74, 108, 247, .08);
}
[data-bs-theme="dark"] .dropzone i {
    color: #7fa8ff;
}
[data-bs-theme="dark"] .dropzone:hover,
[data-bs-theme="dark"] .dropzone.dragging {
    background: rgba(74, 108, 247, .16);
    border-color: #4a6cf7;
}

[data-bs-theme="dark"] .cal-day:hover:not(:disabled) {
    background: rgba(74, 108, 247, .22);
}

[data-bs-theme="dark"] .tag-blue { background: rgba(31, 99, 255, .22); color: #8fb4ff; }
[data-bs-theme="dark"] .tag-green { background: rgba(23, 163, 91, .22); color: #6fe3ac; }
[data-bs-theme="dark"] .tag-red { background: rgba(217, 45, 64, .26); color: #ff96a6; }
[data-bs-theme="dark"] .tag-orange { background: rgba(199, 116, 0, .26); color: #ffc266; }
[data-bs-theme="dark"] .tag-purple { background: rgba(106, 61, 240, .26); color: #c3aeff; }
[data-bs-theme="dark"] .tag-gray { background: rgba(255, 255, 255, .1); color: #c7cee0; }

[data-bs-theme="dark"] .stat-icon.tone-blue { background: rgba(31, 99, 255, .18); color: #7fa8ff; }
[data-bs-theme="dark"] .stat-icon.tone-green { background: rgba(23, 163, 91, .18); color: #5fd99a; }
[data-bs-theme="dark"] .stat-icon.tone-purple { background: rgba(106, 61, 240, .2); color: #b39dff; }
[data-bs-theme="dark"] .stat-icon.tone-red { background: rgba(229, 56, 75, .18); color: #ff8fa0; }
[data-bs-theme="dark"] .stat-icon.tone-orange { background: rgba(229, 138, 0, .18); color: #ffbf66; }

[data-bs-theme="dark"] .topbar-avatar { background: rgba(31, 99, 255, .2); color: #8fb4ff; }

/* =====================================================================================================
   디자인 층 (2026-10, 시안: Image/design 4장)
   밝은 사이드바 · 명조 제목 · 남색 버튼 · 얇은 선과 넉넉한 여백의 "편집 디자인" 톤.
   위쪽의 예전 규칙을 지우지 않고 여기서 덮어쓴다 — 색·모서리·글꼴을 바꿀 땐 이 블록의 변수부터 고칠 것.
   ===================================================================================================== */
:root {
    /* 글꼴: 본문은 Pretendard, 제목·숫자·학원 이름은 명조(Noto Serif KR), 손글씨 문구는 Nanum Pen Script */
    --edu-font-serif: "Noto Serif KR", "Nanum Myeongjo", "Batang", serif;
    --edu-font-script: "Nanum Pen Script", "Noto Serif KR", cursive;

    /* 색: 버튼(남색)과 강조(파랑)를 나눈다. 사용자가 "테마 변경"에서 고른 색은 버튼색을 덮어쓴다. */
    --edu-primary: var(--edu-user-theme, #14213d);
    --edu-accent: #1d5bff;
    --edu-ink: #101623;                 /* 제목·본문 진한 글자 */
    --edu-ink-soft: #5d6472;            /* 보조 글자 */
    --edu-ink-faint: #9aa0ab;           /* 소제목(eyebrow)·날짜 */
    --edu-line: #e9e9e4;                /* 카드·구분선 */
    --edu-line-strong: #d6d8dd;         /* 입력칸·윤곽 버튼 테두리 */
    --edu-surface-2: #f5f6f8;           /* 표 머리·선택된 메뉴 바탕 */

    --page-bg: #fafaf8;
    --card-bg: #ffffff;
    --card-border: var(--edu-line);
    --title-color: var(--edu-ink);

    --sidebar-bg: var(--edu-user-sidebar-bg, #f6f6f3);
    --sidebar-text: #3d4453;
    --sidebar-text-active: #101623;
    --sidebar-bg-active: #e7e9ee;
    --sidebar-hover: rgba(16, 22, 35, .05);
    --sidebar-line: var(--edu-line);

    /* 모서리: 시안은 "살짝만" 둥글다 */
    --edu-radius: 12px;                 /* 카드 */
    --edu-radius-md: 8px;               /* 입력칸·버튼 */
    --edu-radius-sm: 6px;               /* 배지·표 안 작은 버튼 */
    --edu-radius-xl: 16px;              /* 모달·로그인 카드 */

    --edu-shadow-card: 0 1px 2px rgba(16, 22, 35, .03);
    --edu-shadow-pop: 0 18px 48px rgba(16, 22, 35, .14);
    --edu-focus-ring: color-mix(in srgb, var(--edu-accent) 18%, transparent);
    --edu-primary-soft: color-mix(in srgb, var(--edu-accent) 7%, var(--card-bg));

    --bs-link-color: var(--edu-accent);
    --bs-link-color-rgb: 29, 91, 255;
    --bs-link-hover-color-rgb: 20, 66, 200;
    --bs-body-color: #262b36;
    --bs-border-color: var(--edu-line);
}

[data-bs-theme="dark"] {
    --edu-primary: var(--edu-user-theme, #3d5aa8);
    --edu-accent: #7ea6ff;
    --edu-ink: #eef0f4;
    --edu-ink-soft: #a7adb9;
    --edu-ink-faint: #737a88;
    --edu-line: #262c37;
    --edu-line-strong: #3a4250;
    --edu-surface-2: #1b212b;

    --page-bg: #0e1116;
    --card-bg: #151a22;

    --sidebar-bg: var(--edu-user-sidebar-bg, #11151c);

    --edu-shadow-card: 0 1px 2px rgba(0, 0, 0, .3);
    --edu-shadow-pop: 0 18px 48px rgba(0, 0, 0, .55);

    --bs-link-color-rgb: 126, 166, 255;
    --bs-link-hover-color-rgb: 160, 190, 255;
    --bs-body-color: #d5d9e0;
}

body {
    color: var(--bs-body-color);
    letter-spacing: -.005em;
}

/* ---- 사이드바: 밝은 바탕, 진한 글자. 바탕이 어두우면(tone-dark) 글자를 밝게 ---- */
.sidebar {
    border-right: 1px solid var(--sidebar-line);
    color: var(--sidebar-text);
}

.sidebar.tone-dark {
    --sidebar-text: #c8cedb;
    --sidebar-text-active: #ffffff;
    --sidebar-bg-active: rgba(255, 255, 255, .13);
    --sidebar-hover: rgba(255, 255, 255, .07);
    --sidebar-line: rgba(255, 255, 255, .08);
}

.sidebar-brand {
    padding: 1.7rem 1.5rem 1.6rem;
    color: var(--sidebar-text-active);
    gap: 0;
}

.sidebar-brand .brand-name {
    font-family: var(--edu-font-serif);
    font-weight: 700;
    font-size: 1.32rem;
    letter-spacing: .02em;
    line-height: 1.2;
}

.sidebar-brand .brand-sub {
    display: block;
    margin-top: .3rem;
    font-size: .56rem;
    letter-spacing: .3em;
    color: var(--sidebar-text);
    opacity: .8;
    white-space: nowrap;
}

/* 접힌 사이드바에서는 학원 이름 대신 첫 글자만 보여준다 */
.sidebar-brand .brand-mark {
    display: none;
    font-family: var(--edu-font-serif);
    font-weight: 700;
    font-size: 1.4rem;
}

.sidebar.collapsed .sidebar-brand .brand-mark {
    display: block;
}

.sidebar-nav {
    padding: 0 .85rem;
}

.sidebar-nav .nav-link {
    border-radius: var(--edu-radius-md);
    padding: .78rem .85rem;
    margin-bottom: .3rem;
    gap: .95rem;
    font-size: .95rem;
    color: var(--sidebar-text);
    box-shadow: none;
    transition: background-color .15s, color .15s;
}

.sidebar-nav .nav-link i {
    font-size: 1.2rem;
}

.sidebar-nav .nav-link:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text-active);
}

.sidebar-nav .nav-link.active {
    background: var(--sidebar-bg-active);
    color: var(--sidebar-text-active);
    font-weight: 700;
    box-shadow: none;
}

.sidebar-foot {
    padding: 1.4rem 1.5rem 1.6rem;
    align-items: flex-end;
    color: var(--sidebar-text);
}

.sidebar-foot-text {
    border-top: 1px solid var(--sidebar-line);
    padding-top: 1.2rem;
    min-width: 5.5rem;
}

.sidebar-foot-text span {
    display: block;
    font-size: .62rem;
    letter-spacing: .32em;
    line-height: 2.05;
    opacity: .85;
}

.sidebar-settings-btn {
    border-color: var(--sidebar-line);
    background: transparent;
    color: var(--sidebar-text);
}

.sidebar-settings-btn:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text-active);
}

/* ---- 상단바 ---- */
.topbar {
    height: 76px;
    padding: 0 2.2rem;
    background: var(--card-bg);
    border-bottom: 1px solid var(--edu-line);
}

.topbar-icon-btn {
    width: 40px;
    height: 40px;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--edu-ink);
    font-size: 1.25rem;
    transition: background-color .15s;
}

.topbar-icon-btn:hover,
.topbar-bell:hover {
    background: var(--edu-surface-2);
}

.topbar-brand {
    display: none;
    font-family: var(--edu-font-serif);
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--edu-ink);
    text-decoration: none;
    white-space: nowrap;
}

.topbar-tagline {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    font-size: .78rem;
    letter-spacing: .06em;
    color: var(--edu-ink-soft);
    white-space: nowrap;
    margin: 0 1.2rem 0 .4rem;
}

.topbar-tagline::before {
    content: "";
    width: 2rem;
    height: 1px;
    background: var(--edu-ink-faint);
}

.topbar-search {
    max-width: 360px;
    margin-left: auto;
}

.topbar-search input {
    height: 40px;
    border-radius: 999px;
    border: 1px solid var(--edu-line);
    background: var(--page-bg);
    padding-left: 2.6rem;
    font-size: .86rem;
}

.topbar-search i {
    left: 1rem;
    color: var(--edu-ink-faint);
}

.topbar-user {
    gap: .6rem;
}

.topbar-bell {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--edu-ink);
}

.topbar-avatar {
    width: 40px;
    height: 40px;
    background: #e3e5ea;
    color: #9096a3;
}

.topbar-user .user-name {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.25;
    color: var(--edu-ink);
}

.topbar-user .user-name-main {
    font-weight: 600;
    font-size: .9rem;
}

.topbar-user .user-role {
    font-size: .72rem;
    color: var(--edu-ink-faint);
}

/* ---- 본문 여백 ---- */
.page {
    padding: 2.2rem 2.4rem 3rem;
    max-width: 1560px;
    width: 100%;
}

/* ---- 페이지 머리: 영문 소제목 + 명조 큰 제목 + 설명 ---- */
.page-head {
    align-items: flex-end;
    gap: 1rem 1.5rem;
    margin-bottom: 1.6rem;
}

.page-head .eyebrow {
    font-size: .68rem;
    font-weight: 500;
    letter-spacing: .3em;
    color: var(--edu-ink-faint);
    margin-bottom: .7rem;
    text-transform: uppercase;
}

.page-head h1 {
    display: block;
    font-family: var(--edu-font-serif);
    font-weight: 700;
    font-size: 2.5rem;
    line-height: 1.25;
    letter-spacing: -.01em;
    color: var(--edu-ink);
    margin: 0;
}

.page-head .desc {
    display: block;
    margin: .65rem 0 0;
    font-size: .98rem;
    color: var(--edu-ink-soft);
}

.page-head .actions {
    gap: .6rem;
    align-items: center;
}

.page-head .actions .btn {
    --bs-btn-padding-x: 1.25rem;
    --bs-btn-padding-y: .68rem;
}

/* 대시보드·학생 홈의 큰 머리 */
.page-head.hero {
    align-items: flex-end;
    margin: .6rem 0 2rem;
}

.page-head.hero h1 {
    font-size: 3.2rem;
    line-height: 1.32;
}

.page-head.hero .desc {
    margin-top: 1.4rem;
    line-height: 1.75;
    font-size: 1rem;
}

.hero-side {
    text-align: right;
}

.hero-script {
    font-family: var(--edu-font-script);
    font-size: 2.1rem;
    line-height: 1.25;
    color: var(--edu-ink);
    transform: rotate(-5deg);
    transform-origin: right bottom;
    margin: 0 0 1.1rem;
}

.hero-script em {
    font-style: normal;
    color: var(--edu-accent);
}

.hero-date {
    font-size: .82rem;
    letter-spacing: .04em;
    color: var(--edu-ink-faint);
}

/* ---- 카드 ---- */
.edu-card {
    border: 1px solid var(--edu-line);
    border-radius: var(--edu-radius);
    box-shadow: var(--edu-shadow-card);
    padding: 1.4rem 1.5rem;
    margin-bottom: 1.2rem;
}

.edu-card > h2,
.edu-card .card-title {
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--edu-ink);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .2rem .7rem;
}

.edu-card .card-title > i {
    font-size: 1.3rem;
    font-weight: 400;
}

.edu-card .card-title small {
    font-size: .82rem;
    color: var(--edu-ink-faint);
    margin-left: 0;
}

.more-link {
    font-size: .8rem;
    color: var(--edu-ink-faint);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: .3rem;
}

.more-link:hover {
    color: var(--edu-accent);
}

/* 필터 카드: 흰 카드 안에 라벨 + 입력칸을 한 줄로 */
.filter-card {
    background: var(--card-bg);
    padding: 1.1rem 1.2rem 1.2rem;
}

.filter-card .form-label {
    font-size: .8rem;
    font-weight: 600;
    color: var(--edu-ink);
    margin-bottom: .4rem;
}

/* ---- 통계: 카드 여러 개 대신 한 줄짜리 카드 안에 "점 + 이름 / 숫자"를 세로선으로 나눈다 ---- */
.row:has(> [class*="col"] > .stat-card) {
    --bs-gutter-x: 0;
    --bs-gutter-y: 0;
    margin: 0 0 1.2rem;
    background: var(--card-bg);
    border: 1px solid var(--edu-line);
    border-radius: var(--edu-radius);
    box-shadow: var(--edu-shadow-card);
    padding: 1.1rem 0;
    row-gap: 1.1rem;
}

.row:has(> [class*="col"] > .stat-card) > [class*="col"] {
    border-left: 1px solid var(--edu-line);
    margin-top: 0;
}

.row:has(> [class*="col"] > .stat-card) > [class*="col"]:first-child {
    border-left: 0;
}

.stat-card {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: .75rem;
    row-gap: .35rem;
    align-items: center;
    align-content: center;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: .55rem 2.2rem;
}

.stat-card > div {
    display: contents;
}

.stat-card .stat-icon {
    grid-column: 1;
    grid-row: 1;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    font-size: 0;
}

.stat-icon.tone-blue { background: #a9c6ff; }
.stat-icon.tone-green { background: #a8dcc0; }
.stat-icon.tone-purple { background: #cbc0f7; }
.stat-icon.tone-red { background: #f7b9bd; }
.stat-icon.tone-orange { background: #f6cf9a; }

.stat-card .stat-label {
    grid-column: 2;
    grid-row: 1;
    font-size: .9rem;
    color: var(--edu-ink-soft);
}

.stat-card .stat-value {
    grid-column: 2;
    grid-row: 2;
    font-family: var(--edu-font-serif);
    font-weight: 700;
    font-size: 1.85rem;
    line-height: 1.2;
    color: var(--edu-ink);
}

.stat-card .stat-value small {
    font-family: "Pretendard", system-ui, sans-serif;
    font-size: .78rem;
    font-weight: 500;
    color: var(--edu-ink-faint);
    margin-left: .5rem;
}

a.stat-card.stat-link {
    transition: background-color .15s;
}

a.stat-card.stat-link:hover,
a.stat-card.stat-link:focus-visible {
    background: var(--edu-surface-2);
    border-color: transparent;
    box-shadow: none;
    transform: none;
}

/* ---- 입력 항목: 흰 바탕 + 또렷한 테두리, 누르면 파란 테두리와 번짐 ---- */
.form-label {
    font-weight: 600;
    font-size: .86rem;
    color: var(--edu-ink);
    margin-bottom: .4rem;
}

.form-control,
.form-select {
    background-color: var(--card-bg);
    border: 1px solid var(--edu-line-strong);
    border-radius: var(--edu-radius-md);
    padding: .62rem .9rem;
    font-size: .92rem;
    color: var(--edu-ink);
    transition: border-color .15s, box-shadow .15s;
}

.form-select {
    padding-right: 2.3rem;
}

.form-control:hover:not(:disabled):not([readonly]),
.form-select:hover:not(:disabled) {
    border-color: #b3b8c2;
}

.form-control:focus,
.form-select:focus {
    background-color: var(--card-bg);
    border-color: var(--edu-accent);
    box-shadow: 0 0 0 4px var(--edu-focus-ring);
}

.form-control::placeholder {
    color: var(--edu-ink-faint);
    opacity: 1;
}

.form-control:disabled,
.form-control[readonly],
.form-select:disabled {
    background-color: var(--edu-surface-2);
    border-style: dashed;
    color: var(--edu-ink-soft);
}

.form-control-sm,
.form-select-sm {
    border-radius: var(--edu-radius-sm);
    padding: .38rem .65rem;
    font-size: .86rem;
}

.form-select-sm {
    padding-right: 2rem;
}

textarea.form-control {
    line-height: 1.65;
}

.form-control[type="file"] {
    padding: .5rem .6rem;
}

.form-control[type="file"]::file-selector-button {
    border-radius: var(--edu-radius-sm);
    margin: -.1rem .7rem -.1rem -.2rem;
    padding: .3rem .8rem;
    border: 0;
    background: var(--edu-surface-2);
    color: var(--edu-ink);
    font-weight: 600;
}

.form-text {
    font-size: .8rem;
    margin-top: .4rem;
    color: var(--edu-ink-faint);
}

.form-check-input {
    width: 1.1em;
    height: 1.1em;
    border: 1px solid #b3b8c2;
    background-color: var(--card-bg);
}

.form-check-input[type="checkbox"] {
    border-radius: 4px;
}

.form-check-input:checked {
    background-color: var(--edu-primary);
    border-color: var(--edu-primary);
}

.form-check-input:focus {
    border-color: var(--edu-accent);
    box-shadow: 0 0 0 4px var(--edu-focus-ring);
}

/* ---- 버튼: 주 버튼은 남색, 보조 버튼은 흰 바탕에 진한 테두리 ---- */
.btn {
    border-radius: var(--edu-radius-md);
    font-weight: 600;
    --bs-btn-padding-x: 1.05rem;
    --bs-btn-padding-y: .55rem;
    transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s, transform .08s;
}

.btn:active {
    transform: translateY(1px);
}

.btn-sm {
    border-radius: var(--edu-radius-sm);
    --bs-btn-padding-x: .75rem;
    --bs-btn-padding-y: .34rem;
}

.btn-primary {
    --bs-btn-bg: var(--edu-primary);
    --bs-btn-border-color: var(--edu-primary);
    --bs-btn-hover-bg: color-mix(in srgb, var(--edu-primary) 86%, #fff);
    --bs-btn-hover-border-color: color-mix(in srgb, var(--edu-primary) 86%, #fff);
    --bs-btn-active-bg: color-mix(in srgb, var(--edu-primary) 80%, #000);
    --bs-btn-active-border-color: color-mix(in srgb, var(--edu-primary) 80%, #000);
    --bs-btn-disabled-bg: var(--edu-primary);
    --bs-btn-disabled-border-color: var(--edu-primary);
    box-shadow: none;
}

.btn-primary:hover {
    box-shadow: 0 6px 16px rgba(16, 22, 35, .16);
}

.btn-outline-primary,
.btn-outline-secondary {
    --bs-btn-color: var(--edu-ink);
    --bs-btn-border-color: var(--edu-line-strong);
    --bs-btn-bg: var(--card-bg);
    --bs-btn-hover-color: var(--edu-ink);
    --bs-btn-hover-bg: var(--edu-surface-2);
    --bs-btn-hover-border-color: #b3b8c2;
    --bs-btn-active-color: var(--edu-ink);
    --bs-btn-active-bg: var(--edu-surface-2);
    --bs-btn-active-border-color: #b3b8c2;
    --bs-btn-border-width: 1px;
}

.btn-outline-danger {
    --bs-btn-bg: var(--card-bg);
    --bs-btn-border-width: 1px;
}

.btn-line {
    border-radius: var(--edu-radius-sm);
    border: 1px solid var(--edu-line-strong);
    background: var(--card-bg);
    color: var(--edu-ink);
    --bs-btn-padding-y: .22rem;
    --bs-btn-padding-x: .7rem;
    --bs-btn-font-size: .78rem;
    font-weight: 500;
}

.btn-line:hover {
    background: var(--edu-surface-2);
    border-color: #b3b8c2;
    color: var(--edu-ink);
}

.kebab {
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 50%;
    color: var(--edu-ink-soft);
}

.kebab:hover {
    background: var(--edu-surface-2);
    color: var(--edu-ink);
}

.btn-close {
    border-radius: 50%;
}

/* ---- 표 ---- */
.table-wrap {
    border: 1px solid var(--edu-line);
    border-radius: 10px;
}

.edu-table {
    --bs-table-border-color: var(--edu-line);
    --bs-table-hover-bg: color-mix(in srgb, var(--edu-accent) 4%, var(--card-bg));
    --bs-table-bg: transparent;
    font-size: .9rem;
    color: var(--bs-body-color);
}

.edu-table thead th {
    background: var(--edu-surface-2);
    color: var(--edu-ink);
    font-weight: 600;
    font-size: .84rem;
    padding: .85rem .6rem;
    border-bottom: 0;
}

.edu-table td {
    padding: .7rem .6rem;
}

.edu-table tbody tr:last-child td {
    border-bottom: 0;
}

.edu-table a.fw-semibold,
.edu-table .fw-semibold a {
    font-weight: 600;
}

/* ---- 배지: 옅은 바탕의 작은 둥근 사각형 ---- */
.tag {
    border-radius: var(--edu-radius-sm);
    padding: .2rem .65rem;
    font-size: .76rem;
    font-weight: 600;
    min-width: 52px;
}

.tag-blue { background: #e3edff; color: #2c63d8; }
.tag-green { background: #e0f4e9; color: #1d8a52; }
.tag-red { background: #fde3e5; color: #d2434f; }
.tag-orange { background: #fdeed8; color: #c2781a; }
.tag-purple { background: #ece6fd; color: #7256d6; }
.tag-gray { background: #eceef2; color: #5d6472; }

/* ---- 페이징 ---- */
.pagination .page-link {
    border-radius: var(--edu-radius-sm) !important;
    min-width: 34px;
    text-align: center;
    margin: 0 .15rem;
    border-color: var(--edu-line);
    color: var(--edu-ink);
    background: var(--card-bg);
}

.pagination .page-item.active .page-link {
    background: var(--edu-primary);
    border-color: var(--edu-primary);
    color: #fff;
    box-shadow: none;
}

/* ---- 탭: 상자 모양 대신 글자 + 밑줄. 아래 카드와 붙이지 않으므로 둥근 모서리 때문에 붕 뜨지 않는다 ---- */
.edu-tabs {
    gap: 1.9rem;
    border-bottom: 1px solid var(--edu-line);
    margin-bottom: 1.2rem;
    padding: 0 .2rem;
}

.edu-tabs .nav-link,
.edu-tabs .nav-link:not(.active) {
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: transparent;
    padding: .7rem .1rem .85rem;
    margin-bottom: -1px;
    font-size: .98rem;
    font-weight: 500;
    color: var(--edu-ink-faint);
}

.edu-tabs .nav-link:not(.active):hover {
    background: transparent;
    color: var(--edu-ink);
    border-bottom-color: var(--edu-line-strong);
}

.edu-tabs .nav-link.active,
.edu-tabs:has(+ .filter-card) .nav-link.active {
    background: transparent;
    border: 0;
    border-bottom: 2px solid var(--edu-ink);
    color: var(--edu-ink);
    font-weight: 700;
}

.tabs-body {
    border-top-left-radius: var(--edu-radius);
}

/* ---- 모달·드롭다운·알림 ---- */
.modal-content {
    border: 0;
    border-radius: var(--edu-radius-xl);
    box-shadow: var(--edu-shadow-pop);
    overflow: hidden;
    background: var(--card-bg);
}

.modal-header {
    padding: 1.3rem 1.6rem 1.1rem;
    border-bottom: 1px solid var(--edu-line);
}

.modal-header .modal-title {
    font-family: var(--edu-font-serif);
    font-weight: 700;
    font-size: 1.3rem !important;
    color: var(--edu-ink);
}

.modal-body {
    padding: 1.4rem 1.6rem;
}

.modal-footer {
    padding: 1rem 1.6rem 1.2rem;
    border-top: 1px solid var(--edu-line);
}

.modal-body .edu-card {
    box-shadow: none;
}

.dropdown-menu {
    border-radius: 12px;
    border-color: var(--edu-line);
    padding: .4rem;
    box-shadow: var(--edu-shadow-pop) !important;
    background: var(--card-bg);
}

.dropdown-item {
    border-radius: 8px;
    padding: .5rem .8rem;
    font-size: .9rem;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: var(--edu-surface-2);
    color: var(--edu-ink);
}

.dropdown-item.text-danger:hover,
.dropdown-item.text-danger:focus {
    background: #fde3e5;
    color: #d2434f !important;
}

.alert {
    border-radius: 10px;
    border-width: 0;
}

/* ---- 그 밖의 조각 ---- */
.thumb,
.folder-card,
.dropzone {
    border-radius: 10px;
}

.folder-card.active {
    border-color: var(--edu-ink);
    background: var(--edu-surface-2);
}

.progress {
    border-radius: 999px;
    background: var(--edu-surface-2);
}

.progress-bar {
    background-color: var(--edu-primary);
}

.video-mini .vm-title {
    color: var(--edu-ink);
}

/* ---- 로그인 화면(시안 03): 왼쪽 큰 문구 + 오른쪽 로그인 카드 ---- */
.auth-shell {
    min-height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    background: var(--card-bg);
    padding: 2.6rem 3.6rem 2.4rem;
    color: var(--edu-ink);
}

.auth-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.auth-logo .brand-name,
.auth-brand .brand-name {
    display: block;
    font-family: var(--edu-font-serif);
    font-weight: 700;
    letter-spacing: .03em;
    color: var(--edu-ink);
}

.auth-logo .brand-name {
    font-size: 1.5rem;
}

.auth-logo .brand-sub,
.auth-brand .brand-sub {
    display: block;
    margin-top: .45rem;
    font-size: .6rem;
    letter-spacing: .34em;
    color: var(--edu-ink-soft);
}

.auth-top .topbar-tagline {
    margin: .4rem 0 0;
}

.auth-main {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 440px);
    align-items: center;
    gap: 4rem;
    max-width: 1180px;
    width: 100%;
    margin: 0 auto;
    padding: 2.5rem 0;
}

.auth-hero-title {
    font-family: var(--edu-font-serif);
    font-weight: 700;
    font-size: 3.6rem;
    line-height: 1.45;
    letter-spacing: -.01em;
    margin: 0;
    color: var(--edu-ink);
}

.auth-hero-title em {
    font-style: normal;
    color: var(--edu-accent);
}

.auth-hero-sub {
    position: relative;
    margin: 2.6rem 0 0;
    padding-top: 2rem;
    font-family: var(--edu-font-serif);
    font-size: 1.3rem;
    line-height: 1.6;
    color: var(--edu-ink);
}

.auth-hero-sub::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 2.6rem;
    height: 1px;
    background: var(--edu-ink-faint);
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--card-bg);
    border: 1px solid var(--edu-line);
    border-radius: var(--edu-radius-xl);
    padding: 2.8rem 2.4rem 2.4rem;
    box-shadow: 0 20px 60px rgba(16, 22, 35, .06);
}

.auth-brand {
    display: block;
    text-align: center;
    margin-bottom: 1.4rem;
    padding-bottom: 1.3rem;
    position: relative;
}

.auth-brand .brand-name {
    font-size: 1.75rem;
}

.auth-brand::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 2rem;
    height: 1px;
    margin-left: -1rem;
    background: var(--edu-ink-faint);
}

.auth-title {
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    color: var(--edu-ink);
    margin: 0 0 1.4rem;
}

.auth-help {
    font-size: .82rem;
    text-align: center;
    color: var(--edu-ink-soft);
    margin: -.8rem 0 1.4rem;
    line-height: 1.6;
}

.auth-field {
    position: relative;
    margin-bottom: .8rem;
}

.auth-field > i {
    position: absolute;
    left: 1.1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.15rem;
    color: var(--edu-ink);
    pointer-events: none;
}

.auth-field .form-control {
    height: 54px;
    padding-left: 3.1rem;
    font-size: .95rem;
}

.auth-submit {
    height: 56px;
    margin-top: .6rem;
    font-size: 1rem;
    --bs-btn-bg: #101623;
    --bs-btn-border-color: #101623;
    --bs-btn-hover-bg: #1c2740;
    --bs-btn-hover-border-color: #1c2740;
    --bs-btn-active-bg: #0a0f18;
    --bs-btn-active-border-color: #0a0f18;
}

.auth-or {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.1rem 0;
    font-size: .8rem;
    color: var(--edu-ink-faint);
}

.auth-or::before,
.auth-or::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--edu-line);
}

.auth-alt {
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .98rem;
}

.auth-words {
    padding-top: 1.2rem;
    position: relative;
}

.auth-words::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 2.4rem;
    height: 1px;
    background: var(--edu-ink-faint);
}

.auth-words span {
    display: block;
    font-size: .64rem;
    letter-spacing: .34em;
    line-height: 2.1;
    color: var(--edu-ink-soft);
}

/* ---- 모바일 하단 탭(시안의 휴대폰 화면) ---- */
.bottom-nav {
    display: none;
}

@media (max-width: 991.98px) {
    .auth-shell {
        padding: 1.6rem 1.4rem 1.6rem;
    }

    .auth-main {
        grid-template-columns: 1fr;
        gap: 2.2rem;
        padding: 2.2rem 0 1.6rem;
        justify-items: center;
    }

    .auth-hero {
        text-align: center;
    }

    .auth-hero-title {
        font-size: 2.3rem;
    }

    .auth-hero-sub {
        font-size: 1.05rem;
        margin-top: 1.6rem;
        padding-top: 1.4rem;
    }

    .auth-hero-sub::before {
        left: 50%;
        margin-left: -1.3rem;
    }

    .auth-card {
        padding: 2.2rem 1.5rem 1.8rem;
    }

    .auth-words {
        display: none;
    }

    .hero-side {
        display: none;
    }
}

@media (max-width: 768px) {
    .topbar {
        height: 64px;
        padding: 0 .9rem;
    }

    /* 모바일 상단바: 학원 이름 + 알림 + 메뉴(시안). 문구는 숨기고 검색은 돋보기만 두었다가 누르면 펼친다 */
    .topbar-brand {
        display: block;
        order: -1;
        margin-right: auto;
    }

    .topbar-tagline {
        display: none;
    }

    .topbar > .d-flex {
        min-width: 0;
    }

    .topbar .sidebar-toggle {
        order: 9;
    }

    .topbar-search {
        flex: 0 0 40px;
        max-width: none;
        margin-left: 0;
        position: static;
    }

    .topbar-search input {
        width: 40px;
        padding: 0;
        color: transparent;
        cursor: pointer;
        background: transparent;
        border-color: transparent;
    }

    .topbar-search input::placeholder {
        color: transparent;
    }

    .topbar-search i {
        position: absolute;
        left: auto;
        margin-left: 12px;
        top: 32px;
        pointer-events: none;
        color: var(--edu-ink);
        font-size: 1.1rem;
    }

    .topbar-search:focus-within {
        position: absolute;
        left: .9rem;
        right: .9rem;
        top: 12px;
        z-index: 30;
        flex: none;
    }

    .topbar-search:focus-within input {
        width: 100%;
        padding: 0 1rem 0 2.6rem;
        color: var(--edu-ink);
        cursor: text;
        background: var(--card-bg);
        border-color: var(--edu-accent);
        box-shadow: 0 0 0 4px var(--edu-focus-ring);
    }

    .topbar-search:focus-within input::placeholder {
        color: var(--edu-ink-faint);
    }

    .topbar-search:focus-within i {
        top: 20px;
        margin-left: 14px;
        color: var(--edu-ink-faint);
    }

    .topbar-user .user-name {
        display: none;
    }

    .page {
        padding: 1.5rem 1.1rem 6rem;
    }

    .page-head h1 {
        font-size: 1.9rem;
    }

    .page-head.hero h1 {
        font-size: 2.1rem;
    }

    .page-head .actions {
        width: 100%;
    }

    .page-head .actions .btn {
        flex: 1 1 0;
        white-space: nowrap;
    }

    .stat-card {
        padding: .45rem 1.3rem;
    }

    .stat-card .stat-icon {
        width: 10px;
        height: 10px;
        font-size: 0;
    }

    .stat-card .stat-value {
        font-size: 1.5rem;
    }

    .row:has(> [class*="col"] > .stat-card) > [class*="col"]:nth-child(odd) {
        border-left: 0;
    }

    .bottom-nav {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1040;
        background: var(--card-bg);
        border-top: 1px solid var(--edu-line);
        padding: .45rem .3rem calc(.45rem + env(safe-area-inset-bottom));
    }

    .bottom-nav a,
    .bottom-nav button {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: .2rem;
        border: 0;
        background: transparent;
        color: var(--edu-ink-faint);
        text-decoration: none;
        font-size: .68rem;
        padding: .3rem 0;
    }

    .bottom-nav i {
        font-size: 1.3rem;
        line-height: 1;
    }

    .bottom-nav a.active {
        color: var(--edu-ink);
        font-weight: 700;
    }
}

/* ---- 다크 모드 보정 ---- */
[data-bs-theme="dark"] .edu-table thead th {
    background: var(--edu-surface-2);
}

[data-bs-theme="dark"] .topbar-avatar {
    background: #262c37;
    color: #8b93a3;
}

[data-bs-theme="dark"] .form-control:hover:not(:disabled):not([readonly]),
[data-bs-theme="dark"] .form-select:hover:not(:disabled) {
    border-color: #566072;
}

[data-bs-theme="dark"] .tag-blue { background: rgba(60, 110, 230, .24); color: #9bbcff; }
[data-bs-theme="dark"] .tag-green { background: rgba(40, 160, 100, .22); color: #7fdcae; }
[data-bs-theme="dark"] .tag-red { background: rgba(220, 70, 85, .24); color: #ff9aa5; }
[data-bs-theme="dark"] .tag-orange { background: rgba(210, 130, 30, .24); color: #ffc87a; }
[data-bs-theme="dark"] .tag-purple { background: rgba(120, 90, 230, .26); color: #c6b6ff; }
[data-bs-theme="dark"] .tag-gray { background: rgba(255, 255, 255, .1); color: #c2c8d4; }

[data-bs-theme="dark"] .stat-icon.tone-blue { background: #5c86e0; color: transparent; }
[data-bs-theme="dark"] .stat-icon.tone-green { background: #4fae82; color: transparent; }
[data-bs-theme="dark"] .stat-icon.tone-purple { background: #8a79d8; color: transparent; }
[data-bs-theme="dark"] .stat-icon.tone-red { background: #d97781; color: transparent; }
[data-bs-theme="dark"] .stat-icon.tone-orange { background: #d7a45c; color: transparent; }

[data-bs-theme="dark"] .dropdown-item.text-danger:hover,
[data-bs-theme="dark"] .dropdown-item.text-danger:focus {
    background: rgba(220, 70, 85, .22);
    color: #ff9aa5 !important;
}

[data-bs-theme="dark"] .auth-submit {
    --bs-btn-bg: #e9ecf2;
    --bs-btn-border-color: #e9ecf2;
    --bs-btn-color: #101623;
    --bs-btn-hover-bg: #ffffff;
    --bs-btn-hover-border-color: #ffffff;
    --bs-btn-hover-color: #101623;
    --bs-btn-active-bg: #d5d9e0;
    --bs-btn-active-color: #101623;
}

/* 모바일 상단바 순서: 학원 이름 · (검색 · 다크모드 · 알림 · 사용자) · 메뉴 */
@media (max-width: 768px) {
    .topbar > .d-flex {
        display: contents !important;
    }

    .topbar-brand {
        order: -1;
        margin-right: auto;
    }

    .topbar .sidebar-toggle {
        order: 9;
    }
}

.sidebar-brand .brand-sub {
    letter-spacing: .2em;
    font-size: .54rem;
}

/* 로그아웃·비밀번호 변경이 사용자 메뉴 안에 있으므로, 좁은 화면에서도 사용자 아이콘은 항상 보여야 한다 */
@media (max-width: 575.98px) {
    .topbar-user .topbar-avatar {
        display: flex;
        width: 34px;
        height: 34px;
    }

    .topbar-user {
        gap: .15rem;
    }
}

/* 로그인 카드 안의 오류 안내(화면에 바로 표시, 알림창 아님) */
.auth-card .ajax-error,
.auth-card .alert {
    margin: 0 0 1rem;
    font-size: .88rem;
    text-align: left;
    display: flex;
    gap: .5rem;
    align-items: flex-start;
}

.auth-card .ajax-error[hidden] {
    display: none;
}

.auth-card .ajax-error::before {
    content: "\f333"; /* bootstrap-icons: exclamation-circle */
    font-family: "bootstrap-icons";
    line-height: 1.35;
}

/* ---- 좁은 폭에서 글자가 어색하게 꺾이지 않게 ---- */
/* 버튼 글자는 한 줄로 유지한다("조회하기"가 두 줄로 꺾이던 문제) */
.btn {
    white-space: nowrap;
}

/* 통계 숫자와 단위("73.8점")는 떨어지지 않게 하고, 칸이 좁으면 글자를 줄인다 */
.stat-card .stat-value {
    white-space: nowrap;
}

.stat-card .stat-value small {
    white-space: normal;
}

@media (max-width: 1199.98px) {
    .stat-card {
        padding: .5rem 1.3rem;
    }

    .stat-card .stat-value {
        font-size: 1.55rem;
    }
}

/* 표: 짧은 칸(학년·날짜·상태 등)은 글자 단위로 세로로 깨지지 않게 한 줄로 두고, 제목처럼 긴 칸(text-start)만 줄바꿈을 허용한다.
   폭이 모자라면 표가 좌우로 밀린다(table-responsive). */
.edu-table th,
.edu-table td {
    white-space: nowrap;
}

.edu-table td.text-start {
    white-space: normal;
    min-width: 11rem;
    word-break: keep-all;
    overflow-wrap: anywhere;
}

/* 필터 줄: 라벨·입력칸이 지나치게 좁아지지 않게 */
.filter-card .form-select,
.filter-card .form-control {
    min-width: 5.5rem;
}

/* ---- 휴대폰: 표를 옆으로 밀어도 마지막 칸(제출하기·취소·수정 등 "관리" 버튼)은 오른쪽에 고정해 항상 보이게 한다 ---- */
@media (min-width: 640.02px) and (max-width: 768px) {
    .edu-table th,
    .edu-table td {
        padding-left: .5rem;
        padding-right: .5rem;
    }

    .edu-table td.text-start {
        min-width: 8.5rem;
    }

    .edu-table th:last-child,
    .edu-table td:last-child {
        position: sticky;
        right: 0;
        z-index: 1;
        background: var(--card-bg);
        box-shadow: -8px 0 10px -8px rgba(16, 22, 35, .18);
    }

    .edu-table thead th:last-child {
        background: var(--edu-surface-2);
    }

    .edu-table.table-hover tbody tr:hover td:last-child {
        background: var(--card-bg);
    }
}

/* ---- 제출 파일 보기(main.js의 data-file-viewer): 한 장씩 화면에 맞춰 보여주고, 위 선택 상자·좌우 화살표로 넘긴다 ---- */
.fv-bar {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .6rem 1rem;
    border-bottom: 1px solid var(--card-border);
}

.fv-select {
    flex: 1;
    min-width: 0;
    max-width: 26rem;
}

.fv-count {
    font-weight: 700;
    font-size: .88rem;
    white-space: nowrap;
    margin-right: auto;
}

.fv-stage {
    position: relative;
    background: var(--bs-tertiary-bg);
    border-radius: 0 0 var(--edu-radius) var(--edu-radius);
}

.fv-view {
    display: flex;
    align-items: center;
    justify-content: center;
    height: calc(100vh - 13rem);
    min-height: 16rem;
    padding: .75rem 3.6rem;
    overflow: auto;
}

/* 사진은 창 높이에 맞춰 통째로 보이게 한다(잘리지 않게). 크게 보려면 "새 탭에서 열기". */
.fv-img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.fv-doc {
    text-align: center;
    color: var(--edu-ink-soft);
    line-height: 1.8;
}

.fv-doc i {
    font-size: 2.6rem;
}

.fv-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 50%;
    border: 1px solid var(--edu-line-strong);
    background: var(--card-bg);
    color: var(--edu-ink);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fv-prev { left: .6rem; }
.fv-next { right: .6rem; }

.fv-nav:hover:not(:disabled) {
    background: var(--edu-primary);
    border-color: var(--edu-primary);
    color: #fff;
}

.fv-nav:disabled {
    opacity: .3;
    cursor: default;
}

.fv-single .fv-select,
.fv-single .fv-nav {
    display: none;
}

@media (max-width: 768px) {
    .fv-bar {
        flex-wrap: wrap;
        padding: .5rem .7rem;
    }

    .fv-select {
        flex-basis: 100%;
        max-width: none;
    }

    /* 휴대폰은 옆으로 밀어 넘기므로 화살표를 작게, 사진 자리를 넓게 */
    .fv-view {
        height: calc(100vh - 15rem);
        padding: .5rem;
    }

    .fv-nav {
        width: 2.1rem;
        height: 2.1rem;
        opacity: .85;
    }

    .fv-prev { left: .3rem; }
    .fv-next { right: .3rem; }
}

/* ---- 숙제 제출 창: 골라 둔 파일 목록 ---- */
.sm-list {
    max-height: 11rem;
    overflow-y: auto;
}

.sm-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .6rem;
    padding: .4rem .65rem;
    border: 1px solid var(--card-border);
    border-radius: var(--edu-radius-sm, 8px);
    font-size: .85rem;
}

.sm-item + .sm-item {
    margin-top: .35rem;
}

.sm-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sm-item .btn-close {
    font-size: .65rem;
    flex: none;
}

/* ---- 클리닉 예약 창: 시간 칸이 많아져(기본 9~22시) 두 줄로 나누고, 넘치면 그 안에서만 스크롤한다 ---- */
.slot-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 19rem;
    overflow-y: auto;
    align-content: start;
}

.slot-list > div {
    grid-column: 1 / -1;
}

.slot-list .slot-btn {
    padding-left: .3rem;
    padding-right: .3rem;
    font-size: .88rem;
}

/* ---- 과제율: 입력칸 옆 자동 계산 % ---- */
.rate-out {
    min-width: 2.8rem;
    text-align: left;
}

/* ---- 클리닉 날짜별 시간표: 1시간 칸을 눌러 켜고 끈다 ---- */
.hour-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(8.2rem, 1fr));
    gap: .5rem;
}

.hour-cell {
    margin: 0;
}

.hour-cell .btn {
    font-size: .88rem;
    padding: .55rem .3rem;
}

.hour-cell .btn-check:checked + .btn {
    background: var(--edu-primary);
    border-color: var(--edu-primary);
    color: #fff;
}

.hour-cell .btn-check:not(:checked) + .btn {
    color: var(--edu-ink-soft);
    background: transparent;
}

/* 제출 파일 보기: 사진을 누르면 폭에 맞춰 크게(그 안에서 세로 스크롤), 다시 누르면 화면에 맞게 */
.fv-img {
    cursor: zoom-in;
}

.fv-view.fv-zoom {
    align-items: flex-start;
}

.fv-view.fv-zoom .fv-img {
    max-height: none;
    width: 100%;
    cursor: zoom-out;
}

/* ---- 한글은 단어(어절) 중간에서 줄이 바뀌면 읽기 어렵다: 띄어쓰기 기준으로 줄바꿈하고, 너무 긴 영문·파일 이름만 중간에서 끊는다 ---- */
body {
    word-break: keep-all;
    overflow-wrap: break-word;
}

/* ---- 휴대폰(≤640px): 표 → 카드. 표가 화면보다 넓어 옆으로 밀어야 했던 것을, 행 하나를 카드 하나로 세로로 쌓아 보여준다.
        칸 이름은 main.js의 labelTables가 머리글에서 옮겨 준 data-label을 왼쪽에 작게 적는다. ---- */
@media (max-width: 640px) {
    .table-wrap {
        border: 0;
        border-radius: 0;
        overflow: visible;
    }

    .table-wrap .table-responsive {
        overflow-x: visible;
    }

    .edu-table thead {
        display: none;
    }

    .edu-table,
    .edu-table tbody,
    .edu-table tr,
    .edu-table td {
        display: block;
        width: auto;
    }

    .edu-table tr {
        border: 1px solid var(--card-border);
        border-radius: 10px;
        padding: .6rem .9rem;
        margin-bottom: .6rem;
        background: var(--card-bg);
    }

    .edu-table tr:last-child {
        margin-bottom: 0;
    }

    .table.edu-table > tbody > tr > td {
        position: relative;
        border: 0;
        box-shadow: none;
        padding: .34rem 0 .34rem 5.4rem;
        min-height: 1.95rem;
        text-align: left;
        white-space: normal;
        min-width: 0;
        font-size: .93rem;
        line-height: 1.45;
    }

    .edu-table td[data-label]::before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        top: .42rem;
        width: 5rem;
        font-size: .78rem;
        font-weight: 600;
        color: var(--edu-ink-soft);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* "데이터가 없습니다" 같은 한 줄짜리 안내 행 */
    .table.edu-table > tbody > tr > td:not([data-label]) {
        padding-left: 0;
        text-align: center;
    }

    /* 번호는 카드에서는 의미가 없어 숨긴다 */
    .edu-table td[data-label="No."] {
        display: none;
    }

    /* 제목 칸(text-start)은 카드의 머리처럼 조금 크게 */
    .table.edu-table > tbody > tr > td.text-start {
        font-size: 1rem;
        font-weight: 600;
    }

    /* 가운데 정렬용 여백·정렬은 카드에서는 왼쪽으로 */
    .edu-table td .mx-auto {
        margin-left: 0 !important;
    }

    .edu-table td .justify-content-center {
        justify-content: flex-start !important;
    }

    .edu-table td input.form-control:not([type="number"]) {
        width: 100%;
    }

    /* 버튼 칸("관리")은 카드 맨 아래 한 줄을 통째로 쓰고, 손가락으로 누르기 쉽게 키운다 */
    .table.edu-table > tbody > tr > td[data-label="관리"],
    .table.edu-table > tbody > tr > td[data-label="상세"] {
        padding: .6rem 0 .15rem;
        margin-top: .35rem;
        border-top: 1px solid var(--edu-line);
        white-space: normal;
    }

    .edu-table td[data-label="관리"]::before,
    .edu-table td[data-label="상세"]::before {
        content: none;
    }

    .edu-table td .btn-sm,
    .edu-table td .form-select-sm,
    .edu-table td .form-control-sm {
        min-height: 2.25rem;
        font-size: .88rem;
    }

    .edu-table td .btn-sm {
        padding: .38rem .8rem;
    }

    .edu-table.table-hover > tbody > tr:hover > * {
        --bs-table-bg-state: transparent;
    }
}

/* 휴대폰: 카드 안쪽 여백을 줄여 표 카드가 쓸 폭을 넓힌다 */
@media (max-width: 640px) {
    .edu-card {
        padding: 1rem .9rem;
    }
}

/* 휴대폰: 필터의 검색어 칸은 한 줄을 통째로 쓰고(안내 문구가 잘리지 않게) 버튼은 그 아래 줄에 반반 */
@media (max-width: 640px) {
    .filter-card form .d-flex.gap-2 {
        flex-wrap: wrap;
    }

    .filter-card form .d-flex.gap-2 > input[type="search"] {
        flex: 1 1 100%;
    }

    .filter-card form .d-flex.gap-2 > .btn {
        flex: 1 1 0;
    }
}

/* 휴대폰 카드: 선택 체크박스는 한 줄을 차지하지 않고 카드 오른쪽 위 모서리에 둔다 */
@media (max-width: 640px) {
    .edu-table tr {
        position: relative;
    }

    .table.edu-table > tbody > tr > td.col-check {
        position: absolute;
        top: .6rem;
        right: .8rem;
        z-index: 1;
        width: auto;
        min-height: 0;
        padding: 0;
    }

    .edu-table td.col-check::before {
        content: none;
    }

    .edu-table td.col-check .form-check-input {
        width: 1.3rem;
        height: 1.3rem;
    }
}

@media (max-width: 640px) {
    /* 긴 제목이 오른쪽 위 체크박스와 겹치지 않게 */
    .edu-table tr:has(> td.col-check) > td.text-start {
        padding-right: 2rem;
    }
}

/* ---- 제출 파일 보기 · 모아 보기(사진첩): 작은 그림 바둑판 + 체크박스로 여러 개 골라 삭제 ---- */
.fv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
    gap: .7rem;
    padding: .9rem 1rem 1.1rem;
    max-height: calc(100vh - 13rem);
    overflow-y: auto;
    background: var(--bs-tertiary-bg);
    border-radius: 0 0 var(--edu-radius) var(--edu-radius);
}

.fv-tile {
    position: relative;
    background: var(--card-bg);
    border: 2px solid var(--card-border);
    border-radius: 10px;
    overflow: hidden;
}

.fv-tile.is-selected {
    border-color: var(--edu-accent);
}

.fv-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 3 / 4;
    padding: 0;
    border: 0;
    background: var(--edu-surface-2);
    color: var(--edu-ink-soft);
    font-size: 2.2rem;
    cursor: zoom-in;
}

.fv-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.fv-check {
    position: absolute;
    top: 0;
    left: 0;
    padding: .45rem .6rem .7rem .45rem;
    margin: 0;
    cursor: pointer;
}

.fv-check .form-check-input {
    width: 1.45rem;
    height: 1.45rem;
    margin: 0;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(16, 22, 35, .35);
    cursor: pointer;
}

.fv-cap {
    padding: .35rem .5rem;
    font-size: .76rem;
    color: var(--edu-ink-soft);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 768px) {
    .fv-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: .45rem;
        padding: .6rem;
        max-height: calc(100vh - 14rem);
    }

    .fv-cap {
        display: none;
    }
}

/* ---- 일정 관리 달력(월·주). 날짜 칸마다 일정 띠(구분별 색). 주 보기는 칸이 길고 일정을 전부 보여준다 ---- */
.sched-cal {
    border: 1px solid var(--edu-line);
    border-radius: 10px;
    overflow: hidden;
}

.sched-head,
.sched-week {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.sched-head span {
    padding: .55rem .4rem;
    text-align: center;
    font-size: .8rem;
    font-weight: 600;
    background: var(--edu-surface-2);
    color: var(--edu-ink);
}

.sched-cal .sun { color: #d92d40; }
.sched-cal .sat { color: var(--edu-accent); }

.sched-day {
    min-height: 6.8rem;
    padding: .3rem .3rem .4rem;
    border-top: 1px solid var(--edu-line);
    border-left: 1px solid var(--edu-line);
    min-width: 0;
}

.sched-day:first-child {
    border-left: 0;
}

.sched-cal.is-week .sched-day {
    min-height: 13rem;
}

.sched-day.is-out {
    background: color-mix(in srgb, var(--edu-surface-2) 55%, transparent);
}

.sched-day.is-out .sched-num,
.sched-day.is-out .sched-event {
    opacity: .5;
}

.sched-num {
    display: flex;
    align-items: center;
    gap: .3rem;
    padding: .1rem .25rem;
    font-size: .82rem;
    font-weight: 600;
    color: var(--edu-ink);
    text-decoration: none;
    border-radius: 6px;
}

.sched-num:hover {
    background: var(--edu-surface-2);
}

.sched-num .full {
    display: none;
}

.sched-cal.is-week .sched-num .num {
    display: none;
}

.sched-cal.is-week .sched-num .full {
    display: inline;
}

.sched-day.is-today .sched-num .num,
.sched-cal.is-week .sched-day.is-today .sched-num .full {
    background: var(--edu-primary);
    color: #fff;
    border-radius: 999px;
    padding: .05rem .45rem;
}

/* 일정 개수 배지는 휴대폰(띠를 숨길 때)에서만 쓴다 */
.sched-count {
    display: none;
    margin-left: auto;
    min-width: 1.25rem;
    padding: 0 .3rem;
    border-radius: 999px;
    background: var(--edu-accent);
    color: #fff;
    font-size: .68rem;
    line-height: 1.25rem;
    text-align: center;
}

.sched-events {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: .2rem;
}

.sched-event {
    display: block;
    padding: .12rem .35rem;
    border-radius: 5px;
    font-size: .74rem;
    line-height: 1.35;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: #e9edf5;
    color: #3d4760;
}

.sched-cal.is-week .sched-event {
    white-space: normal;
}

.sched-event .time {
    font-weight: 700;
}

.sched-event:hover {
    filter: brightness(.95);
}

.sched-event.tone-blue { background: #e4edff; color: #1f55d6; }
.sched-event.tone-purple { background: #ebe4ff; color: #5a32d0; }
.sched-event.tone-red { background: #ffe4e6; color: #c22537; }
.sched-event.tone-green { background: #dcf6e8; color: #0f7a41; }

[data-bs-theme="dark"] .sched-event { background: rgba(120, 132, 160, .25); color: #c9d1e3; }
[data-bs-theme="dark"] .sched-event.tone-blue { background: rgba(31, 99, 255, .25); color: #9dbcff; }
[data-bs-theme="dark"] .sched-event.tone-purple { background: rgba(120, 80, 240, .25); color: #c4b1ff; }
[data-bs-theme="dark"] .sched-event.tone-red { background: rgba(217, 45, 64, .25); color: #ff9aa5; }
[data-bs-theme="dark"] .sched-event.tone-green { background: rgba(23, 163, 91, .25); color: #7fe6b3; }

.sched-more {
    font-size: .72rem;
    color: var(--edu-ink-soft);
    text-decoration: none;
    padding-left: .35rem;
}

.sched-legend {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin-top: .7rem;
}

/* 휴대폰: 월 보기는 칸이 너무 좁아 일정 띠 대신 개수만 보여준다(날짜를 누르면 그 날 목록). 주 보기는 하루를 한 줄로 세로로 쌓는다 */
@media (max-width: 640px) {
    .sched-cal.is-month .sched-day {
        min-height: 3.6rem;
        padding: .25rem .15rem;
    }

    .sched-cal.is-month .sched-events {
        display: none;
    }

    .sched-cal.is-month .sched-num {
        flex-direction: column;
        gap: .15rem;
        padding: .1rem 0;
    }

    .sched-cal.is-month .sched-count {
        display: inline-block;
        margin-left: 0;
    }

    .sched-cal.is-week .sched-head {
        display: none;
    }

    .sched-cal.is-week .sched-week {
        grid-template-columns: 1fr;
    }

    .sched-cal.is-week .sched-day {
        min-height: 0;
        border-left: 0;
        padding: .5rem .6rem;
    }

    .sched-cal.is-week .sched-week .sched-day:first-child {
        border-top: 0;
    }

    .sched-cal.is-week .sched-event {
        font-size: .86rem;
        padding: .3rem .5rem;
    }
}

/* ---- 중간관리자 권한 설정 표 ---- */
/* 권한 표: 칸 폭을 고정해 모든 체크박스가 같은 격자의 칸 가운데에 놓이게 한다(머리글 글자·"전체" 체크·낱개 체크가 한 줄로 맞는다). */
.perm-table {
    table-layout: fixed;
    min-width: 520px;
}

.perm-table th,
.perm-table td {
    white-space: nowrap;
    padding: .5rem .6rem;
    text-align: center;
    vertical-align: middle;
}

.perm-table th:first-child,
.perm-table td:first-child {
    width: 30%;
    text-align: left;
}

.perm-table thead th {
    background: var(--edu-surface-2);
    font-size: .85rem;
    font-weight: 600;
}

/* "전체 선택" 줄과 "줄 전체" 칸은 옅은 바탕으로 낱개 권한과 구분한다 */
.perm-table tr.perm-all td,
.perm-table td:last-child,
.perm-table th:last-child {
    background: color-mix(in srgb, var(--edu-surface-2) 55%, transparent);
}

.perm-table tr.perm-all td {
    font-size: .85rem;
    color: var(--edu-ink-soft);
    border-bottom-width: 2px;
}

.perm-table .form-check-input {
    display: block;
    margin: 0 auto;
    float: none;
}

.perm-table .form-check-input {
    width: 1.15rem;
    height: 1.15rem;
}

/* 휴대폰: 통계 카드의 숫자 옆 설명(예: "진행중 · D-5")이 카드 밖으로 밀려나지 않게 숫자 아래 줄로 내린다 */
@media (max-width: 640px) {
    .stat-card .stat-value {
        white-space: normal;
    }

    .stat-card .stat-value small {
        display: block;
        margin-left: 0;
        white-space: normal;
    }

    .stat-card,
    .stat-card > div {
        min-width: 0;
    }
}

/* 일정 관리: 다른 메뉴에서 끌어온 일정(시험일 = 주황, 숙제 마감 = 청록) */
.tag-teal { background: #dcf3f1; color: #17786f; }
[data-bs-theme="dark"] .tag-teal { background: rgba(40, 170, 160, .22); color: #7fd9d0; }
.sched-event.tone-orange { background: #fdeed8; color: #b3690f; }
.sched-event.tone-teal { background: #dcf3f1; color: #17786f; }
[data-bs-theme="dark"] .sched-event.tone-orange { background: rgba(210, 130, 30, .25); color: #ffc87a; }
[data-bs-theme="dark"] .sched-event.tone-teal { background: rgba(40, 170, 160, .25); color: #7fd9d0; }

/* 표 칸 정렬(main.js labelTables가 머리글 이름을 보고 붙인다): 숫자 = 오른쪽·자릿수 맞춤, 길이가 제각각인 글자 = 왼쪽, 나머지(날짜·상태·버튼) = 가운데.
   휴대폰 카드 보기(≤640px)는 칸이 세로로 쌓여 전부 왼쪽이므로 그보다 넓을 때만 적용한다. */
.edu-table td,
.stat-card .stat-value {
    font-variant-numeric: tabular-nums;
}

@media (min-width: 641px) {
    .edu-table th.col-l,
    .edu-table td.col-l,
    .edu-table th.text-start {
        text-align: left;
    }

    .edu-table th.col-r,
    .edu-table td.col-r {
        text-align: right;
        padding-right: 1.1rem;
    }
}

/* 버튼형 선택(칩) — main.js EduChips가 <select data-chips>를 이 묶음으로 바꿔 보여준다. 입력칸과 같은 높이라 필터 줄에서 나란히 맞는다. */
.chips-source {
    display: none !important;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
}

.chip {
    min-height: 38px;
    padding: 0 .8rem;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--edu-radius-md, 8px);
    background: var(--card-bg, #fff);
    color: var(--bs-body-color);
    font-size: .88rem;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .12s, border-color .12s, color .12s;
}

.chip:hover:not(.active):not(:disabled) {
    border-color: var(--edu-primary);
    background: color-mix(in srgb, var(--edu-primary) 6%, var(--card-bg, #fff));
}

.chip.active {
    border-color: var(--edu-primary);
    background: var(--edu-primary);
    color: #fff;
    font-weight: 600;
}

.chip:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--edu-primary) 45%, transparent);
    outline-offset: 2px;
}

.chip:disabled {
    opacity: .5;
    cursor: default;
}

.chips-sm {
    gap: .25rem;
}

.edu-table .chips-sm {
    justify-content: center;
}

.chips-sm .chip {
    min-height: 31px;
    padding: 0 .6rem;
    font-size: .8rem;
}

/* 선택지가 많은 칩 묶음이 든 칸은 격자 폭 대신 내용 폭만큼 쓴다(좁은 칸에서 여러 줄로 꺾이지 않게). 휴대폰에서는 한 줄을 통째로 쓴다. */
.row > .col-chips {
    flex: 0 0 auto;
    width: auto;
    max-width: 100%;
}

@media (max-width: 640px) {
    .row > .col-chips {
        width: 100%;
    }

    .chips {
        gap: .25rem;
    }

    .chip {
        padding: 0 .45rem;
    }

    .edu-table td .chips-sm {
        justify-content: flex-start;
    }
}

/* 칩이 든 필터 줄에서는 검색어 칸이 남는 폭을 다 쓴다(칩 때문에 다음 줄로 밀려도 좁게 남지 않게). */
form.row:has(.col-chips) > [class*="col-"]:has(input[type="search"]) {
    flex: 1 1 320px;
    width: auto;
    max-width: 100%;
}

.row > .col-chips-full {
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
}

/* 작은 버튼 크기 통일: 윤곽 버튼(btn-line)과 색 버튼(btn-primary/outline btn-sm)이 한 줄에 나란히 놓일 때 높이·글자 크기가 달라 보이던 것을 맞춘다
   (학생 "내 숙제"의 파일 추가 / 제출 파일, 관리자 목록의 학생 목록 / 상세 등). 작은 버튼의 치수는 여기 한 곳에서만 정한다. */
.btn-sm,
.btn-line,
.btn-line.btn-sm {
    --bs-btn-padding-y: .3rem;
    --bs-btn-padding-x: .75rem;
    --bs-btn-font-size: .8rem;
    --bs-btn-line-height: 1.4;
    --bs-btn-border-width: 1px;
}

/* 높이 통일: 한 줄에 나란히 놓이는 것들(입력칸·선택 상자·버튼·칩)은 같은 높이여야 한다. 크기는 두 가지뿐이다.
   - 보통(필터 카드·폼): 44px — 입력칸/선택 상자/버튼이 이미 이 높이라 칩만 맞춘다.
   - 작은 것(표 안, 카드 안 필터, 상태 줄의 *-sm): 32px — 작은 버튼·작은 입력칸·작은 선택 상자·작은 칩을 모두 여기에 맞춘다.
   새 컨트롤을 만들 때 높이를 따로 정하지 말고 이 두 값에 맞출 것(휴대폰 표 카드 안은 아래 규칙으로 36px). */
.chip {
    min-height: 2.75rem;
}

.btn-sm,
.btn-line,
.btn-line.btn-sm {
    --bs-btn-padding-y: .3775rem;   /* 글자 12.8px x 줄높이 1.4 + 위아래 여백 + 테두리 = 32px */
}

input.form-control-sm,
select.form-select-sm {
    height: 2rem;
    min-height: 2rem;
    padding-top: .2rem;
    padding-bottom: .2rem;
    font-size: .8rem;
}

.chips-sm .chip {
    min-height: 2rem;
}

@media (max-width: 640px) {
    .edu-table td .chips-sm .chip {
        min-height: 2.25rem;
        font-size: .88rem;
    }

    .edu-table td input.form-control-sm,
    .edu-table td select.form-select-sm {
        height: 2.25rem;
        font-size: .88rem;
    }
}
