/* ========================================================
   교사 전용 화면 (Figma 리디자인 토큰 기반, 모바일 우선)
   ======================================================== */

[hidden] { display: none !important; }

.teacher-body { background: var(--bg-app); min-height: 100vh; padding-bottom: 84px; }

/* ---------- 로그인 ---------- */
.t-login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.t-login-card {
  width: 100%; max-width: 400px; background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl); padding: 2rem 1.75rem; box-shadow: var(--shadow-lg); text-align: center;
}
.t-logo {
  width: 56px; height: 56px; margin: 0 auto 1rem; border-radius: 18px; display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--primary); font-weight: 800; font-size: 1.15rem;
}
.t-login h1 { font-size: 1.6rem; margin-bottom: .35rem; }
.t-sub { color: var(--text-secondary); font-size: .88rem; margin-bottom: 1.25rem; }
.t-login form { text-align: left; }
.t-label { display: block; font-size: .8rem; font-weight: 600; color: var(--text-secondary); margin: .9rem 0 .4rem; }
.t-full { width: 100%; padding: .95rem; font-size: 1rem; margin-top: 1rem; }
.t-link { display: inline-block; margin-top: 1.25rem; font-size: .85rem; color: var(--text-muted); }
.t-msg { display: none; margin-top: .85rem; padding: .65rem .8rem; border-radius: var(--radius-md); font-size: .85rem; }
.t-msg.err { display: block; background: var(--danger-soft); color: var(--danger); }
.t-msg.ok { display: block; background: var(--success-soft); color: var(--success); }

/* ---------- 헤더 ---------- */
.t-header {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: .8rem 1rem; background: var(--bg-surface); border-bottom: 1px solid var(--border-subtle);
}
.t-dept { font-size: 1.05rem; font-weight: 800; }
.t-user { font-size: .78rem; color: var(--text-muted); }
.t-header-actions { display: flex; gap: .4rem; }
.t-icon-btn {
  border: 1px solid var(--border-subtle); background: var(--bg-surface); color: var(--text-secondary);
  border-radius: var(--radius-full); padding: .4rem .8rem; font-size: .78rem; font-weight: 600; cursor: pointer; font-family: inherit;
}
.t-icon-btn:hover { background: var(--bg-elevated); }

.t-main { max-width: 760px; margin: 0 auto; padding: 1rem; }
.t-tab { display: none; }
.t-tab.active { display: block; }
.t-h2 { font-size: 1.05rem; margin: 1.25rem 0 .7rem; }
.t-h2 small { display: block; font-size: .75rem; font-weight: 500; color: var(--text-muted); margin-top: .15rem; }

/* ---------- 출석 ---------- */
.t-session-row { display: flex; gap: .5rem; }
.t-session-row select { flex: 1; min-width: 0; }
.t-kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: .5rem; margin: .9rem 0; }
.t-kpi {
  background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
  padding: .6rem .4rem; text-align: center; display: flex; flex-direction: column; gap: .15rem;
}
.t-kpi span { font-size: .68rem; color: var(--text-muted); font-weight: 600; }
.t-kpi strong { font-size: 1.35rem; font-family: var(--font-heading); }
.t-kpi.ok strong { color: var(--success); }
.t-kpi.warn strong { color: var(--warning); }
.t-kpi.bad strong { color: var(--danger); }
.t-rate { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: .8rem 1rem; }
.t-rate-top { display: flex; justify-content: space-between; align-items: baseline; font-size: .85rem; color: var(--text-secondary); margin-bottom: .5rem; }
.t-rate-top strong { font-size: 1.4rem; color: var(--primary); }
.t-track { height: 10px; background: var(--bg-elevated); border-radius: 999px; overflow: hidden; }
.t-bar { height: 100%; width: 0; background: var(--primary); border-radius: 999px; transition: width .4s; }

.t-tools { margin-top: .9rem; display: flex; flex-direction: column; gap: .6rem; }
.t-chips { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .15rem; }
.t-chip {
  flex: 0 0 auto; border: 1px solid var(--border-subtle); background: var(--bg-surface); color: var(--text-secondary);
  border-radius: 999px; padding: .35rem .8rem; font-size: .8rem; font-weight: 600; cursor: pointer; font-family: inherit;
}
.t-chip.active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.t-bulk { display: flex; gap: .5rem; margin: .8rem 0; }
.t-bulk .btn { flex: 1; font-size: .8rem; padding: .6rem .5rem; }

