/* =====================================================
 * AI 온라인 플랫폼 관리자 — 디자인 시스템
 * 라이트 SaaS 대시보드: 화이트/그레이 기반 + 딥네이비·블루·민트·바이올렛 포인트
 * ===================================================== */
/* Pretendard가 설치된 환경에서는 자동 적용되고, 없으면 시스템 한글 폰트로 대체됩니다.
 * (외부 CDN 의존 없음 — 기관 내부망에서도 동일하게 동작) */

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

:root {
  /* 색상 시스템 */
  --navy-900: #0b1836;
  --navy-800: #10214a;
  --navy-700: #16295c;
  --blue-600: #2563eb;
  --blue-500: #3b82f6;
  --blue-50: #eef4ff;
  --mint-600: #0d9488;
  --mint-50: #ecfdf7;
  --violet-600: #7c3aed;
  --violet-50: #f3efff;
  --orange-600: #ea8a0c;
  --orange-50: #fff5e6;
  --green-600: #16a34a;
  --green-50: #e9f9ef;
  --red-600: #dc2626;
  --red-50: #feecec;
  --amber-600: #d97706;
  --amber-50: #fef3c7;

  --bg: #f6f8fb;
  --card: #ffffff;
  --line: #e8edf4;
  --line-strong: #d9e1ec;
  --text: #1c2740;
  --text-2: #5a6b8c;
  --text-3: #8a97b1;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-md: 0 1px 2px rgba(15, 23, 42, .04), 0 12px 32px -16px rgba(15, 23, 42, .14);
  --shadow-lg: 0 24px 60px -12px rgba(11, 24, 54, .35);

  --r-lg: 16px;
  --r-md: 12px;
  --r-sm: 9px;

  --sidebar-w: 248px;
  --header-h: 62px;
}

