:root{
  --bg:#f5f7fb;
  --panel:#ffffff;
  --ink:#0f172a;
  --muted:#64748b;
  --line:#e5e7eb;

  --primary:#2563eb;
  --primary2:#1d4ed8;
  --accent:#06b6d4;

  --logo-code:#06b6d4;
  --logo-zen:#334155;

  --success:#16a34a;
  --shadow:0 18px 45px rgba(15,23,42,.08);
  --radius:24px;
}

*{
  box-sizing:border-box;
}

body{
  background:radial-gradient(circle at top left,#e0f2fe 0,#f5f7fb 34%,#f8fafc 100%);
  color:var(--ink);
  font-family:"Be Vietnam Pro",Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}

/* NAVBAR */
.nav-glass{
  background:#ffffff;
  backdrop-filter:blur(14px);
  border-bottom:1px solid #e5e7eb;
  box-shadow:0 2px 15px rgba(15,23,42,.05);
}

.brand{
  font-weight:950;
  letter-spacing:-.055em;
  font-size:1.65rem;
  color:var(--logo-zen) !important;
  text-decoration:none;
}

.brand:hover{
  color:var(--logo-zen) !important;
}

.brand span{
  color:var(--logo-code) !important;
}

.brand-logo{
  height:34px;
  width:34px;
  object-fit:cover;
  border-radius:10px;
  margin-right:8px;
  vertical-align:middle;
}

.nav-link{
  font-weight:700;
  color:#334155 !important;
  border-radius:999px;
  padding:.55rem .9rem !important;
  transition:.2s ease;
}

.nav-link:hover{
  background:#eff6ff;
  color:var(--primary) !important;
}

.navbar-toggler{
  border:0;
  box-shadow:none !important;
}

/* BUTTONS */
.btn-primary{
  background:linear-gradient(135deg,var(--primary),var(--accent));
  border:0;
}

.btn-primary:hover{
  filter:brightness(.96);
}

.muted{
  color:var(--muted);
}

.section-title{
  font-weight:900;
  letter-spacing:-.045em;
}

.searchbox{
  max-width:340px;
  border-radius:999px;
  border:1px solid #dbe3ef;
  padding:.8rem 1.1rem;
}

.scroll-anchor{
  scroll-margin-top:92px;
}

/* HERO */
.hero{
  border-radius:34px;
  padding:46px;
  background:linear-gradient(135deg,#0f172a,#1d4ed8 58%,#06b6d4);
  color:#fff;
  box-shadow:var(--shadow);
  overflow:hidden;
  position:relative;
}

.hero:after{
  content:"";
  position:absolute;
  width:320px;
  height:320px;
  border-radius:50%;
  background:rgba(255,255,255,.13);
  right:-80px;
  top:-80px;
}

.hero h1{
  font-size:clamp(2.1rem,5vw,4.5rem);
  font-weight:950;
  letter-spacing:-.065em;
  line-height:.98;
}

.hero p{
  font-size:1.08rem;
  color:#dbeafe;
  max-width:760px;
}

/* COMMON */
.pill{
  display:inline-flex;
  align-items:center;
  gap:6px;
  background:#eaf2ff;
  color:#1d4ed8;
  border:1px solid #d6e6ff;
  border-radius:999px;
  padding:.38rem .75rem;
  font-weight:750;
  font-size:.8rem;
}

.cz-card{
  background:rgba(255,255,255,.95);
  border:1px solid rgba(226,232,240,.85);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
}

.course-card{
  height:100%;
  padding:24px;
  cursor:pointer;
  transition:.2s ease;
}

.course-card:hover{
  transform:translateY(-5px);
  box-shadow:0 24px 60px rgba(37,99,235,.13);
  border-color:#bfdbfe;
}

.course-thumb{
  height:118px;
  border-radius:22px;
  background:linear-gradient(135deg,#dbeafe,#cffafe);
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:2rem;
  font-weight:950;
  color:#1e40af;
  letter-spacing:-.06em;
}

.lesson-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  border:1px solid #eef2f7;
  border-radius:18px;
  padding:14px 16px;
  margin:.55rem 0;
  background:#fff;
}

.lesson-row:hover{
  border-color:#bfdbfe;
  background:#f8fbff;
}

.chapter-title{
  font-weight:900;
  margin:18px 0 8px;
  color:#0f172a;
}

.empty{
  border:1px dashed #cbd5e1;
  border-radius:20px;
  padding:24px;
  text-align:center;
  color:var(--muted);
  background:#f8fafc;
}

/* LEARN PAGE */
.learn-page{
  background:#eef3fb;
  min-height:calc(100vh - 72px);
}

.learn-header{
  background:#fff;
  border:1px solid #e2e8f0;
  border-radius:28px;
  padding:24px 28px;
  box-shadow:var(--shadow);
}

.learn-header h1{
  font-size:clamp(1.6rem,3vw,2.8rem);
  font-weight:950;
  letter-spacing:-.055em;
  margin:.25rem 0 0;
}

.lesson-kicker{
  color:#64748b;
  font-weight:700;
}

.back-link{
  text-decoration:none;
  font-weight:800;
  color:var(--primary);
}

.learn-layout{
  display:grid;
  grid-template-columns:minmax(0,1fr) 340px;
  gap:22px;
}

.learn-main,
.learn-side{
  min-width:0;
}

.video-card,
.content-card,
.side-card{
  background:#fff;
  border:1px solid #e2e8f0;
  border-radius:28px;
  box-shadow:var(--shadow);
  overflow:hidden;
}

.video-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px 18px;
  background:#0f172a;
  color:#fff;
  font-weight:800;
}

.video-toolbar .small{
  color:#cbd5e1;
}

.video-wrap{
  position:relative;
  background:#020617;
  border-radius:0;
  overflow:hidden;
  aspect-ratio:16/9;
}

.video-wrap iframe{
  width:100%;
  height:100%;
  border:0;
}

.yt-click-blocker{
  position:absolute;
  inset:0;
  z-index:5;
  background:transparent;
}

.custom-controls{
  display:flex;
  align-items:center;
  gap:12px;
  padding:16px 18px;
  background:#fff;
  border-top:1px solid #e5e7eb;
}

.round-icon{
  min-width:48px;
  height:44px;
  border:0;
  border-radius:999px;
  background:#eff6ff;
  color:#1d4ed8;
  font-weight:900;
}

.round-icon:hover{
  background:#dbeafe;
}

.custom-controls input[type=range]{
  flex:1;
  accent-color:var(--primary);
}

.content-card{
  padding:22px;
}

.content-tabs{
  display:flex;
  gap:8px;
  margin-bottom:18px;
  border-bottom:1px solid #e5e7eb;
  padding-bottom:12px;
}

.content-tabs button{
  border:0;
  background:#eff6ff;
  color:#1d4ed8;
  font-weight:800;
  border-radius:999px;
  padding:9px 16px;
}

.content-tabs button.active{
  background:#1d4ed8;
  color:#fff;
}

.lesson-desc h5,
.side-title{
  font-weight:900;
  letter-spacing:-.02em;
}

/* DOCUMENTS - ĐÃ SỬA THÀNH HÀNG NGANG */
.doc-grid{
  display:flex;
  flex-direction:column;
  gap:14px;
  margin-top:18px;
}

.doc-item{
  display:flex;
  align-items:center;
  gap:16px;
  width:100%;
  border:1px solid #e2e8f0;
  border-radius:18px;
  padding:16px 18px;
  background:#f8fafc;
  color:#0f172a;
  text-decoration:none;
  min-height:82px;
  transition:.2s ease;
}

.doc-item:hover{
  border-color:#93c5fd;
  background:#eff6ff;
  transform:translateY(-2px);
  color:#0f172a;
}

.doc-icon{
  width:54px;
  height:54px;
  min-width:54px;
  border-radius:16px;
  background:linear-gradient(135deg,#2563eb,#06b6d4);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:.82rem;
  font-weight:950;
  text-transform:uppercase;
}

.doc-info{
  flex:1;
  min-width:0;
}

.doc-title{
  font-weight:850;
  font-size:1rem;
  color:#0f172a;
  margin-bottom:3px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.doc-desc{
  color:#64748b;
  font-size:.9rem;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.doc-arrow{
  margin-left:auto;
  color:#2563eb;
  font-weight:950;
  font-size:1.2rem;
}

.side-card{
  padding:20px;
  position:sticky;
  top:92px;
}

.attachment{
  display:flex;
  align-items:center;
  justify-content:space-between;
  border:1px solid #e2e8f0;
  border-radius:18px;
  padding:13px;
  margin:8px 0;
  background:#fff;
}

/* ADMIN */
.table-card{
  overflow:hidden;
}

.stat{
  padding:24px;
}

.stat b{
  font-size:2.2rem;
}

.admin-shell{
  display:grid;
  grid-template-columns:260px 1fr;
  gap:22px;
}

.admin-menu{
  padding:16px;
  position:sticky;
  top:88px;
  height:fit-content;
}

.admin-menu button{
  width:100%;
  border:0;
  background:transparent;
  text-align:left;
  padding:12px 14px;
  border-radius:16px;
  font-weight:800;
  color:#475569;
}

.admin-menu button.active,
.admin-menu button:hover{
  background:#eff6ff;
  color:#1d4ed8;
}

.edit-panel{
  border:1px solid #bfdbfe;
  box-shadow:0 24px 60px rgba(37,99,235,.12);
}

.logo-preview{
  max-width:180px;
  max-height:120px;
  border-radius:18px;
  border:1px solid #e2e8f0;
  padding:8px;
  background:#fff;
}

.nav-pills .nav-link{
  font-weight:800;
}

.nav-pills .nav-link.active{
  background:linear-gradient(135deg,var(--primary),var(--accent));
}

/* LOGIN MODAL */
.login-card{
  border:0;
  border-radius:30px;
  overflow:hidden;
  box-shadow:0 30px 80px rgba(15,23,42,.22);
}

.login-hero{
  display:flex;
  align-items:center;
  gap:14px;
  padding:22px 24px;
  color:#fff;
  background:linear-gradient(135deg,#0f172a,#1d4ed8 60%,#06b6d4);
}

.login-hero p{
  color:#dbeafe;
}

.login-logo{
  width:54px;
  height:54px;
  border-radius:18px;
  background:rgba(255,255,255,.16);
  border:1px solid rgba(255,255,255,.25);
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:950;
  font-size:1.2rem;
  letter-spacing:-.06em;
}

.login-input{
  border-radius:18px;
  border:1px solid #dbe3ef;
  padding:.85rem 1rem;
  font-size:15px;
  font-weight:500;
}

.login-input::placeholder{
  color:#94a3b8;
  font-weight:400;
}

.login-input:focus{
  border-color:#93c5fd;
  box-shadow:0 0 0 .25rem rgba(37,99,235,.12);
}

#loginModal .form-label{
  font-size:14px;
  font-weight:800;
  color:#0f172a;
}

.login-note{
  border:1px dashed #bfdbfe;
  background:#eff6ff;
  color:#1e3a8a;
  border-radius:20px;
  padding:14px 16px;
  font-size:.92rem;
}

.hint{
  color:#64748b;
  font-size:.9rem;
}

/* FOOTER */
.contact-footer{
  margin-top:60px;
  padding:36px 0 22px;
  background:linear-gradient(135deg,#0f172a,#1e293b);
  color:#e2e8f0;
}

.contact-box{
  display:grid;
  grid-template-columns:1.2fr .8fr;
  gap:24px;
  align-items:center;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.12);
  border-radius:28px;
  padding:28px;
}

.footer-brand{
  font-size:1.8rem;
  font-weight:950;
  letter-spacing:-.06em;
  color:#e2e8f0;
  margin-bottom:8px;
}

.footer-brand span{
  color:var(--logo-code);
}

.contact-info{
  display:grid;
  gap:8px;
  font-size:.95rem;
}

.contact-info b{
  color:#fff;
}

.footer-bottom{
  text-align:center;
  color:#94a3b8;
  font-size:.9rem;
  margin-top:22px;
}

/* HTML5 VIDEO */
.video-wrap .cz-video{
  width:100%;
  height:100%;
  display:block;
  background:#020617;
  object-fit:contain;
}

.cz-video-controls{
  display:flex;
  align-items:center;
  gap:12px;
  padding:16px 18px;
  background:#fff;
  border-top:1px solid #e5e7eb;
}

.cz-video-controls input[type=range]{
  flex:1;
  accent-color:var(--primary);
}

.cz-video-controls .round-icon{
  min-width:50px;
}

/* YOUTUBE WRAPPER */
.yt-frame{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
}

.yt-frame iframe{
  width:100%;
  height:100%;
  border:0;
  display:block;
}

.yt-mask{
  position:absolute;
  inset:0;
  z-index:5;
  background:transparent;
  cursor:default;
}

/* RESPONSIVE */
@media(max-width:992px){
  .learn-layout,
  .admin-shell{
    grid-template-columns:1fr;
  }

  .learn-side{
    order:-1;
  }

  .searchbox{
    max-width:100%;
    margin-top:12px;
  }

  .hero{
    padding:30px;
  }

  .side-card{
    position:static;
  }
}

@media(max-width:768px){
  .contact-box{
    grid-template-columns:1fr;
    padding:22px;
  }

  .login-hero{
    padding:20px;
  }

  .login-logo{
    width:48px;
    height:48px;
  }

  .brand{
    font-size:1.45rem;
  }

  .doc-item{
    padding:14px;
  }

  .doc-icon{
    width:48px;
    height:48px;
    min-width:48px;
  }
}