/* Phân hệ Trực tuyến: dùng lại token màu và khoảng cách của toàn hệ thống. */
.dau-trang-truc-tuyen { --nhan: #2a6f97; }
.nut-vao-phong { color: var(--mau-chinh); }

.tt-luoi-hai-cot { display: grid; grid-template-columns: minmax(0, 1fr) 22rem; gap: var(--kc-5); align-items: start; }
.tt-khoi { display: flex; flex-direction: column; gap: var(--kc-3); padding: var(--kc-4); border: 1px solid var(--vien-the); border-radius: 12px; background: var(--nen-the); min-width: 0; }
.tt-khoi + .tt-khoi { margin-top: var(--kc-4); }
.tt-khoi > h2 { display: flex; align-items: center; gap: .5rem; margin: 0; font-size: var(--cc-15); font-weight: 700; color: var(--chu-chinh); }
.tt-khoi > h2 .so { margin-left: auto; font-size: var(--cc-12); color: var(--chu-phu); font-weight: 600; }
.tt-trong { margin: 0; color: var(--chu-phu); font-size: var(--cc-13); }
.tt-dong { display: flex; align-items: center; gap: var(--kc-3); padding: .625rem .75rem; border: 1px solid var(--vien-the); border-radius: 10px; background: var(--nen-dai); min-width: 0; }
.tt-dong-noi-dung { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .125rem; }
.tt-dong-noi-dung strong { overflow-wrap: anywhere; }
.tt-dong-noi-dung small { color: var(--chu-phu); font-size: var(--cc-12); overflow-wrap: anywhere; }
.tt-nhan { display: inline-flex; align-items: center; padding: .125rem .5rem; border-radius: 999px; font-size: var(--cc-12); font-weight: 600; white-space: nowrap; background: #ecedea; color: var(--chu-phu); }
.tt-nhan.dang-mo { background: #dcefe3; color: #17633b; }
.tt-nhan.canh-bao { background: #fdf0d5; color: #8a5a00; }
.tt-nhan.loi { background: #fbe4e2; color: #a12a22; }
.tt-tabs { display: flex; flex-wrap: wrap; gap: .25rem; }
.tt-tabs button { position: relative; padding: .375rem .75rem; border: 0; border-radius: 8px; background: transparent; color: var(--chu-phu); font: inherit; font-size: var(--cc-13); font-weight: 600; cursor: pointer; }
.tt-tabs button:hover { background: var(--nen-dai); }
.tt-tabs button.dang-chon { background: var(--mau-chinh); color: var(--chu-tren-mau); }
.tt-cham { position: absolute; top: .25rem; right: .25rem; width: .5rem; height: .5rem; border-radius: 50%; background: #c0272d; }

/* Phòng: màn hình chuẩn bị */
.phong-trung-tam { max-width: 44rem; margin: 2rem auto; display: flex; flex-direction: column; gap: var(--kc-4); }
.chuan-bi-the { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: var(--kc-5); padding: var(--kc-5); border: 1px solid var(--vien-the); border-radius: 14px; background: var(--nen-the); }
.chuan-bi-xem { position: relative; aspect-ratio: 16/10; border-radius: 12px; overflow: hidden; background: #16201a; display: grid; place-items: center; color: #d5ddd7; }
.chuan-bi-xem video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.chuan-bi-nut { position: absolute; bottom: .625rem; left: 0; right: 0; display: flex; justify-content: center; gap: .5rem; }
.chuan-bi-ben { display: flex; flex-direction: column; gap: var(--kc-3); min-width: 0; }
.chuan-bi-ben h1 { margin: 0; font-size: 1.25rem; line-height: 1.3; overflow-wrap: anywhere; }
.chuan-bi-ben label { display: flex; flex-direction: column; gap: .25rem; font-size: var(--cc-13); font-weight: 600; }
.tt-canh-bao { padding: .625rem .75rem; border-radius: 10px; background: #fdf0d5; color: #6d4800; font-size: var(--cc-13); }

/* Phòng: khi đang họp */
.phong-hop { display: grid; grid-template-columns: minmax(0, 1fr) 21rem; gap: var(--kc-3); height: calc(100vh - var(--chieu-cao-header) - 5.5rem); min-height: 34rem; }
.phong-hop.khong-ben { grid-template-columns: minmax(0, 1fr); }
.san-khau-cot { display: flex; flex-direction: column; gap: var(--kc-2); min-width: 0; min-height: 0; }
.san-khau-dau { display: flex; align-items: center; gap: var(--kc-3); min-width: 0; }
.san-khau-dau h1 { margin: 0; font-size: 1.0625rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.san-khau { flex: 1; min-height: 0; display: flex; gap: var(--kc-2); padding: var(--kc-2); border-radius: 14px; background: #101814; overflow: hidden; }
.vung-noi-dung { display: none; flex: 1; min-width: 0; position: relative; border-radius: 10px; overflow: auto; background: #1a241e; }
.san-khau.co-noi-dung .vung-noi-dung { display: block; }
#luoi-video { flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); grid-auto-rows: minmax(9rem, 1fr); gap: var(--kc-2); overflow-y: auto; }
.san-khau.co-noi-dung #luoi-video { flex: 0 0 13rem; grid-template-columns: 1fr; grid-auto-rows: 8rem; }
.o-video { position: relative; border-radius: 10px; overflow: hidden; background: #26332b; outline: 2px solid transparent; outline-offset: -2px; transition: outline-color .15s; }
.o-video.dang-noi { outline-color: #5ad08b; }
.o-video video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: none; }
.o-video.co-hinh video { display: block; }
.chu-dai-dien { position: absolute; inset: 0; margin: auto; width: 4rem; height: 4rem; border-radius: 50%; display: grid; place-items: center; background: #3a4c40; color: #fff; font-size: 1.5rem; font-weight: 700; }
.o-video.co-hinh .chu-dai-dien { display: none; }
.nhan-ten { position: absolute; left: .375rem; bottom: .375rem; right: .375rem; width: fit-content; max-width: calc(100% - .75rem); padding: .125rem .5rem; border-radius: 6px; background: rgb(0 0 0 / .55); color: #fff; font-size: var(--cc-12); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#vung-chia-se { position: absolute; inset: 0; display: grid; place-items: center; }
#vung-chia-se video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.ban-dang-chia-se { color: #d5ddd7; font-size: var(--cc-15); }
.vung-trinh-chieu, .vung-bang { position: absolute; inset: 0; display: flex; flex-direction: column; background: #fff; overflow: auto; }
.vung-bang canvas { display: block; width: 100%; background: #fff; touch-action: none; cursor: crosshair; }
.vung-trinh-chieu canvas { display: block; width: 100%; }
.thanh-nho { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .375rem .625rem; background: #f4f5f1; border-bottom: 1px solid #dfe2db; color: #1a241e; font-size: var(--cc-13); }
.thanh-nho .gian { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mau-but { width: 1.375rem; height: 1.375rem; border-radius: 50%; border: 2px solid #fff; outline: 1px solid #b9beb4; cursor: pointer; padding: 0; }
.mau-but.dang-chon { outline: 2px solid #1a241e; }
.thanh-dieu-khien { display: flex; flex-wrap: wrap; justify-content: center; gap: .375rem; padding: .25rem 0; }
.nut-phong { display: inline-flex; flex-direction: column; align-items: center; gap: .125rem; min-width: 3.875rem; padding: .3125rem .375rem; border: 1px solid var(--vien-the); border-radius: 10px; background: var(--nen-the); color: var(--chu-chinh); font: inherit; font-size: var(--cc-12); cursor: pointer; }
.nut-phong:hover { background: var(--nen-dai); }
.nut-phong.tat { background: #fbe4e2; color: #a12a22; border-color: #f2c4bf; }
.nut-phong.bat { background: var(--mau-chinh); color: var(--chu-tren-mau); border-color: var(--mau-chinh); }
.nut-phong.nguy-hiem { background: #b0322a; color: #fff; border-color: #b0322a; }
.ben-phong { display: flex; flex-direction: column; min-height: 0; gap: var(--kc-2); padding: var(--kc-2); border: 1px solid var(--vien-the); border-radius: 14px; background: var(--nen-the); }
.ben-noi-dung { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: .5rem; padding-right: .125rem; }
.nguoi-dong { display: flex; align-items: center; gap: .375rem; padding: .25rem .25rem; border-radius: 8px; font-size: var(--cc-13); }
.nguoi-dong:hover { background: var(--nen-dai); }
.nguoi-dong .ten { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nguoi-dong small { color: var(--chu-phu); font-size: 11px; }
.tin-phong { display: flex; flex-direction: column; font-size: var(--cc-13); }
.tin-phong b { font-size: var(--cc-12); }
.tin-phong span { white-space: pre-wrap; overflow-wrap: anywhere; }
.nhap-tin { display: flex; gap: .375rem; align-items: flex-end; }
.nhap-tin textarea, .ben-noi-dung textarea { width: 100%; padding: .375rem .5rem; border: 1px solid var(--vien-o-nhap); border-radius: 8px; background: var(--nen-the); color: var(--chu-chinh); font: inherit; font-size: var(--cc-13); resize: vertical; }
.binh-chon { display: flex; flex-direction: column; gap: .375rem; padding: .625rem; border: 1px solid var(--vien-the); border-radius: 10px; font-size: var(--cc-13); }
.lua-chon { position: relative; display: flex; justify-content: space-between; gap: .5rem; padding: .3125rem .5rem; border: 1px solid var(--vien-the); border-radius: 8px; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; overflow: hidden; }
.lua-chon i { position: absolute; inset: 0 auto 0 0; background: rgb(42 111 151 / .16); }
.lua-chon span { position: relative; }
.lua-chon.da-chon { border-color: var(--mau-chinh); font-weight: 700; }
.bieu-mau-hang { display: flex; flex-direction: column; gap: var(--kc-3); }
.bieu-mau-hang label { display: flex; flex-direction: column; gap: .25rem; font-size: var(--cc-13); font-weight: 600; }
.bieu-mau-chan { display: flex; justify-content: flex-end; gap: .5rem; margin-top: var(--kc-3); }
.o-tai-tep { display: flex; flex-direction: column; gap: .375rem; font-size: var(--cc-13); }
.thanh-tien-do { height: .375rem; border-radius: 999px; background: var(--nen-dai); overflow: hidden; }
.thanh-tien-do i { display: block; height: 100%; background: var(--mau-chinh); }
.danh-sach-chon { max-height: 14rem; overflow-y: auto; border: 1px solid var(--vien-the); border-radius: 8px; padding: .25rem; }
.danh-sach-chon label { flex-direction: row; align-items: center; gap: .5rem; padding: .25rem .375rem; font-weight: 400; }

/* Kho bài giảng */
.kho-bo-cuc { display: grid; grid-template-columns: 19rem minmax(0, 1fr); gap: var(--kc-4); align-items: start; }
.kho-bo-cuc.an-cay { grid-template-columns: minmax(0, 1fr); }
.kho-cay { display: flex; flex-direction: column; gap: .125rem; padding: .5rem; border: 1px solid var(--vien-the); border-radius: 12px; background: var(--nen-the); user-select: none; position: sticky; top: calc(var(--chieu-cao-header) + .75rem); max-height: calc(100vh - var(--chieu-cao-header) - 1.5rem); overflow-y: auto; }
.kho-cay-dau { display: flex; align-items: center; gap: .125rem; padding: .125rem .25rem .375rem; border-bottom: 1px solid var(--vien-the); margin-bottom: .25rem; }
.kho-cay-dau strong { flex: 1; font-size: var(--cc-13); }
.kho-dong { display: flex; align-items: stretch; border-radius: 8px; }
.kho-dong:hover { background: var(--nen-dai); }
.kho-dong.dang-chon { background: var(--mau-chinh); color: var(--chu-tren-mau); }
.kho-mui { flex: 0 0 1.75rem; display: grid; place-items: center; padding: 0; border: 0; background: transparent; color: inherit; cursor: pointer; border-radius: 8px; }
.kho-mui .rzi { font-size: 1.125rem; }
.kho-ten { flex: 1; min-width: 0; display: flex; align-items: center; gap: .5rem; padding: .375rem .5rem; border: 0; background: transparent; color: inherit; font: inherit; font-size: var(--cc-13); text-align: left; cursor: pointer; }
.kho-ten span { flex: 1; min-width: 0; }
.kho-ten small { flex: 0 0 auto; min-width: 1.375rem; padding: 0 .3125rem; border-radius: 999px; background: var(--nen-dai); color: var(--chu-phu); font-size: 11px; font-weight: 600; text-align: center; }
.kho-dong.dang-chon .kho-ten small { background: rgb(255 255 255 / .2); color: #fff; }
.kho-dong.bo-mon { font-weight: 700; }
.kho-dong.hoc-phan { margin-left: 1.75rem; }
.khoi-bang { padding: 0 .875rem .75rem; }
.bt-trong-lop { display: flex; flex-direction: column; gap: .375rem; padding: 0 .875rem .75rem; }
.bt-hoc-phan { border: 1px solid var(--vien-the); border-radius: 10px; background: var(--nen-dai); }
.bt-hoc-phan.dang-mo { background: var(--nen-the); }
.bt-dau-hp { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; width: 100%; padding: .4375rem .625rem; border: 0; border-radius: 10px; background: transparent; color: var(--chu-chinh); font: inherit; font-size: var(--cc-13); text-align: left; cursor: pointer; }
.bt-dau-hp:hover { background: var(--nen-dai); }
.bt-dau-hp .rzi { font-size: 1.125rem; color: var(--chu-phu); }
.bt-nhan-phai { margin-left: auto; }
.bt-hoc-phan .khoi-bang { padding: 0 .625rem .5rem; }

.khung-xem-tep { display: flex; flex-direction: column; gap: .5rem; }
.khung-xem-tep canvas, .khung-xem-tep img, .khung-xem-tep video { display: block; width: 100%; border: 1px solid var(--vien-the); border-radius: 8px; }

/* Nhắn tin */
.tin-bo-cuc { display: grid; grid-template-columns: 19rem minmax(0, 1fr); gap: var(--kc-3); height: calc(100vh - var(--chieu-cao-header) - 11rem); min-height: 28rem; }
.tin-danh-ba { display: flex; flex-direction: column; gap: .5rem; padding: .5rem; border: 1px solid var(--vien-the); border-radius: 12px; background: var(--nen-the); min-height: 0; }
.tin-danh-ba input { width: 100%; padding: .375rem .625rem; border: 1px solid var(--vien-o-nhap); border-radius: 8px; background: var(--nen-the); color: var(--chu-chinh); font: inherit; font-size: var(--cc-13); }
.tin-cuon { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: .125rem; }
.lien-he { display: flex; align-items: center; gap: .5rem; width: 100%; padding: .4375rem .5rem; border: 0; border-radius: 8px; background: transparent; color: var(--chu-chinh); font: inherit; text-align: left; cursor: pointer; }
.lien-he:hover { background: var(--nen-dai); }
.lien-he.dang-chon { background: var(--mau-chinh-nhat); }
.lien-he span.noi { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: var(--cc-13); }
.lien-he small { color: var(--chu-phu); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.so-chua-doc { min-width: 1.25rem; padding: 0 .3125rem; border-radius: 999px; background: #c0272d; color: #fff; font-size: 11px; font-weight: 700; text-align: center; }
.tin-khung { display: flex; flex-direction: column; min-height: 0; border: 1px solid var(--vien-the); border-radius: 12px; background: var(--nen-the); }
.tin-dau { display: flex; align-items: center; gap: .5rem; padding: .625rem .75rem; border-bottom: 1px solid var(--vien-the); }
.tin-dau strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tin-noi-dung { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: .375rem; padding: .75rem; }
.bong-tin { max-width: 72%; padding: .4375rem .625rem; border-radius: 12px; background: var(--nen-dai); border: 1px solid var(--vien-the); font-size: var(--cc-13); white-space: pre-wrap; overflow-wrap: anywhere; align-self: flex-start; }
.bong-tin.cua-toi { align-self: flex-end; background: var(--mau-chinh); color: var(--chu-tren-mau); border-color: var(--mau-chinh); }
.bong-tin.cua-toi a { color: #fff; }
.bong-tin time { display: block; margin-top: .125rem; font-size: 11px; opacity: .7; }
.tin-nhap { display: flex; flex-direction: column; gap: .375rem; padding: .5rem .75rem; border-top: 1px solid var(--vien-the); }

/* Cuộc gọi đến */
.nut-hop-thu { position: relative; display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 8px; color: inherit; text-decoration: none; }
.nut-hop-thu:hover { background: var(--nen-dai); }
.nut-hop-thu .so-chua-doc { position: absolute; top: -.125rem; right: -.125rem; }
.cuoc-goi-den { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 1100; width: 20rem; max-width: calc(100vw - 2rem); display: flex; flex-direction: column; gap: .75rem; padding: 1rem; border-radius: 14px; background: #16251d; color: #fff; box-shadow: 0 12px 32px rgb(0 0 0 / .35); }
.cuoc-goi-den strong { font-size: 1.0625rem; }
.cuoc-goi-den > div { display: flex; gap: .5rem; }
.cuoc-goi-den button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: .375rem; padding: .5rem; border: 0; border-radius: 10px; color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.nut-nhan-goi { background: #1f8a50; }
.nut-tu-choi-goi { background: #b0322a; }

@media (max-width: 1000px) {
    .tt-luoi-hai-cot, .kho-bo-cuc, .tin-bo-cuc { grid-template-columns: minmax(0, 1fr); height: auto; }
    .kho-cay { position: static; max-height: 18rem; }
    .tin-danh-ba { max-height: 16rem; }
    .tin-khung { height: 30rem; }
    .phong-hop { grid-template-columns: minmax(0, 1fr); height: auto; }
    .san-khau { height: 56vh; flex-direction: column; }
    .san-khau.co-noi-dung #luoi-video { flex: 0 0 6rem; grid-template-columns: repeat(auto-fill, 8rem); grid-auto-rows: 5.5rem; }
    .ben-phong { height: 24rem; }
    .chuan-bi-the { grid-template-columns: minmax(0, 1fr); }
}

/* Soạn chung */
.soan-dau { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-bottom: .5rem; }
.soan-dau strong { overflow-wrap: anywhere; }
.khung-soan { display: block; width: 100%; height: calc(100vh - var(--chieu-cao-header) - 7rem); min-height: 32rem; border: 1px solid var(--vien-the); border-radius: 12px; background: #fff; }

.xl-hai-cot { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.kho-the-muc { margin: .625rem 0 .25rem; font-size: var(--cc-13); color: var(--mau-chinh); }