html, body { height: 100%; }
body {
  font-family: 'Pretendard', 'Noto Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--text); }
a { color: var(--blue-600); text-decoration: none; }
svg.ic { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* 인쇄 차단 */
#print-guard { display: none; }
@media print {
  body > #app { display: none !important; }
  #print-guard { display: block; font-size: 24px; padding: 40px; }
}

/* ============ 폼 공통 ============ */
.input, .form-grid input, .form-grid select, .form-grid textarea {
  width: 100%; padding: 10px 13px; border: 1px solid var(--line-strong);
  border-radius: var(--r-sm); background: #fff; transition: border-color .12s, box-shadow .12s;
}
.input:focus, .form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus {
  outline: none; border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(59, 130, 246, .14);
}
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; align-items: end; }
.form-grid label, .field-label {
  display: block; font-size: 12px; font-weight: 700; color: var(--text-2); margin-bottom: 6px;
}
.msg { margin-top: 10px; font-size: 13px; min-height: 18px; }
.msg.err { color: var(--red-600); }
.msg.ok { color: var(--green-600); }

/* ============ 버튼 ============ */
.btn {
  display: inline-flex; align-items: center; gap: 7px; border-radius: 10px;
  padding: 10px 16px; font-weight: 700; font-size: 13.5px; border: 1px solid transparent;
  transition: transform .05s, box-shadow .12s, background .12s;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--blue-600), #3b76f0);
  color: #fff; box-shadow: 0 6px 16px -6px rgba(37, 99, 235, .55);
}
.btn-primary:hover { background: linear-gradient(135deg, #1d4fd7, #2f66e6); }
.btn-ghost { background: #fff; border-color: var(--line-strong); color: var(--text); }
.btn-ghost:hover { background: var(--bg); }
.btn-soft { background: var(--blue-50); color: var(--blue-600); }
.btn-soft:hover { background: #e0ebff; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; gap: 5px; }
.btn-sm svg.ic { width: 14px; height: 14px; }
.btn-danger { background: var(--red-50); color: var(--red-600); }
.btn-danger:hover { background: #fcdada; }

/* ============ 레이아웃 ============ */
.shell { display: flex; min-height: 100vh; }

/* --- 사이드바 --- */
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; position: sticky; top: 0; height: 100vh;
  background: linear-gradient(180deg, var(--navy-900) 0%, var(--navy-800) 55%, var(--navy-700) 100%);
  color: #b8c6e8; display: flex; flex-direction: column; z-index: 60;
}
.sidebar .brand {
  display: flex; align-items: center; gap: 11px; padding: 20px 20px 18px;
}
.sidebar .brand .mark {
  width: 36px; height: 36px; border-radius: 11px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--blue-500), var(--violet-600));
  display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 15px;
  box-shadow: 0 6px 14px -4px rgba(59, 130, 246, .6);
}
.sidebar .brand .bt { color: #fff; font-weight: 800; font-size: 14.5px; line-height: 1.3; }
.sidebar .brand .bs { font-size: 11px; color: #7f92c4; }
.sidebar nav { padding: 6px 12px; flex: 1; overflow-y: auto; }
.sidebar .nav-label {
  font-size: 10.5px; font-weight: 800; letter-spacing: .08em; color: #6478ad;
  padding: 16px 12px 7px;
}
.sidebar nav a {
  display: flex; align-items: center; gap: 11px; color: #b8c6e8; padding: 10px 12px;
  border-radius: 10px; margin-bottom: 2px; font-weight: 600; font-size: 13.5px;
}
.sidebar nav a svg.ic { width: 17px; height: 17px; opacity: .85; }
.sidebar nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sidebar nav a.active {
  background: linear-gradient(135deg, var(--blue-600), #3d6ef0);
  color: #fff; box-shadow: 0 8px 18px -8px rgba(37, 99, 235, .8);
}
.sidebar .side-foot {
  margin: 12px; padding: 13px 14px; border-radius: 12px;
  background: rgba(255, 255, 255, .05); font-size: 12px; line-height: 1.8;
}
.side-foot .ok { color: #5eead4; font-weight: 700; }
.side-foot .bad { color: #fca5a5; font-weight: 700; }
.side-foot .tz { color: #6478ad; font-size: 11px; }

/* --- 메인/헤더 --- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.header {
  height: var(--header-h); background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px; padding: 0 22px;
  position: sticky; top: 0; z-index: 50;
}
.header .page-title { font-size: 16.5px; font-weight: 800; color: var(--navy-800); white-space: nowrap; }
.hamburger { display: none; background: none; border: none; color: var(--text-2); padding: 6px; }

.search-box {
  flex: 1; max-width: 440px; display: flex; align-items: center; gap: 9px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 11px; padding: 8px 13px;
  color: var(--text-3); margin-left: auto;
}
.search-box:focus-within { border-color: var(--blue-500); background: #fff; box-shadow: 0 0 0 3px rgba(59, 130, 246, .12); }
.search-box input { border: none; background: none; outline: none; flex: 1; min-width: 0; }
.search-box svg.ic { width: 15px; height: 15px; }

.header .icon-btn {
  position: relative; background: none; border: none; color: var(--text-2);
  width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
}
.header .icon-btn:hover { background: var(--bg); color: var(--text); }
.icon-btn .dot {
  position: absolute; top: 5px; right: 5px; min-width: 15px; height: 15px; padding: 0 3px;
  background: var(--red-600); color: #fff; border-radius: 999px; font-size: 9.5px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; border: 2px solid #fff;
}
.profile-chip { display: flex; align-items: center; gap: 10px; padding-left: 8px; border-left: 1px solid var(--line); }
.profile-chip .who { text-align: right; line-height: 1.25; }
.profile-chip .nm { font-weight: 800; font-size: 13px; }
.profile-chip .rl { font-size: 11.5px; color: var(--text-3); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; color: #fff; font-weight: 800; font-size: 14px;
  background: linear-gradient(135deg, var(--blue-500), var(--violet-600));
  display: flex; align-items: center; justify-content: center;
}

/* 알림 드롭다운 */
.notif-panel {
  position: absolute; right: 90px; top: calc(var(--header-h) - 6px); width: 340px; z-index: 100;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-md);
  overflow: hidden;
}
.notif-panel .np-head { padding: 13px 16px; font-weight: 800; border-bottom: 1px solid var(--line); font-size: 13px; }
.notif-panel .np-item { display: flex; gap: 10px; padding: 11px 16px; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.notif-panel .np-item:last-child { border-bottom: none; }
.notif-panel .np-item .t { color: var(--text-3); font-size: 11px; margin-top: 2px; }

.content { padding: 24px; flex: 1; }

/* ============ 카드 ============ */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 22px; box-shadow: var(--shadow-sm);
}
.card > h2, .card-title {
  font-size: 14.5px; font-weight: 800; margin-bottom: 16px; color: var(--navy-800);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.card-title .sub, h2 .sub { font-weight: 500; color: var(--text-3); font-size: 12px; }
.card-title .spacer, h2 .spacer { flex: 1; }

.grid { display: grid; gap: 18px; }
.grid.stats { grid-template-columns: repeat(4, 1fr); margin-bottom: 18px; }
.grid.main-cols { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); align-items: start; }
.col-stack { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

/* 통계 카드 */
.stat { display: flex; gap: 14px; align-items: flex-start; }
.stat .tile {
  width: 46px; height: 46px; border-radius: 13px; display: flex; align-items: center; justify-content: center;
}
.stat .tile svg.ic { width: 21px; height: 21px; }
.tile.blue { background: var(--blue-50); color: var(--blue-600); }
.tile.mint { background: var(--mint-50); color: var(--mint-600); }
.tile.violet { background: var(--violet-50); color: var(--violet-600); }
.tile.orange { background: var(--orange-50); color: var(--orange-600); }
.tile.green { background: var(--green-50); color: var(--green-600); }
.tile.red { background: var(--red-50); color: var(--red-600); }
.stat .lb { color: var(--text-2); font-size: 12.5px; font-weight: 600; }
.stat .num { font-size: 25px; font-weight: 800; letter-spacing: -.02em; margin: 2px 0 4px; }
.stat .num .unit { font-size: 13px; font-weight: 600; color: var(--text-3); margin-left: 2px; }
.delta { font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; display: inline-flex; gap: 3px; }
.delta.up { color: var(--green-600); background: var(--green-50); }
.delta.flat { color: var(--text-3); background: var(--bg); }

/* ============ 배지 ============ */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3.5px 10px;
  border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap;
}
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.green { background: var(--green-50); color: var(--green-600); }
.badge.red { background: var(--red-50); color: var(--red-600); }
.badge.amber { background: var(--amber-50); color: var(--amber-600); }
.badge.blue { background: var(--blue-50); color: var(--blue-600); }
.badge.violet { background: var(--violet-50); color: var(--violet-600); }
.badge.gray { background: #eef1f6; color: var(--text-2); }
.badge.plain::before { display: none; }

/* ============ 토글 ============ */
.toggle { position: relative; width: 44px; height: 25px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle .tr { position: absolute; inset: 0; background: #cfd8e5; border-radius: 999px; transition: .16s; cursor: pointer; }
.toggle .tr::before {
  content: ''; position: absolute; width: 19px; height: 19px; border-radius: 50%; background: #fff;
  top: 3px; left: 3px; transition: .16s; box-shadow: 0 1px 3px rgba(15, 23, 42, .25);
}
.toggle input:checked + .tr { background: var(--blue-600); }
.toggle input:checked + .tr::before { transform: translateX(19px); }

/* 보안 설정 행 */
.sec-row { display: flex; align-items: center; gap: 13px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.sec-row:last-child { border-bottom: none; }
.sec-row .tile { width: 38px; height: 38px; border-radius: 11px; }
.sec-row .tile svg.ic { width: 17px; height: 17px; }
.sec-row .sx { flex: 1; min-width: 0; }
.sec-row .sl { font-weight: 700; font-size: 13.5px; }
.sec-row .sd { font-size: 12px; color: var(--text-2); margin-top: 2px; line-height: 1.5; }

/* ============ 테이블 ============ */
.tbl-scroll { overflow-x: auto; margin: 0 -22px; padding: 0 22px; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left; font-size: 11.5px; color: var(--text-3); font-weight: 800; letter-spacing: .03em;
  padding: 10px 12px; border-bottom: 1px solid var(--line);
}
.tbl td { padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 13.5px; }
.tbl tbody tr { transition: background .1s; }
.tbl tbody tr:hover { background: #fafbfe; }
.tbl tr:last-child td { border-bottom: none; }
.tbl .cell-main { font-weight: 700; }
.tbl .cell-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; font-weight: 500; }
.row-actions { display: flex; gap: 5px; flex-wrap: wrap; }

/* 역할 플로우 */
.roles-flow { display: flex; gap: 0; align-items: stretch; }
.role-box {
  flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 14px; padding: 16px 14px;
  background: linear-gradient(180deg, #fff, #fbfcfe);
}
.role-box .rc {
  width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  color: #fff; margin-bottom: 10px;
}
.role-box .rc svg.ic { width: 19px; height: 19px; }
.role-box .rn { font-weight: 800; font-size: 13.5px; }
.role-box .rr { font-size: 11px; color: var(--text-3); font-weight: 600; margin: 1px 0 8px; }
.role-box .rd { font-size: 12px; color: var(--text-2); line-height: 1.75; }
.role-arrow { display: flex; align-items: center; color: var(--line-strong); padding: 0 7px; }
.role-arrow svg.ic { width: 16px; height: 16px; stroke-width: 2.4; }

/* ============ 주간 시간표 매트릭스 ============ */
.matrix-wrap { overflow-x: auto; }
table.matrix { width: 100%; border-collapse: separate; border-spacing: 5px; min-width: 520px; }
.matrix th {
  font-size: 11.5px; color: var(--text-3); font-weight: 800; padding: 4px 6px; text-align: center;
}
.matrix th.day-col { width: 42px; }
.matrix td { padding: 0; }
.matrix .day-cell {
  background: var(--bg); border-radius: 9px; text-align: center; font-weight: 800; font-size: 12.5px;
  color: var(--text-2); padding: 13px 6px;
}
.matrix .slot {
  border-radius: 9px; padding: 9px 10px; font-size: 12px; font-weight: 700; text-align: center; line-height: 1.4;
  min-height: 42px; display: flex; flex-direction: column; justify-content: center; gap: 1px;
}
.slot.allow { background: var(--green-50); color: #15803d; border: 1px solid #c8eed5; }
.slot.allow .who { font-size: 10.5px; font-weight: 600; color: #4d9e6a; }
.slot.deck-allow { background: var(--blue-50); color: var(--blue-600); border: 1px solid #d4e2fd; }
.slot.deck-allow .who { font-size: 10.5px; font-weight: 600; color: #7396dd; }
.slot.blocked { background: var(--red-50); color: #c04747; border: 1px solid #f6d5d5; opacity: .8; }
.slot.locked {
  color: var(--text-3); border: 1px solid var(--line);
  background: repeating-linear-gradient(45deg, #f3f5f9, #f3f5f9 6px, #eaeef5 6px, #eaeef5 12px);
}

/* 시간창 관리 리스트 */
.win-list { display: flex; flex-direction: column; gap: 8px; }
.win-row {
  display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 11px;
  padding: 10px 14px; background: #fff;
}
.win-row .wd {
  width: 34px; height: 34px; border-radius: 9px; background: var(--navy-800); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px;
}
.win-row .wt { font-weight: 700; }
.win-row .wtar { font-size: 12px; color: var(--text-2); }
.win-row .spacer { flex: 1; }
.win-row.off { opacity: .55; }

/* ============ 덱 카드 (학생/미리보기) ============ */
.deck-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.deck-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
  box-shadow: var(--shadow-sm); transition: box-shadow .15s, transform .15s;
}
.deck-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.deck-thumb {
  height: 132px; position: relative; overflow: hidden; padding: 16px;
  display: flex; flex-direction: column; justify-content: flex-end; color: #fff;
}
.deck-thumb .dt { font-weight: 800; font-size: 17px; text-shadow: 0 2px 8px rgba(0, 0, 0, .25); position: relative; }
.deck-thumb .deco {
  position: absolute; right: -18px; top: -20px; font-size: 74px; opacity: .28; transform: rotate(-8deg);
}
.deck-thumb .orb {
  position: absolute; width: 130px; height: 130px; border-radius: 50%; left: -40px; bottom: -70px;
  background: radial-gradient(circle, rgba(255,255,255,.28), transparent 70%);
}
.dg-0 { background: linear-gradient(135deg, #16295c, #2563eb); }
.dg-1 { background: linear-gradient(135deg, #134e4a, #0d9488); }
.dg-2 { background: linear-gradient(135deg, #4c1d95, #7c3aed); }
.dg-3 { background: linear-gradient(135deg, #7c2d12, #ea8a0c); }
.deck-card .body { padding: 15px 16px 16px; }
.deck-card .desc { color: var(--text-2); font-size: 12.5px; min-height: 36px; margin-bottom: 12px; line-height: 1.55; }
.deck-card .meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

/* 미리보기 카드 (대시보드 우측) */
.preview-kv { display: grid; grid-template-columns: 76px 1fr; row-gap: 9px; font-size: 13px; margin: 14px 0; }
.preview-kv .k { color: var(--text-3); font-weight: 600; }
.preview-kv .v { font-weight: 700; }

/* ============ 로그 ============ */
.log-list { display: flex; flex-direction: column; }
.log-item { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.log-item:last-child { border-bottom: none; }
.log-item .li-main { flex: 1; min-width: 0; }
.log-item .li-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.log-item .li-who { font-weight: 700; font-size: 13px; }
.log-item .li-det { font-size: 12px; color: var(--text-2); margin-top: 2px; word-break: break-all; }
.log-item .li-meta { font-size: 11.5px; color: var(--text-3); text-align: right; white-space: nowrap; line-height: 1.6; }

/* ============ 리포트 차트 ============ */
.chart-bars { display: flex; gap: 10px; align-items: flex-end; height: 170px; padding-top: 10px; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.chart-col .bars { display: flex; gap: 3px; align-items: flex-end; height: 100%; }
.chart-col .bar { width: 13px; border-radius: 5px 5px 2px 2px; min-height: 3px; }
.bar.b-login { background: linear-gradient(180deg, var(--blue-500), var(--blue-600)); }
.bar.b-block { background: linear-gradient(180deg, #f87171, var(--red-600)); }
.bar.b-capture { background: linear-gradient(180deg, #fbbf24, var(--amber-600)); }
.chart-col .cl { font-size: 11px; color: var(--text-3); font-weight: 700; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-2); margin-top: 12px; }
.legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

.rank-list { display: flex; flex-direction: column; gap: 9px; }
.rank-row { display: flex; align-items: center; gap: 10px; }
.rank-row .rk {
  width: 24px; height: 24px; border-radius: 7px; background: var(--bg); color: var(--text-2);
  font-size: 11.5px; font-weight: 800; display: flex; align-items: center; justify-content: center;
}
.rank-row .rn2 { flex: 1; font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-row .rbar { height: 7px; border-radius: 99px; background: linear-gradient(90deg, var(--blue-500), var(--violet-600)); }
.rank-row .rv { font-size: 12px; color: var(--text-2); font-weight: 700; width: 42px; text-align: right; }

/* ============ 로그인 ============ */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: linear-gradient(140deg, #0b1836 0%, #16295c 45%, #2454c7 100%);
  position: relative; overflow: hidden;
}
.login-wrap::before, .login-wrap::after {
  content: ''; position: absolute; border-radius: 50%; filter: blur(10px);
}
.login-wrap::before { width: 480px; height: 480px; right: -140px; top: -160px; background: radial-gradient(circle, rgba(124, 58, 237, .35), transparent 65%); }
.login-wrap::after { width: 420px; height: 420px; left: -120px; bottom: -160px; background: radial-gradient(circle, rgba(13, 148, 136, .3), transparent 65%); }
.login-card {
  background: #fff; border-radius: 22px; padding: 42px 40px; width: 400px; max-width: 100%;
  box-shadow: var(--shadow-lg); position: relative; z-index: 2;
}
.login-card .lmark {
  width: 46px; height: 46px; border-radius: 14px; margin-bottom: 18px;
  background: linear-gradient(135deg, var(--blue-500), var(--violet-600));
  display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 19px;
  box-shadow: 0 10px 22px -8px rgba(59, 130, 246, .7);
}
.login-card .logo { font-size: 21px; font-weight: 800; color: var(--navy-800); letter-spacing: -.02em; }
.login-card .sub { color: var(--text-2); margin: 5px 0 26px; font-size: 13px; }
.login-card label { display: block; font-weight: 700; margin: 15px 0 6px; font-size: 12.5px; color: var(--text-2); }
.login-card .btn-primary { width: 100%; margin-top: 24px; justify-content: center; padding: 12px; font-size: 14px; }
.login-error { color: var(--red-600); margin-top: 12px; font-size: 13px; min-height: 18px; }
.otp-secret {
  background: var(--bg); border: 1px dashed var(--line-strong); border-radius: 10px; padding: 12px;
  font-family: ui-monospace, monospace; font-size: 13px; word-break: break-all; margin: 8px 0;
}

/* ============ 차단 화면 ============ */
.blocked-wrap { max-width: 680px; margin: 40px auto; text-align: center; }
.blocked-hero {
  width: 84px; height: 84px; border-radius: 26px; margin: 0 auto 18px;
  background: var(--red-50); color: var(--red-600);
  display: flex; align-items: center; justify-content: center;
}
.blocked-hero svg.ic { width: 38px; height: 38px; }
.blocked-wrap h2 { font-size: 21px; margin-bottom: 8px; letter-spacing: -.02em; }
.blocked-wrap > p { color: var(--text-2); margin-bottom: 24px; }

/* ============ 편집기 ============ */
.editor { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 18px; align-items: start; }
.slide-list { display: flex; flex-direction: column; gap: 8px; }
.slide-item {
  border: 1px solid var(--line); border-radius: 11px; padding: 11px 13px; background: #fff;
  cursor: pointer; display: flex; align-items: center; gap: 9px; transition: border-color .1s;
}
.slide-item:hover { border-color: var(--line-strong); }
.slide-item.active { border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(59, 130, 246, .13); }
.slide-item .n {
  color: var(--text-3); font-size: 11px; font-weight: 800; width: 22px; height: 22px; flex-shrink: 0;
  background: var(--bg); border-radius: 6px; display: flex; align-items: center; justify-content: center;
}
.slide-item .t { flex: 1; font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor textarea {
  width: 100%; min-height: 210px; padding: 13px; border: 1px solid var(--line-strong);
  border-radius: 11px; resize: vertical; line-height: 1.65; font-size: 13.5px;
}
.editor textarea:focus { outline: none; border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(59, 130, 246, .13); }

/* ============ 슬라이드 렌더링 ============ */
.slide-frame {
  aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; position: relative;
  display: flex; flex-direction: column; justify-content: center; padding: 6.5% 7%;
  border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  letter-spacing: -0.015em;
}
.slide-frame.align-center { text-align: center; align-items: center; }

.slide-frame h1 {
  font-size: 2.35em; font-weight: 800; margin-bottom: .45em; line-height: 1.18; letter-spacing: -.03em;
}
.slide-frame h1::after {
  content: ''; display: block; width: 1.5em; height: .13em; border-radius: 99px;
  background: var(--sl-accent); margin-top: .32em;
}
.slide-frame.align-center h1::after { margin-left: auto; margin-right: auto; }
.slide-frame h2 {
  font-size: 1.32em; font-weight: 800; margin: .7em 0 .35em; color: var(--sl-accent);
  letter-spacing: -.01em;
}
.slide-frame p { font-size: 1.06em; line-height: 1.75; margin: .3em 0; opacity: .94; }
.slide-frame ul, .slide-frame ol { margin: .45em 0 .45em 1.35em; }
.slide-frame li { font-size: 1.06em; line-height: 1.9; opacity: .94; }
.slide-frame li::marker { color: var(--sl-accent); font-weight: 800; }
.slide-frame strong { color: var(--sl-strong, inherit); }
.slide-frame img {
  max-width: 72%; max-height: 42%; border-radius: 12px; margin: .5em 0;
  box-shadow: 0 14px 34px -14px rgba(0, 0, 0, .45);
}
.slide-frame code {
  background: rgba(127, 127, 127, .18); padding: 1px 8px; border-radius: 6px;
  font-family: ui-monospace, monospace; font-size: .92em;
}
/* 은은한 코너 광원 장식 */
.slide-frame::before {
  content: ''; position: absolute; width: 42%; aspect-ratio: 1; border-radius: 50%;
  right: -14%; top: -22%; background: radial-gradient(circle, var(--sl-glow), transparent 68%);
  pointer-events: none;
}

/* 테마: 배경 레이어드 그라데이션 + 포인트 컬러 */
.theme-navy {
  color: #f2f6ff; --sl-accent: #56ccf2; --sl-strong: #9bdcff; --sl-glow: rgba(86, 204, 242, .22);
  background:
    radial-gradient(120% 90% at -10% 115%, rgba(124, 58, 237, .30), transparent 55%),
    linear-gradient(150deg, #0a1230 0%, #14295e 55%, #1c3d80 100%);
}
.theme-white {
  color: #17223f; --sl-accent: #2563eb; --sl-strong: #1d4ed8; --sl-glow: rgba(37, 99, 235, .10);
  background:
    radial-gradient(110% 85% at -8% 112%, rgba(13, 148, 136, .07), transparent 55%),
    linear-gradient(160deg, #ffffff 0%, #f2f6fd 100%);
}
.theme-mint {
  color: #0b3a34; --sl-accent: #0d9488; --sl-strong: #0f766e; --sl-glow: rgba(13, 148, 136, .16);
  background:
    radial-gradient(110% 85% at -8% 112%, rgba(59, 130, 246, .08), transparent 55%),
    linear-gradient(150deg, #f2fdf9 0%, #d3f6ea 60%, #b9efe0 100%);
}
.theme-sunset {
  color: #fff5ec; --sl-accent: #ffb45e; --sl-strong: #ffd29b; --sl-glow: rgba(255, 180, 94, .25);
  background:
    radial-gradient(120% 90% at -10% 115%, rgba(124, 45, 90, .55), transparent 60%),
    linear-gradient(150deg, #38102e 0%, #7c2d3e 55%, #bf4f3a 100%);
}
.theme-violet {
  color: #f6f2ff; --sl-accent: #c4b5fd; --sl-strong: #ddd2ff; --sl-glow: rgba(196, 181, 253, .24);
  background:
    radial-gradient(120% 90% at -10% 115%, rgba(37, 99, 235, .30), transparent 58%),
    linear-gradient(150deg, #201040 0%, #46209a 55%, #6a2fd0 100%);
}
.theme-dark {
  color: #f4f5f7; --sl-accent: #fbbf24; --sl-strong: #fde08a; --sl-glow: rgba(251, 191, 36, .13);
  background:
    radial-gradient(110% 85% at -8% 112%, rgba(59, 130, 246, .10), transparent 55%),
    linear-gradient(160deg, #0b0e15 0%, #1a2233 100%);
}

/* 이미지 전용 슬라이드 (PPT 변환): 여백 없이 원본 그대로 */
.slide-frame.img-slide { padding: 0; background: #0b0e15; }
.slide-frame.img-slide::before { display: none; }
.slide-frame.img-slide img.full {
  width: 100%; height: 100%; max-width: none; max-height: none;
  object-fit: contain; margin: 0; border-radius: 0; box-shadow: none;
}

/* 동영상 전용 슬라이드 — 검은 배경에 꽉 차게 재생 (슬라이드 사이 삽입 영상) */
.slide-frame.video-slide { padding: 0; background: #000; display: flex; align-items: center; justify-content: center; }
.slide-frame.video-slide::before { display: none; }
.slide-frame.video-slide .video-box {
  width: 100%; height: 100%; margin: 0; max-width: none; border-radius: 0; box-shadow: none;
}
.slide-frame.video-slide .video-box iframe, .slide-frame.video-slide .video-box video {
  width: 100%; height: 100%; object-fit: contain;
}

/* ============ 프레젠테이션 ============ */
.present-overlay { position: fixed; inset: 0; z-index: 100; background: #000; display: flex; flex-direction: column; }
.present-overlay .stage { flex: 1; position: relative; overflow: hidden; }
.present-overlay .slide-frame {
  position: absolute; inset: 0; border-radius: 0; border: none; aspect-ratio: auto;
  font-size: clamp(14px, 2.2vw, 30px); box-shadow: none;
}
.present-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: #0b0f1d; color: #7d8db0; padding: 10px 18px; font-size: 12.5px;
}
.present-bar button { background: #1c2740; color: #dbe4f5; border: none; border-radius: 8px; padding: 7px 14px; font-weight: 700; }
.present-bar button:hover { background: #2a3a5e; }
.progress { height: 4px; background: #1c2740; }
.progress .fill { height: 100%; background: linear-gradient(90deg, var(--blue-500), var(--violet-600)); transition: width .2s; }

/* 워터마크 / 블랙아웃 / 보호 */
.watermark { position: absolute; inset: 0; pointer-events: none; z-index: 50; background-repeat: repeat; }
.blackout {
  position: fixed; inset: 0; z-index: 999; background: #000; color: #5a6b8c;
  display: flex; align-items: center; justify-content: center; font-size: 17px; text-align: center; line-height: 1.8;
}
.no-select, .no-select * {
  user-select: none !important; -webkit-user-select: none !important; -webkit-touch-callout: none !important;
}

/* ============ 모달 / 토스트 ============ */
.modal-back {
  position: fixed; inset: 0; z-index: 200; background: rgba(11, 24, 54, .45);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  backdrop-filter: blur(2px);
}
.modal {
  background: #fff; border-radius: 18px; width: 480px; max-width: 100%; max-height: 90vh; overflow-y: auto;
  padding: 26px; box-shadow: var(--shadow-lg);
}
.modal h3 { font-size: 16px; font-weight: 800; margin-bottom: 4px; }
.modal .m-sub { color: var(--text-2); font-size: 12.5px; margin-bottom: 18px; }
.modal .m-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }

#toast-zone { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 500; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--navy-800); color: #fff; padding: 11px 18px; border-radius: 11px; font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow-md); animation: toast-in .18s ease-out;
}
.toast.warn { background: var(--red-600); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ============ 기타 ============ */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; flex-wrap: wrap; gap: 12px; }
.page-head .ph-t { font-size: 17px; font-weight: 800; letter-spacing: -.02em; }
.page-head .desc { color: var(--text-2); font-size: 13px; margin-top: 4px; }
.tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs button {
  border: 1px solid var(--line-strong); background: #fff; padding: 7px 15px; border-radius: 999px;
  font-weight: 700; color: var(--text-2); font-size: 12.5px;
}
.tabs button.active { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }
.mt { margin-top: 16px; }
.muted { color: var(--text-2); }
.small { font-size: 12px; }
.empty-note { color: var(--text-3); font-size: 13px; padding: 18px 0; text-align: center; }
.side-overlay { display: none; }

/* 자료 간략 목록 — 제목 위주, 시선 피로 최소화 */
.deck-list { display: flex; flex-direction: column; }
.deck-line {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 6px; border-bottom: 1px solid var(--line);
}
.deck-line:last-child { border-bottom: none; }
.dl-left { display: flex; align-items: center; gap: 11px; min-width: 0; flex: 1; }
.dl-ico { font-size: 17px; flex: none; width: 22px; text-align: center; }
.dl-body { min-width: 0; }
.dl-title {
  font-weight: 700; font-size: 15px; color: var(--text-1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dl-meta { margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-actions { display: flex; gap: 6px; flex: none; }
.amber-text { color: var(--amber-600, #b45309); font-weight: 600; }

/* 상세 시트 (간략 목록의 "관리 ⋯") */
.sheet-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 18px; margin: 12px 0 4px; }
.sheet-detail > div { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.sd-k { color: var(--text-2); flex: none; }
.sd-v { color: var(--text-1); font-weight: 600; text-align: right; word-break: break-all; }
@media (max-width: 620px) {
  .sheet-detail { grid-template-columns: 1fr; }
  .dl-actions .btn { padding-left: 9px; padding-right: 9px; }
}

/* 계약·보안 동의서 본문 (스크롤 박스) */
.agreement-doc {
  max-height: 42vh; overflow-y: auto; padding: 18px 20px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface-2, rgba(127,127,127,.05));
  font-size: 13.5px; line-height: 1.85; color: var(--text-1);
  white-space: normal; word-break: keep-all;
}

/* ============ 반응형 ============ */
@media (max-width: 1180px) {
  .grid.stats { grid-template-columns: repeat(2, 1fr); }
  .grid.main-cols { grid-template-columns: 1fr; }
}
@media (max-width: 920px) {
  .sidebar {
    position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s ease;
    box-shadow: var(--shadow-lg);
  }
  .shell.side-open .sidebar { transform: none; }
  .shell.side-open .side-overlay {
    display: block; position: fixed; inset: 0; background: rgba(11, 24, 54, .4); z-index: 55;
  }
  .hamburger { display: flex; }
  .header .page-title { font-size: 15px; }
  .profile-chip .who { display: none; }
  .content { padding: 16px; }
  .editor { grid-template-columns: 1fr; }
  .roles-flow { flex-direction: column; gap: 10px; }
  .role-arrow { transform: rotate(90deg); justify-content: center; padding: 0; }
  .notif-panel { right: 12px; left: 12px; width: auto; }
  .search-box { max-width: none; }
}
@media (max-width: 700px) {
  .grid.stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat .num { font-size: 21px; }
  .header .page-title { display: none; }
  /* 테이블 → 카드형 리스트 */
  .tbl.resp thead { display: none; }
  .tbl.resp, .tbl.resp tbody, .tbl.resp tr, .tbl.resp td { display: block; width: 100%; }
  .tbl.resp tr { border: 1px solid var(--line); border-radius: 13px; margin-bottom: 12px; padding: 8px 4px; background: #fff; }
  .tbl.resp td { border: none; padding: 7px 12px; }
  .tbl.resp td[data-label]::before {
    content: attr(data-label); display: block; font-size: 10.5px; font-weight: 800; color: var(--text-3);
    letter-spacing: .04em; margin-bottom: 3px;
  }
}

/* ============ 외부 웹앱 임베드 ============ */
.embed-wrap {
  position: relative; height: calc(100vh - 200px); min-height: 420px;
  border-radius: 14px; overflow: hidden; border: 1px solid var(--line);
  background: #fff; box-shadow: var(--shadow-sm);
}
.embed-wrap iframe { width: 100%; height: 100%; border: 0; display: block; }
.embed-wrap:fullscreen { border-radius: 0; border: none; }
.snippet-box {
  background: var(--navy-900); color: #c8d6f5; border-radius: 10px; padding: 13px 14px;
  font-family: ui-monospace, SFMono-Regular, monospace; font-size: 11px; line-height: 1.65;
  overflow-x: auto; white-space: pre; margin-top: 8px;
}

/* ============ 슬라이드 동영상 ============ */
.slide-frame .video-box {
  width: min(82%, 760px); aspect-ratio: 16 / 9; margin: .5em 0;
  border-radius: 10px; overflow: hidden; background: #000; flex-shrink: 0;
}
.slide-frame.align-center .video-box { margin-left: auto; margin-right: auto; }
.slide-frame .video-box iframe, .slide-frame .video-box video {
  width: 100%; height: 100%; border: 0; display: block;
}

/* ============ 업로드 배경 슬라이드 ============ */
.slide-frame.custom-bg { background-size: cover; background-position: center; }
.slide-frame.custom-bg::before { display: none; }
.slide-frame.tone-light {
  color: #fff; --sl-accent: #ffd166; --sl-strong: #ffe9b3; --sl-glow: transparent;
  text-shadow: 0 1px 16px rgba(0, 0, 0, .55);
}
.slide-frame.tone-dark {
  color: #17223f; --sl-accent: #2563eb; --sl-strong: #1d4ed8; --sl-glow: transparent;
  text-shadow: 0 1px 12px rgba(255, 255, 255, .6);
}

/* ============ 내보내기 (관리자: PDF 저장/백업) ============ */
.export-pages { display: flex; flex-direction: column; gap: 18px; max-width: 1000px; }
@media print {
  /* 내보내기 화면에서만 인쇄 허용 (기본은 인쇄 차단 유지) */
  body.allow-print > #app { display: block !important; }
  body.allow-print #print-guard { display: none !important; }
  body.allow-print .sidebar, body.allow-print .header,
  body.allow-print .export-toolbar, body.allow-print .side-overlay { display: none !important; }
  body.allow-print .content { padding: 0 !important; }
  body.allow-print .export-pages { gap: 0; max-width: none; }
  body.allow-print .print-page { page-break-after: always; break-inside: avoid; }
  body.allow-print .print-page .slide-frame {
    border-radius: 0; border: none; box-shadow: none; width: 100%;
  }
}

/* ============ 수업 자료 선택 / 관리 ============ */
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.pick-item {
  display: flex; align-items: center; gap: 9px; border: 1px solid var(--line-strong);
  border-radius: 10px; padding: 9px 12px; cursor: pointer; font-size: 13px; font-weight: 600;
  background: #fff; transition: border-color .1s, background .1s;
}
.pick-item:hover { border-color: var(--blue-500); }
.pick-item:has(input:checked) { border-color: var(--blue-500); background: var(--blue-50); }
.pick-item input { width: 16px; height: 16px; accent-color: var(--blue-600); }
.pick-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.item-list { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 4px; }
.item-row {
  display: flex; align-items: center; gap: 10px; border: 1px solid var(--line);
  border-radius: 11px; padding: 10px 12px; background: #fff;
}
.item-row .ir-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; }
.item-row .ir-ic { font-size: 17px; }
.item-row .ir-title { font-weight: 700; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ir-toggle { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-2); white-space: nowrap; cursor: pointer; }
.ir-toggle input { width: 15px; height: 15px; accent-color: var(--blue-600); }
.item-row .btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ============ 수업 일정 캘린더 ============ */
.cal-wrap { overflow-x: auto; }
.cal-grid { display: grid; grid-template-columns: 52px repeat(7, minmax(84px, 1fr)); min-width: 640px; }
.cal-corner, .cal-head {
  position: sticky; top: 0; background: #fff; z-index: 2;
  text-align: center; font-size: 12px; font-weight: 800; color: var(--text-2);
  padding: 7px 0; border-bottom: 1px solid var(--line);
}
.cal-times { display: flex; flex-direction: column; }
.cal-time { font-size: 10.5px; color: var(--text-3); text-align: right; padding-right: 6px; border-top: 1px solid var(--line); box-sizing: border-box; }
.cal-daywrap { position: relative; border-left: 1px solid var(--line); }
.cal-line { border-top: 1px solid var(--line); box-sizing: border-box; }
.cal-day { position: absolute; inset: 0; }
.cal-ev {
  position: absolute; left: 3px; right: 3px; border-radius: 7px; padding: 4px 7px; overflow: hidden;
  box-shadow: var(--shadow-sm); cursor: default;
}
.cal-ev .ce-t { font-size: 11.5px; font-weight: 800; color: var(--text); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev .ce-m { font-size: 10px; color: var(--text-2); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* =====================================================
 * 테마 2: 밝고 따뜻한 상단 메뉴형
 * 어두운 사이드바 대시보드 → 따뜻한 종이색 배경 + 티일 포인트
 * ===================================================== */
:root {
  --bg: #faf7f1;
  --card: #ffffff;
  --line: #ede7da;
  --line-strong: #ddd4c2;
  --text: #33312b;
  --text-2: #6f695b;
  --text-3: #a39c8b;
  /* 기존 파랑 참조(버튼·배지·포커스)를 티일 계열로 재매핑 */
  --blue-600: #0f766e;
  --blue-500: #14a396;
  --blue-50: #e6f4f1;
  --navy-900: #0f2e2b;
  --shadow-md: 0 1px 2px rgba(63, 51, 24, .05), 0 14px 34px -18px rgba(63, 51, 24, .18);
}
body { background: var(--bg); }
.input:focus, .form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus {
  border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(20, 163, 150, .16);
}
.btn-primary {
  background: linear-gradient(135deg, #0f766e, #14a396);
  box-shadow: 0 6px 16px -6px rgba(15, 118, 110, .5);
}
.btn-primary:hover { background: linear-gradient(135deg, #0c5f59, #109384); }
.btn-soft:hover { background: #d5ece7; }
.card { border: 1px solid var(--line); border-radius: 18px; }

/* --- 상단 메뉴바 레이아웃 --- */
.site { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 14px;
  height: 64px; padding: 0 clamp(16px, 4vw, 44px);
  background: rgba(255, 253, 247, .92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.tb-brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.tb-mark {
  width: 38px; height: 38px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(135deg, #0f766e, #14a396); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 12.5px; letter-spacing: -.5px;
  box-shadow: 0 4px 12px -4px rgba(15, 118, 110, .5);
}
.tb-name { font-weight: 900; font-size: 16.5px; color: var(--text); letter-spacing: -.3px; white-space: nowrap; }
.tb-nav { display: flex; gap: 3px; margin-left: 8px; }
.tb-nav a {
  display: flex; align-items: center; gap: 7px; padding: 8px 14px;
  border-radius: 999px; font-weight: 700; font-size: 13.5px; color: var(--text-2); white-space: nowrap;
}
.tb-nav a svg.ic { width: 15px; height: 15px; }
.tb-nav a:hover { background: #f2ecdf; color: var(--text); }
.tb-nav a.active { background: var(--blue-50); color: #115e59; }
.tb-spacer { flex: 1; }
.topbar .search-box {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  background: #fff; border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 8px 15px; width: clamp(150px, 22vw, 260px); color: var(--text-3);
}
.topbar .search-box input { border: none; outline: none; width: 100%; background: transparent; font-size: 13.5px; }
.topbar .search-box svg.ic { width: 15px; height: 15px; }
.tb-user { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.tb-avatar {
  width: 36px; height: 36px; border-radius: 999px; flex-shrink: 0;
  background: #f3e8cf; color: #8a6d1d; font-weight: 800; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.tb-who { font-size: 12px; font-weight: 700; color: var(--text); line-height: 1.35; white-space: nowrap; }
.tb-who b { color: var(--text-3); font-weight: 700; font-size: 11px; }
.topbar .icon-btn {
  border: 1px solid var(--line-strong); background: #fff; border-radius: 999px;
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; color: var(--text-2);
}
.topbar .icon-btn:hover { background: var(--bg); color: var(--text); }
.tb-burger { display: none; border: none; background: none; color: var(--text); }
.page { flex: 1; }
.page-inner { width: 100%; max-width: 1160px; margin: 0 auto; padding: 30px clamp(16px, 4vw, 44px) 56px; }
.site-foot {
  text-align: center; font-size: 12.5px; color: var(--text-3);
  padding: 18px 0 26px; border-top: 1px solid var(--line); background: rgba(255, 253, 247, .6);
}

@media (max-width: 920px) {
  .tb-name, .tb-who, .topbar .search-box { display: none; }
  .tb-burger { display: flex; }
  .tb-nav {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; gap: 2px; padding: 10px 14px 14px;
    background: #fffdf7; border-bottom: 1px solid var(--line); box-shadow: var(--shadow-md);
  }
  .topbar.nav-open .tb-nav { display: flex; }
  .tb-nav a { border-radius: 12px; }
}

/* --- 카탈로그 카드: 따뜻한 파스텔 그라데이션 --- */
.deck-card { border-radius: 20px; border: 1px solid var(--line); }
.deck-thumb.dg-0 { background: linear-gradient(135deg, #f2705f, #f5a05c); }
.deck-thumb.dg-1 { background: linear-gradient(135deg, #0e8074, #2fbfa4); }
.deck-thumb.dg-2 { background: linear-gradient(135deg, #6567d8, #9a7bea); }
.deck-thumb.dg-3 { background: linear-gradient(135deg, #d97706, #efb52b); }

/* --- 로그인: 따뜻한 배경 --- */
.login-wrap {
  background:
    radial-gradient(900px 500px at 12% -10%, rgba(20, 163, 150, .14), transparent 60%),
    radial-gradient(800px 500px at 95% 8%, rgba(245, 158, 11, .13), transparent 55%),
    #faf7f1;
}
.login-card { border-radius: 24px; border: 1px solid var(--line); box-shadow: 0 30px 70px -30px rgba(63, 51, 24, .35); }
.login-card .lmark {
  background: linear-gradient(135deg, #0f766e, #14a396);
  box-shadow: 0 10px 24px -8px rgba(15, 118, 110, .55);
}

/* ============ 보기 전용 파일 뷰어 (워터마크) ============ */
.file-viewer {
  position: fixed; inset: 0; z-index: 90; background: rgba(20, 18, 12, .95);
  display: flex; flex-direction: column;
}
.file-viewer .fv-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px clamp(14px, 3vw, 28px); color: #f5f0e5;
}
.file-viewer .fv-name { font-weight: 800; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.file-viewer .fv-close {
  border: none; cursor: pointer; background: rgba(255,255,255,.14); color: #fff;
  border-radius: 999px; padding: 8px 16px; font-weight: 800; font-size: 13px;
}
.file-viewer .fv-close:hover { background: rgba(255,255,255,.24); }
.file-viewer .fv-body { position: relative; flex: 1; margin: 0 clamp(10px, 3vw, 28px) 20px; }
.file-viewer .fv-body iframe, .file-viewer .fv-body img {
  width: 100%; height: 100%; object-fit: contain; border: none; border-radius: 12px; background: #fff;
  user-select: none; -webkit-user-drag: none;
}
.file-viewer .fv-wm {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
  display: grid; grid-template-columns: repeat(3, 1fr); align-content: space-around;
  transform: rotate(-18deg) scale(1.25);
}
.file-viewer .fv-wm span {
  text-align: center; font-size: 13px; font-weight: 700; white-space: nowrap;
  color: rgba(90, 80, 60, .18); padding: 26px 0;
}

/* ============ 학생 활동 보드 ============ */
.sboard {
  min-height: 100vh; background: var(--bg);
  padding: 20px clamp(14px, 4vw, 44px) 60px; max-width: 1160px; margin: 0 auto;
}
.sb-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.sb-title { font-size: clamp(20px, 3.4vw, 27px); font-weight: 900; letter-spacing: -.4px; }
.sb-sub { font-size: 13px; color: var(--text-3); font-weight: 600; margin-top: 3px; }
.sb-form { margin-bottom: 20px; }
.sb-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr));
  gap: 14px; align-items: start;
}
.post-card {
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 13px 15px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 9px;
}
.post-card.is-hidden { opacity: .55; border-style: dashed; }
.post-card .pc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.post-card .pc-name { font-weight: 800; font-size: 13.5px; }
.post-card .pc-time { font-size: 11px; color: var(--text-3); white-space: nowrap; }
.post-card .pc-img { width: 100%; border-radius: 10px; max-height: 300px; object-fit: cover; }
.post-card .pc-body { font-size: 13.5px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.post-card .pc-file {
  font-size: 12.5px; font-weight: 700; color: var(--text-2);
  background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 8px 11px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.post-card .pc-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 2px; }

/* 참여 코드 표시 (칠판 투영용) */
.sb-code-card {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  flex-wrap: wrap; margin-bottom: 20px;
}
.sb-code {
  font-size: clamp(38px, 7vw, 58px); font-weight: 900; letter-spacing: 14px;
  color: var(--blue-600); font-variant-numeric: tabular-nums; margin-top: 4px;
}
