:root{
  --bg:#F3F7FA;
  --surface:#FFFFFF;
  --surface-2:#E6EEF4;
  --ink:#132433;
  --ink-2:#4C6478;
  --line:#C6D6E2;
  --accent:#1D6FA8;
  --accent-strong:#155A8C;
  --danger:#B3261E;
  --ok:#1E7B4D;
}
@media (prefers-color-scheme: dark){
  :root{
    --bg:#0C1621;
    --surface:#12202E;
    --surface-2:#172A3B;
    --ink:#E6EFF6;
    --ink-2:#9BB2C4;
    --line:#22384B;
    --accent:#5AA9E6;
    --accent-strong:#7EBDEE;
  }
}

*{box-sizing:border-box;}
html,body{height:100%;margin:0;}
body{
  display:flex;
  font-family:'Segoe UI', 'Be Vietnam Pro', sans-serif;
  background:var(--bg);
  color:var(--ink);
}

.thanh-dieu-huong{
  width:210px;
  flex:none;
  background:var(--surface);
  border-right:1px solid var(--line);
  padding:20px 12px;
  display:flex;
  flex-direction:column;
  gap:4px;
}
.thanh-dieu-huong .logo{
  font-weight:700;
  font-size:1.05rem;
  padding:0 10px 18px;
  color:var(--ink);
}
.thanh-dieu-huong button{
  text-align:left;
  border:none;
  background:transparent;
  color:var(--ink-2);
  font-size:.94rem;
  padding:10px 12px;
  border-radius:6px;
  cursor:pointer;
}
.thanh-dieu-huong button:hover{ background:var(--surface-2); }
.thanh-dieu-huong button.dang-chon{
  background:var(--accent);
  color:#fff;
  font-weight:600;
}

.noi-dung{
  flex:1;
  overflow:auto;
  padding:0;
}
.khung{ display:none; height:100%; }
.khung.dang-hien{ display:block; }
.khung iframe{ width:100%; height:100%; border:none; }

.trang{
  max-width:920px;
  margin:0 auto;
  padding:32px 28px 60px;
}
.trang h1{ font-size:1.5rem; margin:0 0 6px; }
.trang .mo-ta-trang{ color:var(--ink-2); margin:0 0 24px; font-size:.94rem; }

.hop{
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:8px;
  padding:20px;
  margin-bottom:20px;
}
.hop h2{ font-size:1.05rem; margin:0 0 14px; }

.hang-nut{ display:flex; gap:10px; flex-wrap:wrap; align-items:center; }

button.nut{
  background:var(--accent);
  color:#fff;
  border:none;
  padding:9px 16px;
  border-radius:6px;
  font-size:.9rem;
  font-weight:600;
  cursor:pointer;
}
button.nut:hover{ background:var(--accent-strong); }
button.nut.phu{ background:var(--surface-2); color:var(--ink); }
button.nut.nguy-hiem{ background:var(--danger); }
button.nut:disabled{ opacity:.5; cursor:not-allowed; }

input[type=text], input[type=email], input[type=password], textarea, select{
  width:100%;
  padding:8px 10px;
  border:1px solid var(--line);
  border-radius:6px;
  background:var(--bg);
  color:var(--ink);
  font-size:.9rem;
  font-family:inherit;
}
textarea{ resize:vertical; }
label{ display:block; font-size:.85rem; color:var(--ink-2); margin-bottom:4px; }
.truong{ margin-bottom:14px; }

table{ width:100%; border-collapse:collapse; font-size:.9rem; }
th,td{ text-align:left; padding:8px 10px; border-bottom:1px solid var(--line); }
th{ color:var(--ink-2); font-weight:600; font-size:.8rem; text-transform:uppercase; letter-spacing:.03em; }
tr.dang-active td{ color:var(--ok); font-weight:600; }

.the-nho{
  display:inline-block;
  padding:2px 8px;
  border-radius:10px;
  font-size:.75rem;
  background:var(--surface-2);
  color:var(--ink-2);
}
.the-nho.xanh{ background:rgba(30,123,77,.15); color:var(--ok); }
.the-nho.do{ background:rgba(179,38,30,.15); color:var(--danger); }

.progress{
  height:8px;
  background:var(--surface-2);
  border-radius:4px;
  overflow:hidden;
}
.progress > div{ height:100%; background:var(--accent); width:0%; transition:width .2s; }

