/* 웹판에만 있는 것: 끌어다 놓기 칸, 배정 안내, 로그아웃, 좁은 화면 대응. 나머지 디자인·모션은 데스크톱 app.css 그대로 */

.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 160px; padding: 24px; text-align: center; cursor: pointer;
  border: 1.5px dashed var(--color-hairline-strong); border-radius: var(--radius-lg);
  background: var(--color-canvas-soft); color: var(--color-ink-secondary);
  transition: border-color var(--dur-quick) var(--ease), background-color var(--dur-quick) var(--ease), transform var(--dur-std) var(--ease);
}
.dropzone svg { color: var(--color-text-primary); transition: transform var(--dur-std) var(--ease); }
.dropzone:hover, .dropzone:focus-visible { border-color: var(--color-primary); background: var(--color-tint); }
.dropzone:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.dropzone.over { border-color: var(--color-primary); background: var(--color-tint); transform: scale(1.01); }
.dropzone.over svg { transform: translateY(-3px); }
.dropzone.busy { pointer-events: none; opacity: 0.7; }
.dropzone.busy svg { animation: drop-pulse 900ms var(--ease) infinite alternate; }
@keyframes drop-pulse { to { transform: translateY(-4px); } }
.dropzone-title { font-size: 16px; font-weight: 600; color: var(--color-ink); }
.dropzone.landed { animation: drop-land 520ms var(--ease-out); }
.dropzone.shake { animation: drop-shake 420ms var(--ease); }
@keyframes drop-land { 0% { transform: scale(1); } 35% { transform: scale(0.985); border-color: var(--color-success); } 100% { transform: scale(1); } }
@keyframes drop-shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }

