/* 강사 포털 공통 레이아웃 스타일 (라이트/다크 테마 변수화) */
:root {
    --t-primary: #2563eb;
    --t-primary-dark: #1d4ed8;
    --t-bg: #f1f5f9;
    --t-surface: #ffffff;
    --t-border: #e2e8f0;
    --t-text: #1e293b;
    --t-muted: #64748b;
    --t-hover: #f8fafc;
    --t-thead: #f8fafc;
    --t-active-bg: #eff6ff;
    --t-header-h: 56px;
    --t-sidebar-w: 220px;
}

/* 다크 테마 (teacher-theme.js 가 <html data-theme="dark"> 설정) */
:root[data-theme="dark"] {
    --t-primary: #3b82f6;
    --t-primary-dark: #60a5fa;
    --t-bg: #0f172a;
    --t-surface: #1e293b;
    --t-border: #334155;
    --t-text: #e2e8f0;
    --t-muted: #94a3b8;
    --t-hover: #273449;
    --t-thead: #172033;
    --t-active-bg: #1e3a5f;
}

* { box-sizing: border-box; }

/* 네이티브 컨트롤(date picker·file input·스크롤바)도 테마 추종 */
:root { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

body {
    margin: 0;
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--t-bg);
    color: var(--t-text);
}

/* 상단 헤더 */
.t-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--t-header-h);
    background: var(--t-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 100;
    box-shadow: 0 1px 4px rgba(0,0,0,.15);
}
.t-header .t-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.t-header .t-brand { font-size: 17px; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; }
.t-header .t-right { display: flex; align-items: center; gap: 10px; font-size: 14px; flex-shrink: 0; }
.t-header .t-user { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
/* 모바일 사이드바 토글(햄버거) — 데스크톱에선 숨김 */
.t-header .t-menu-btn {
    display: none;
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.35);
    color: #fff;
    width: 34px; height: 34px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    flex-shrink: 0;
}
.t-header .t-menu-btn:hover { background: rgba(255,255,255,.28); }
.t-header .t-ctrl {
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.35);
    color: #fff;
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    line-height: 1.4;
    white-space: nowrap;
}
.t-header .t-ctrl:hover { background: rgba(255,255,255,.28); }
.t-header .t-logout {
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.35);
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}
.t-header .t-logout:hover { background: rgba(255,255,255,.28); }

/* 레이아웃 셸 */
.t-shell { display: flex; padding-top: var(--t-header-h); min-height: 100vh; }

/* 사이드바 */
.t-sidebar {
    width: var(--t-sidebar-w);
    background: var(--t-surface);
    border-right: 1px solid var(--t-border);
    position: fixed;
    top: var(--t-header-h);
    bottom: 0; left: 0;
    padding: 16px 0;
    overflow-y: auto;
}
/* 대분류(그룹) 헤더 = 아코디언 토글 버튼. 라벨 타이포는 기존 유지 + 우측 화살표 */
.t-sidebar .t-nav-group {
    padding: 16px 20px 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--t-muted);
    text-transform: uppercase;
    letter-spacing: .06em;
    /* 버튼화 */
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    background: none;
    border: 0;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}
.t-sidebar .t-nav-group:hover { color: var(--t-text); }
.t-sidebar .t-nav-arrow {
    width: 10px;
    height: 10px;
    flex: none;
    fill: currentColor;
    transform: rotate(180deg);   /* 접힘 = 아래 방향 */
    transition: transform .18s;
}
.t-sidebar .t-nav-sec.open > .t-nav-group .t-nav-arrow { transform: rotate(0deg); }
.t-sidebar .t-nav-sub { display: none; }
.t-sidebar .t-nav-sec.open > .t-nav-sub { display: block; }
.t-sidebar .t-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: var(--t-text);
    text-decoration: none;
    font-size: 14px;
    border-left: 3px solid transparent;
}
.t-sidebar .t-nav-item:hover { background: var(--t-hover); }
.t-sidebar .t-nav-item.active {
    background: var(--t-active-bg);
    color: var(--t-primary-dark);
    border-left-color: var(--t-primary);
    font-weight: 600;
}

/* 메인 */
.t-main {
    margin-left: var(--t-sidebar-w);
    padding: 24px;
    flex: 1;
    width: calc(100% - var(--t-sidebar-w));
}
.t-page-title { font-size: 20px; font-weight: 700; margin: 0 0 18px; }

/* 카드 */
.t-card {
    background: var(--t-surface);
    border: 1px solid var(--t-border);
    border-radius: 10px;
    padding: 18px;
}

/* 대시보드 메뉴 카드 그리드 */
.t-dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
}
.t-dash-card {
    display: block;
    background: var(--t-surface);
    border: 1px solid var(--t-border);
    border-radius: 10px;
    padding: 18px;
    text-decoration: none;
    color: var(--t-text);
    transition: border-color .15s, box-shadow .15s;
}
.t-dash-card:hover { border-color: var(--t-primary); box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.t-dash-card .t-dash-title { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.t-dash-card .t-dash-desc { font-size: 13px; color: var(--t-muted); }

/* 테이블 */
.t-table-wrap { overflow-x: auto; background: var(--t-surface); border: 1px solid var(--t-border); border-radius: 10px; }
.t-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 720px; }
.t-table th, .t-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--t-border); white-space: nowrap; }
.t-table th { background: var(--t-thead); color: var(--t-muted); font-weight: 600; }
.t-table tbody tr:hover { background: var(--t-hover); }

/* 시간 셀 (필리핀 + 한국 병기) */
.t-time-ph { font-weight: 600; }
.t-time-kr { display: block; font-size: 11px; color: var(--t-muted); margin-top: 2px; }

/* 배지 */
.t-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.t-badge.lvl { background: #fef3c7; color: #92400e; }
.t-badge.absent { background: #fee2e2; color: #991b1b; }
:root[data-theme="dark"] .t-badge.lvl { background: #78350f; color: #fde68a; }
:root[data-theme="dark"] .t-badge.absent { background: #7f1d1d; color: #fecaca; }

.t-empty { padding: 40px; text-align: center; color: var(--t-muted); }
.t-tz-note { font-size: 12px; color: var(--t-muted); margin: 10px 2px 0; }

/* 사이드바 열림 시 배경 딤 (모바일 전용, 사이드바보다 아래) */
.t-backdrop {
    display: none;
    position: fixed;
    top: var(--t-header-h); left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,.45);
    z-index: 94;
}
.t-backdrop.open { display: block; }

/* 모바일 */
@media (max-width: 768px) {
    .t-sidebar { transform: translateX(-100%); transition: transform .2s; z-index: 95; box-shadow: 2px 0 12px rgba(0,0,0,.25); }
    .t-sidebar.open { transform: translateX(0); }
    .t-main { margin-left: 0; width: 100%; padding: 16px; }
    .t-header { padding: 0 12px; }
    .t-header .t-menu-btn { display: inline-flex; align-items: center; justify-content: center; }
    .t-header .t-right { gap: 6px; }
    .t-header .t-brand { font-size: 15px; }
}
/* 좁은 화면: 인사말 숨김 → 더 좁으면 브랜드도 숨김(페이지 제목이 위치 안내) */
@media (max-width: 640px) {
    .t-header .t-user { display: none; }
}
@media (max-width: 430px) {
    .t-header .t-brand { display: none; }
}