.nhat-ky{
  background:var(--bg);
  border:1px solid var(--line);
  border-radius:6px;
  padding:10px 12px;
  font-family:'Consolas', monospace;
  font-size:.82rem;
  max-height:220px;
  overflow:auto;
  white-space:pre-wrap;
}

.gach-doc{ color:var(--ink-2); }

/* ---------- Quan ly video (luoi kieu YouTube) ---------- */
.nhom-kenh-video{ margin-bottom:34px; }
.nhom-kenh-video h2{
  font-size:1.05rem;
  margin:0 0 14px;
  display:flex;
  align-items:center;
  gap:10px;
}
.nhom-kenh-video .so-luong{ font-weight:400; color:var(--ink-2); font-size:.85rem; }
.nhom-kenh-video .loi-kenh{ color:var(--danger); font-size:.88rem; }

.luoi-video{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(220px, 1fr));
  gap:16px;
}
.the-video{
  cursor:pointer;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:8px;
  overflow:hidden;
  display:flex;
  flex-direction:column;
}
.the-video:hover{ border-color:var(--accent); }
.the-video .khung-anh{
  position:relative;
  width:100%;
  aspect-ratio:16/9;
  background:var(--surface-2);
  overflow:hidden;
}
.the-video .khung-anh img{ width:100%; height:100%; object-fit:cover; display:block; }
.the-video .nhan-rieng-tu{
  position:absolute;
  bottom:6px;
  right:6px;
  background:rgba(0,0,0,.72);
  color:#fff;
  font-size:.7rem;
  padding:2px 6px;
  border-radius:3px;
}
.the-video .noi-dung-the{ padding:10px 12px 12px; display:flex; flex-direction:column; gap:4px; }
.the-video .tieu-de-video{
  font-size:.9rem;
  font-weight:600;
  line-height:1.35;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
.the-video .meta-video{ font-size:.78rem; color:var(--ink-2); }

/* ---------- Tai khoan & mat khau (muc Quan ly danh ba) ---------- */
input[type=date]{
  width:100%; padding:8px 10px; border:1px solid var(--line); border-radius:6px;
  background:var(--bg); color:var(--ink); font-size:.9rem; font-family:inherit;
}
.tk-form{ background:var(--surface-2); border:1px solid var(--line); border-radius:8px; padding:16px; margin-bottom:18px; }
.tk-form h3{ margin:0 0 12px; font-size:1rem; }
.tk-luoi-form{ display:grid; grid-template-columns:1fr 1fr; gap:0 16px; }
.tk-mk{ display:flex; gap:8px; }
.tk-loi{ color:var(--danger); font-size:.88rem; min-height:1.2em; margin-bottom:8px; }
.tk-luoi{ display:grid; grid-template-columns:repeat(auto-fill, minmax(330px, 1fr)); gap:14px; }
.tk-the{ background:var(--bg); border:1px solid var(--line); border-radius:8px; padding:14px; display:flex; flex-direction:column; gap:6px; min-width:0; }
.tk-dau{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-bottom:4px; }
.tk-ten{ font-size:1rem; overflow-wrap:anywhere; }
.tk-dong{ display:flex; align-items:center; gap:8px; font-size:.88rem; }
.tk-nhan{ flex:none; width:104px; color:var(--ink-2); font-size:.8rem; }
.tk-giatri{ flex:1; min-width:0; overflow-wrap:anywhere; }
.tk-giatri a{ color:var(--accent-strong); }
.tk-mk-hien{ font-family:'Consolas', monospace; }
.tk-nut{ flex:none; border:1px solid var(--line); background:var(--surface); color:var(--ink-2); border-radius:5px; padding:2px 9px; font-size:.75rem; cursor:pointer; }
.tk-nut:hover{ color:var(--accent-strong); border-color:var(--accent); }
.tk-chan{ display:flex; gap:8px; align-items:center; margin-top:8px; padding-top:10px; border-top:1px solid var(--line); }
.tk-chan .nut{ padding:5px 12px; font-size:.8rem; }
.tk-cap-nhat{ margin-left:auto; font-size:.72rem; color:var(--ink-2); }
@media (max-width:760px){ .tk-luoi-form{ grid-template-columns:1fr; } }