/* 올린 파일 줄: 위에서 떨어져 들어오고, 처리 중 흐르는 막대 → 끝나면 ✓ / ✕ */
.drop-queue { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.drop-item {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border: 1px solid var(--color-hairline); border-radius: var(--radius-md, 8px);
  background: var(--color-surface); font-size: 13px; color: var(--color-ink);
  animation: drop-in var(--dur-std) var(--ease-out) both;
}
.drop-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drop-state { width: 16px; text-align: center; font-weight: 700; }
.drop-bar { position: absolute; left: 0; bottom: 0; height: 2px; width: 40%; background: var(--color-primary); animation: drop-flow 1100ms var(--ease) infinite; }
.drop-item.done .drop-bar, .drop-item.fail .drop-bar { display: none; }
.drop-item.done { border-color: var(--color-success); }
.drop-item.done .drop-state::before { content: "✓"; color: var(--color-success); }
.drop-item.fail { border-color: var(--color-danger); background: var(--color-fail-bg); }
.drop-item.fail .drop-state::before { content: "✕"; color: var(--color-danger); }
.drop-item.done .drop-state, .drop-item.fail .drop-state { animation: chip-in var(--dur-std) var(--ease-out) both; }
@keyframes drop-in { from { opacity: 0; transform: translateY(-10px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes drop-flow { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

/* 시수·성적: 성적산출표(구글 시트) 모양 미리보기. 계=파랑, 성적·성적평가·시수·F 점검=노랑 */
.sheet-box { overflow: auto; max-height: 70vh; }
.sheet-table { border-collapse: collapse; font-size: 12px; white-space: nowrap; }
.sheet-table th, .sheet-table td { border: 1px solid var(--color-hairline-strong); padding: 3px 8px; text-align: center; }
.sheet-table th { background: var(--color-canvas-soft); font-weight: 600; color: var(--color-ink); position: sticky; top: 0; }
.sheet-table thead tr:nth-child(2) th { top: 22px; }
.sheet-table thead th[rowspan="2"] { white-space: normal; max-width: 140px; }
.sheet-table td.sum, .sheet-table th.sum { background: color-mix(in srgb, var(--color-primary) 10%, transparent); }
.sheet-table td.key, .sheet-table th.key { background: color-mix(in srgb, var(--color-accent-orange) 22%, transparent); }
.sheet-table tr.fail-row td:nth-child(-n+2) { color: var(--color-danger); font-weight: 600; }
.sheet-table td.sheet-empty { padding: 20px; color: var(--color-ink-muted); }

.profile-logout { margin-top: 10px; width: 100%; }

.web-gate {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: var(--color-scrim);
  animation: page-in var(--dur-std) var(--ease-out);
}
.web-gate-card {
  max-width: 420px; padding: 28px; border-radius: var(--radius-xl); background: var(--color-surface); box-shadow: var(--shadow-2);
  display: flex; flex-direction: column; gap: 12px; align-items: flex-start;
}
.web-gate-card h2, .web-gate-card p { margin: 0; }
.web-gate-card select { width: 100%; }
.web-banner {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 90; max-width: calc(100% - 32px);
  padding: 10px 16px; border-radius: var(--radius-lg, 12px); background: var(--color-ink); color: var(--color-canvas);
  font-size: 13px; box-shadow: var(--shadow-2);
}

/* 좁은 화면(태블릿 세로·휴대폰): 사이드바를 위로 올리고 본문은 스크롤 */
@media (max-width: 900px) {
  body { overflow: auto; user-select: auto; }
  .layout { flex-direction: column; height: auto; min-height: 100vh; }
  .sidebar { width: auto; height: auto; padding: 12px; border-right: 0; border-bottom: 1px solid var(--color-hairline); }
  .nav-label, .mini-cal { display: none; }
  .nav { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; gap: 4px; }
  .nav-indicator { display: none; }
  .nav-item { white-space: nowrap; flex: none; }
  .nav-item.active { background: var(--color-canvas-soft); box-shadow: inset 0 -2px 0 var(--color-primary); }
  .role-nav { display: contents; }
  .profile { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 10px; margin-top: 8px; padding: 8px 12px; text-align: left; }
  .profile .name, .profile .detail { text-align: left; grid-column: 1; }
  .profile-logout { grid-column: 2; grid-row: 1 / span 2; }
  .profile-logout { width: auto; margin: 0 0 0 auto; }
  .main { height: auto; overflow: visible; padding: 20px 16px 48px; }
  .grid-two, .grid-group, .field-grid { grid-template-columns: 1fr !important; }
  .table-box { overflow-x: auto; }
  .top-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .top-tab { flex: none; white-space: nowrap; }
}

/* 담당이 아니라 잠긴 버튼·입력칸이 눈에 보이게 */
.ds-btn:disabled, .seg-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.ds-input[readonly], .ds-input:disabled { background: var(--color-canvas-soft); color: var(--color-ink-muted); }

/* 관리자 화면 */
.admin-body { overflow: auto; user-select: auto; min-height: 100vh; }
.admin-bar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between;
  padding: 10px 24px; background: var(--color-canvas); border-bottom: 1px solid var(--color-hairline);
}
.admin-bar .brand { padding: 0; }
.admin-tag { margin-left: 4px; padding: 2px 8px; border-radius: 9999px; background: var(--color-tint); color: var(--color-secondary); font-size: 12px; font-weight: 600; }
.admin-main { max-width: 1040px; margin: 0 auto; padding: 28px 24px 64px; }
.admin-main .page { display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 700px) {
  .admin-bar { padding: 10px 16px; }
  .admin-tag { display: none; }
  .admin-main { padding: 20px 16px 48px; }
  .admin-main .grid-two { grid-template-columns: 1fr; }
}

/* 학생 자료함 */
.files-search { margin: 0; max-width: 360px; }
.files-list { display: flex; flex-direction: column; gap: 6px; }
.files-folder { border: 1px solid var(--color-hairline); border-radius: var(--radius-md); background: var(--color-surface); overflow: hidden; }
.files-head { display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px; }
.files-toggle {
  flex: 1; display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 8px; text-align: left;
  border: 0; border-radius: var(--radius-sm); background: none; cursor: pointer; font-size: 14px;
}
.files-toggle:hover { background: var(--color-canvas-soft); }
.files-toggle svg { flex: none; color: var(--color-ink-muted); transition: transform var(--dur-std) var(--ease); }
.files-toggle[aria-expanded="true"] svg { transform: rotate(90deg); }
.files-items { border-top: 1px solid var(--color-hairline); padding: 4px 8px 8px 30px; animation: page-in var(--dur-std) var(--ease-out); }
.files-item { display: flex; align-items: center; gap: 8px; }
.files-name {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 4px 8px; text-align: left;
  border: 0; border-radius: var(--radius-sm); background: none; cursor: pointer; color: var(--color-text-primary); font-size: 14px;
}
.files-name:hover { background: var(--color-tint); }
.files-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files-name small { flex: none; margin-left: auto; color: var(--color-ink-faint); font-size: 12px; }
.files-del, .files-zip { min-height: 32px; padding: 4px 10px; font-size: 13px; }

/* 메신저 페이지: 위아래 여백을 줄여 화면을 꽉 채움 */
.page-chat { gap: 0; }

.admin-views { display: inline-flex; gap: 2px; padding: 2px; border-radius: var(--radius-md); background: var(--color-canvas-soft); }
.admin-views .seg-btn { display: inline-flex; align-items: center; gap: 6px; }
.admin-views .nav-badge { margin-left: 0; }
.admin-chat { animation: page-in var(--dur-std) var(--ease-out); }
.admin-chat .chat { height: calc(100vh - 120px); }
@media (max-width: 700px) { .admin-bar { flex-wrap: wrap; gap: 8px; } }

[hidden] { display: none !important; }

.doc { max-width: 760px; margin: 0 auto; line-height: 1.75; font-size: 15px; }
.doc h1 { margin: 0 0 8px; }
.doc h2 { margin: 28px 0 8px; font-size: 18px; }
.doc p, .doc li { color: var(--color-ink); }

/* 화면 언어 고르기 */
.lang-pick { width: auto; min-height: 36px; padding: 4px 28px 4px 10px; font-size: 13px; }

/* 인증서 결과물 미리보기 */
.pdf-preview { position: fixed; inset: 0; z-index: 150; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(0, 0, 0, 0.55); }
.pdf-preview-card { display: flex; flex-direction: column; width: min(960px, 100%); height: min(88vh, 1100px); border-radius: var(--radius-lg, 12px); overflow: hidden;
  background: var(--color-surface); box-shadow: var(--shadow-2); }
.pdf-preview-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--color-hairline); }
.pdf-preview-head b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.pdf-preview iframe { flex: 1; width: 100%; border: 0; background: #fff; }
@media (max-width: 600px) { .pdf-preview { padding: 0; } .pdf-preview-card { height: 100vh; border-radius: 0; } }
