/* Khu giáo viên (/giao-vien): dùng chung site.css, thêm vài phần riêng. Tông xanh dương nhạt để khác hẳn giao diện phụ huynh. */
.teacher-area { background: #f3f6fc; }
.tc-badge { margin-left: 8px; padding: 3px 10px; border-radius: 999px; background: #2f5bd3; color: #fff; font-size: .78rem; font-weight: 700; letter-spacing: .02em; }
.tc-wrap { max-width: 900px; }
.tc-foot { text-align: center; color: var(--ink-soft); font-size: .86rem; padding: 10px 16px 30px; }
.tc-foot a { color: inherit; }
.tc-back { margin: 0 0 8px; font-size: .92rem; }
.tc-back a { color: var(--ink-soft); text-decoration: none; }
.tc-auth { max-width: 520px; }
.tc-auth.tc-wide { max-width: 760px; }
.tc-hello h1 { margin-bottom: 4px; }
.tc-verify { background: #fff6dc; border: 1.5px solid #f0c75e; }

.tc-grades, .tc-chips { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 16px; }
.tc-grades legend, .tc-chips legend { font-size: .92rem; margin-bottom: 6px; width: 100%; }
.tc-grades label { display: inline-flex; gap: 6px; align-items: center; }
.tc-chips { gap: 8px; margin-bottom: 18px; }
.tc-chip { position: relative; cursor: pointer; }
.tc-chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.tc-chip span { display: inline-block; padding: 8px 14px; border-radius: 12px; border: 1.5px solid #d6dcea; background: #fff; font-weight: 600; font-size: .93rem; }
.tc-chip input:checked + span { border-color: #2f5bd3; background: #e7eefe; color: #1d3f9e; }
.tc-chip input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.tc-chip-other span { color: var(--ink-soft); }
.tc-field { display: grid; gap: 6px; margin-bottom: 18px; font-size: .92rem; }
.tc-field select { max-width: 100%; }

.tc-steps { padding-left: 22px; line-height: 1.6; }
.tc-list { display: grid; gap: 8px; }
.tc-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1.5px solid #e3e8f3; text-decoration: none; color: inherit; background: #fff; }
.tc-item:hover { border-color: #2f5bd3; }
.tc-item-main { flex: 1; display: grid; gap: 2px; min-width: 0; }
.tc-code { font-family: ui-monospace, monospace; font-weight: 700; letter-spacing: .08em; }
.pill.tc-open { background: #dff5e9; color: #0e6b43; }
.pill.tc-draft { background: #eef1f7; color: var(--ink-soft); }

.tc-settings .row { margin-bottom: 12px; }
.tc-narrow { flex: 0 1 170px !important; }
.tc-summary { margin: 6px 0 12px; }
.tc-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 8px; }

.tc-answer { margin: 8px 0 4px; }
.tc-solution summary { cursor: pointer; color: var(--ink-soft); font-size: .92rem; }
.tc-q-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; border-top: 1px dashed #dfe4ef; margin-top: 12px; padding-top: 12px; }
.tc-q-tools .btn.small { min-height: 36px; padding: 6px 12px 4px; font-size: .88rem; }
.tc-swap { width: 100%; }
.tc-swap summary { cursor: pointer; color: #2f5bd3; font-size: .9rem; font-weight: 600; }
.tc-swap .row { margin-top: 8px; }
.tc-swap select, .tc-add select { flex: 1 1 200px; min-width: 0; }
.tc-delete { margin: 14px 0 0; text-align: right; }
.tc-delete .link { color: var(--coral); }

.tc-share-grid { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: start; margin: 12px 0 16px; }
.tc-bigcode { display: block; font-family: ui-monospace, monospace; font-size: 2.2rem; letter-spacing: .12em; color: #1d3f9e; }
.tc-link { margin: 2px 0 8px; word-break: break-all; font-weight: 600; }
.tc-msg { display: grid; gap: 6px; font-size: .92rem; margin-bottom: 8px; }
.tc-msg textarea { width: 100%; font: inherit; padding: 10px 12px; border-radius: 12px; border: 1.5px solid #d6dcea; background: #fafbfe; resize: vertical; }

@media (max-width: 640px) {
    .tc-share-grid { grid-template-columns: 1fr; gap: 12px; }
    .tc-badge { display: none; }
    .tc-item { flex-wrap: wrap; gap: 6px 10px; }
    .tc-item-main { flex: 1 1 100%; }
    .tc-done { margin-right: auto; font-size: .88rem; }
}
.teacher-area input[type=datetime-local] {
    font: 500 1rem/1.3 var(--font-text); padding: 10px 14px; min-height: var(--control-h); width: 100%;
    border: var(--control-border); border-radius: var(--control-radius); background-color: #fff; color: var(--ink);
}
.tc-results { width: 100%; border-collapse: collapse; font-size: .94rem; }
.tc-results th, .tc-results td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #e6eaf3; white-space: nowrap; }
.tc-results th { font-size: .84rem; color: var(--ink-soft); font-weight: 600; }
.tc-done { font-size: .88rem; color: var(--ink-soft); white-space: nowrap; }

/* ───────── Thống kê cả lớp (đợt 3) ───────── */
.tc-stats h3 { margin: 22px 0 8px; font-size: 1.02rem; }
.tc-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.tc-tiles > div { background: #f6f8fd; border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.tc-tiles b { font-size: 1.6rem; line-height: 1.1; }
.tc-tiles small { color: var(--ink-soft); font-size: .84rem; }
@media (max-width: 640px) { .tc-tiles { grid-template-columns: repeat(2, 1fr); } }
.tc-bands { display: flex; flex-direction: column; gap: 4px; }
.tc-band summary { display: grid; grid-template-columns: 110px 1fr 36px; align-items: center; gap: 10px; cursor: pointer; padding: 4px 0; list-style: none; }
.tc-band summary::-webkit-details-marker { display: none; }
.tc-band-label { font-size: .9rem; }
.tc-band-n { text-align: right; }
.tc-bar { display: inline-block; height: 14px; width: 100%; background: #eef1f7; border-radius: 7px; overflow: hidden; vertical-align: middle; }
.tc-bar.small { width: 90px; height: 10px; }
.tc-bar i { display: block; height: 100%; border-radius: 7px; min-width: 2px; }
.tc-bar .b9 { background: #2fb36d; } .tc-bar .b8 { background: #6cc56f; } .tc-bar .b6 { background: #f2b92c; }
.tc-bar .b5 { background: #f39a3d; } .tc-bar .b0 { background: #e86a5f; }
.tc-names { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px 120px; }
.tc-names a { background: #f1f4fa; border-radius: 999px; padding: 2px 10px; font-size: .88rem; text-decoration: none; }
@media (max-width: 640px) { .tc-band summary { grid-template-columns: 90px 1fr 30px; } .tc-names { margin-left: 0; } }
.tc-topics tr.weak td:first-child { color: #c2453a; font-weight: 600; }
.tc-hard { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.tc-rate { margin-left: auto; }
.tc-rate.good { background: #e3f6ea; color: #1f8a50; } .tc-rate.bad { background: #fde8e6; color: #c2453a; }
.tc-wrong { background: #fff7ec; border-radius: 12px; padding: 8px 12px; font-size: .92rem; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.tc-wrong-item { background: #fff; border: 1px solid #f3dcc0; border-radius: 999px; padding: 1px 10px; }
.tc-student-top { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: baseline; }
.tc-student-top .score { font-size: 2.4rem; font-weight: 800; }
.tc-topics td:first-child { white-space: normal; min-width: 150px; }
@media (max-width: 640px) { .tc-topics .tc-bar.small { width: 50px; } .tc-topics th, .tc-topics td { padding: 8px 6px; } }

/* ───────── Khối kết quả và khối đề: hai nền khác nhau cho dễ tách ───────── */
.tc-panel { background: linear-gradient(180deg, #eaf1ff 0, #f3f7ff 100%); border: 1px solid #d9e4fb; border-radius: 22px; padding: 18px 18px 4px; margin: 26px 0; }
.tc-panel > .card { box-shadow: 0 1px 2px rgba(30, 50, 100, .06); }
.tc-panel-title, .tc-paper-head h2 { margin: 2px 4px 14px; font-size: 1.2rem; }
.tc-paper { background: #f6f3ec; border: 1px solid #e9e2d3; border-radius: 22px; padding: 18px; margin: 26px 0 18px; }
.tc-paper-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.tc-paper-head h2 { margin-bottom: 10px; }
@media (max-width: 640px) { .tc-panel, .tc-paper { padding: 12px 10px 2px; margin-left: -6px; margin-right: -6px; border-radius: 18px; } }

/* Một câu: cùng một khung trắng, có số câu tròn, các câu cách nhau rõ ràng */
.tc-q { background: #fff; border: 1px solid #e6e0d2; border-radius: 18px; padding: 16px 18px 14px; margin-bottom: 14px;
    box-shadow: 0 1px 2px rgba(60, 50, 20, .05); scroll-margin-top: 90px; transition: box-shadow .4s, opacity .3s, height .3s, margin .3s, padding .3s; }
.tc-q.tc-flash { box-shadow: 0 0 0 3px #2f5bd3, 0 6px 18px rgba(47, 91, 211, .18); }
.tc-q.tc-busy { opacity: .55; pointer-events: none; }
.tc-q.tc-out { opacity: 0; overflow: hidden; margin-bottom: 0; padding-top: 0; padding-bottom: 0; }
.tc-q-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px solid #f0ece2; }
.tc-num { display: inline-grid; place-items: center; min-width: 32px; height: 32px; padding: 0 6px; border-radius: 999px; background: #1d3f9e; color: #fff; font-weight: 800; font-size: .95rem; }
.tc-q .figure svg { max-width: 260px; }
.tc-q .prompt { font-size: 1.05rem; }

/* Phương án trắc nghiệm: ô theo hàng cột, ô đúng tô xanh */
.tc-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 10px 0 6px; }
@media (max-width: 520px) { .tc-opts { grid-template-columns: 1fr; } }
.tc-opt { display: flex; align-items: center; gap: 10px; border: 1.5px solid #e3e7f0; border-radius: 12px; padding: 8px 12px; background: #fbfcfe; min-height: 46px; }
.tc-opt-key { flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: #eef1f7; font-weight: 700; font-size: .88rem; }
.tc-opt-text { flex: 1; min-width: 0; }
.tc-opt .answer-pic svg { max-height: 56px; width: auto; }
.tc-opt.right { border-color: #38b26f; background: #eefaf3; }
.tc-opt.right .tc-opt-key { background: #2fb36d; color: #fff; }
.tc-opt-mark { color: #1f8a50; font-weight: 800; }
.tc-kind-hint { margin: 8px 0 4px; font-size: .88rem; color: var(--ink-soft); }
.tc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 6px; }
.tc-chip { border: 1.5px solid #e3e7f0; background: #fbfcfe; border-radius: 10px; padding: 4px 10px; }
.tc-chip small { color: #1f8a50; font-weight: 700; margin-right: 2px; }
.tc-chip.right { border-color: #38b26f; background: #eefaf3; }
.tc-chip.extra { border-color: #e86a5f; background: #fdeeec; color: #c2453a; text-decoration: line-through; }
.tc-pairs { border-collapse: collapse; margin: 8px 0; }
.tc-pairs th { font-size: .82rem; color: var(--ink-soft); font-weight: 600; text-align: left; padding: 4px 10px; }
.tc-pairs td { border-top: 1px solid #eef1f7; padding: 6px 10px; vertical-align: middle; }
.tc-pairs .answer-pic svg { max-height: 48px; width: auto; }
.tc-add { border-top: 1px dashed #d9d1bf; padding-top: 14px; margin-top: 4px; }
.tc-add h2 { font-size: 1.05rem; }
.tc-promise { display: grid; gap: 10px; margin: 14px 0 18px; }
.tc-promise > div { border-radius: 14px; padding: 12px 14px; }
.tc-promise > div:first-child { background: #e9f8ef; border: 1px solid #c6ecd4; }
.tc-promise > div:last-child { background: #eef3ff; border: 1px solid #d6e1fb; }
.tc-promise h2 { font-size: 1.02rem; margin: 0 0 4px; }
.tc-promise p { margin: 0 0 4px; font-size: .93rem; }

/* ───────── Khung thông tin bài (bản nháp): hai hàng thẳng cột, nhãn cùng một kiểu ───────── */
.tc-fields { display: grid; grid-template-columns: minmax(0, 1fr) 170px; gap: 16px 16px; align-items: start; }
.tc-fields > label, .tc-fields > div { display: flex; flex-direction: column; gap: 6px; margin: 0; min-width: 0; }
.tc-f-label { font-weight: 700; font-size: .95rem; line-height: 1.3; min-height: 1.3em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-f-label small { font-weight: 500; color: var(--ink-soft); font-size: .82rem; margin-left: 4px; }
.tc-fields input, .tc-fields select { width: 100%; margin: 0; }
.tc-due { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.tc-due select { min-width: 0; }
.tc-suffix { position: relative; display: block; }
.tc-suffix input { padding-right: 52px; }
.tc-suffix > span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-soft); font-weight: 600; pointer-events: none; }
.tc-settings .tc-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 18px 0 4px; padding: 10px 14px;
    background: #f5f7fc; border: 1px solid #e6eaf3; border-radius: 14px; }
.tc-sum-main { font-size: 1rem; }
.tc-levels { display: inline-flex; gap: 6px; }
.tc-lv { font-size: .82rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; }
.tc-lv.lv1 { background: #e3f6ea; color: #1f8a50; } .tc-lv.lv2 { background: #fff2d6; color: #9a6a00; } .tc-lv.lv3 { background: #fde8e6; color: #c2453a; }
.tc-sum-src { flex-basis: 100%; color: var(--ink-soft); font-size: .86rem; }
.tc-settings .tc-actions { margin-top: 14px; }
.tc-left { margin-left: auto; font-size: .84rem; color: var(--ink-soft); }
@media (max-width: 640px) {
    /* Điện thoại: tên bài một hàng; lớp và thời gian làm chung một hàng; hạn nộp một hàng (ngày rộng, giờ và phút bên dưới). */
    .tc-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px 10px; }
    .tc-fields > .tc-f-title { grid-column: 1 / -1; }
    .tc-fields > div.tc-f-title { order: 3; }
    .tc-fields > label.tc-f-side:last-child { order: 2; }
    .tc-f-label { white-space: normal; }
    .tc-f-label small { display: block; margin: 2px 0 0; }
    .tc-due { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .tc-due select:first-child { grid-column: 1 / -1; }
    .tc-left { margin-left: 0; flex-basis: 100%; }
}

/* Đăng ký giáo viên: form rộng, hai cột (điện thoại một cột). */
.tc-reg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; align-items: start; }
.tc-reg-grid .tc-grades { margin: 0; }
@media (max-width: 640px) { .tc-reg-grid { grid-template-columns: 1fr; } }
.tc-promise { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tc-promise ul { margin: 0; padding-left: 18px; font-size: .92rem; }
.tc-promise li { margin: 2px 0; }
@media (max-width: 640px) { .tc-promise { grid-template-columns: 1fr; } }
.tc-forgot { margin: -4px 0 0; text-align: right; font-size: .9rem; }

/* Thanh đầu trang riêng của khu giáo viên: nền xanh dương nhạt, vạch xanh đậm phía trên, để nhìn là biết đang ở trang giáo viên. */
.teacher-area .top { background: linear-gradient(180deg, rgba(200, 217, 255, .97), rgba(216, 228, 255, .97)); border-bottom-color: #aec3f0; box-shadow: inset 0 4px 0 #2f5bd3; }
.teacher-area .top .nav-link { color: #1d3f9e; }
.teacher-area .top .menu-avatar { background: #2f5bd3; color: #fff; }