.t-list { list-style: none; display: flex; flex-direction: column; gap: .5rem; padding: 0; margin: 0; }
.t-student {
  background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
  padding: .75rem .9rem; display: flex; align-items: center; gap: .75rem; justify-content: space-between; flex-wrap: wrap;
}
.t-student-info { min-width: 0; flex: 1 1 140px; }
.t-student-name { font-weight: 700; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.t-student-meta { font-size: .75rem; color: var(--text-muted); margin-top: .1rem; }
.t-pill { font-size: .68rem; font-weight: 700; padding: .12rem .55rem; border-radius: 999px; background: var(--bg-elevated); color: var(--text-muted); }
.t-pill.PRESENT { background: var(--success-soft); color: var(--success); }
.t-pill.LATE { background: var(--warning-soft); color: var(--warning); }
.t-pill.ABSENT { background: var(--danger-soft); color: var(--danger); }
.t-actions { display: flex; gap: .3rem; }
.t-act {
  border: 1px solid var(--border-subtle); background: var(--bg-surface); color: var(--text-secondary); border-radius: var(--radius-sm);
  padding: .45rem .7rem; font-size: .8rem; font-weight: 700; cursor: pointer; font-family: inherit; min-width: 48px;
}
.t-act:hover { background: var(--bg-elevated); }
.t-act.on.PRESENT { background: var(--success); border-color: var(--success); color: #fff; }
.t-act.on.LATE { background: var(--warning); border-color: var(--warning); color: #fff; }
.t-act.on.ABSENT { background: var(--danger); border-color: var(--danger); color: #fff; }
.t-empty { text-align: center; color: var(--text-muted); font-size: .88rem; padding: 2rem 1rem; background: var(--bg-surface); border: 1px dashed var(--border-subtle); border-radius: var(--radius-md); }

/* ---------- 현황 ---------- */
.t-trend {
  background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
  padding: 1rem; display: flex; align-items: flex-end; gap: .5rem; height: 200px;
}
.t-trend-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: .3rem; min-width: 0; }
.t-trend-bar { width: 100%; max-width: 36px; background: var(--primary); border-radius: 6px 6px 0 0; min-height: 3px; }
.t-trend-col em { font-style: normal; font-size: .7rem; font-weight: 700; color: var(--text-secondary); }
.t-trend-col span { font-size: .65rem; color: var(--text-muted); }

/* ---------- 돌봄 / 공통 카드 ---------- */
.t-card { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 1rem; }
.t-form { display: flex; flex-direction: column; gap: .6rem; }
.t-form textarea { resize: vertical; }
.t-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.t-care-item { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: .8rem .9rem; }
.t-care-top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.t-care-notes { margin: .4rem 0; font-size: .85rem; color: var(--text-secondary); white-space: pre-wrap; word-break: keep-all; }
.t-care-meta { font-size: .72rem; color: var(--text-muted); }
.t-care-item select { margin-top: .5rem; font-size: .8rem; padding: .4rem .6rem; }

/* ---------- 바로가기 ---------- */
.t-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .75rem; }
.t-link-card {
  display: flex; flex-direction: column; gap: .25rem; background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); padding: 1rem; color: var(--text-main); text-decoration: none;
}
.t-link-card:hover { border-color: var(--primary); box-shadow: var(--border-glow); }
.t-link-card strong { font-size: 1rem; }
.t-link-card span { font-size: .8rem; color: var(--text-muted); }

/* ---------- 하단 내비 / 모달 ---------- */
.t-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--bg-surface); border-top: 1px solid var(--border-subtle); padding: .4rem .5rem calc(.4rem + env(safe-area-inset-bottom));
}
.t-nav-btn {
  border: none; background: none; padding: .7rem .25rem; font-size: .85rem; font-weight: 600; color: var(--text-muted);
  border-radius: var(--radius-md); cursor: pointer; font-family: inherit;
}
.t-nav-btn.active { color: var(--primary); background: var(--primary-soft); }

.t-modal { position: fixed; inset: 0; z-index: 100; background: var(--bg-overlay); display: flex; align-items: center; justify-content: center; padding: 1rem; }
.t-modal-card { width: 100%; max-width: 400px; background: var(--bg-surface); border-radius: var(--radius-xl); padding: 1.5rem; display: flex; flex-direction: column; gap: .6rem; box-shadow: var(--shadow-xl); }
.t-modal-card h2 { font-size: 1.2rem; }
.t-modal-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .5rem; }

@media (max-width: 420px) {
  .t-kpi strong { font-size: 1.15rem; }
  .t-actions .t-act { padding: .45rem .55rem; min-width: 42px; }
}
