html {
  /* Fix Double Scroll: Do not force overflow here */
}

/* ================= RESET ================= */
* {
  box-sizing: border-box;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

html,
body {
  margin: 0;
}

/* DESKTOP ONLY: Height 100% for fixed layout */
@media (min-width: 769px) {

  html,
  body {
    height: 100%;
    overflow: hidden;
    /* Lock window scroll on desktop, scroll inside .content */
  }
}

@media (max-width: 768px) {

  html,
  body {
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
  }
}

/* ================= PREMIUM SCROLLBAR ================= */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

body {
  margin: 0;
  background: #f6f8fc;
  color: #0f1e3a;
  /* Chống giật khi scroll trên mobile */
  overscroll-behavior-y: auto;
}

.layout {
  display: flex;
  height: calc(100vh - 84px);
  /* Adjusted for header */
  overflow: hidden;
  /* Desktop: Sidebar fixed, content scrolls */
}

@media (max-width: 768px) {
  .layout {
    height: auto;
    min-height: 100vh;
    display: block;
    overflow: visible;
    /* Mobile: Allow full page scroll */
    padding-bottom: 80px;
  }
}

/* ================= TOP BAR ================= */

.topbar {
  font-size: 14px;
  margin: 15px;
  height: 84px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e5eaf2;
  padding-left: 210px;
  padding-right: 120px;
  position: relative;
  z-index: 1000;
  /* Ensure header stays on top */
}

/* ================= BRAND ================= */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 6px;
}

.brand-icon {
  width: 42px;
  height: auto;
  margin-left: 6px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

/* TÊN THƯƠNG HIỆU */
.brand-name {
  position: relative;
  font-size: 20px;
  font-weight: 700;
  color: #161616;
  letter-spacing: 0.3px;
  padding-bottom: 6px;
}

/* GẠCH CHUẨN */
.brand-name::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 34px;
  height: 2px;
  background: #161616;
  border-radius: 2px;
}

/* SLOGAN */
.brand-slogan {
  font-size: 13px;
  font-weight: 500;
  color: #161616;
  margin-top: 4px;
  font-style: italic;
}

/* ================= ACTIONS ================= */

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  flex-shrink: 0;
  white-space: nowrap;
}

/* =========================
   SEARCH INPUT – GIỮ FORM CŨ
========================= */
.top-actions input {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #dbe2ee;
  outline: none;

  width: 240px;
  height: 36px;
  font-size: 14px;

  flex-shrink: 0;
}

.top-actions input:focus {
  border-color: #1d4ed8;
}

/* =========================
   BUTTON – KHÔNG ĐỤNG LOGO
========================= */
.top-actions .btn {
  height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.top-actions a,
.top-actions a:hover,
.top-actions a:focus,
.top-actions a:active {
  text-decoration: none;
}

.btn.btn-outline {
  background: transparent;
  border: 2px solid #000000;
  color: #000000;
}

/* ================= BUTTON ================= */
.btn {
  padding: 5px 16px;
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, #000000, #19191a);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s ease;
  border: 2px solid #000000;
}

.btn:hover {
  padding: 8px 16px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s ease;
  background: #fff;
  color: #000000;
  border: 2px solid #000000;
  font-size: 14px;
}

.btn.primary {
  background: #1d4ed8;
}

.btn.outline {
  background: transparent;
  border: 2px solid #1d4ed8;
  color: #1d4ed8;
}



/* ================= LAYOUT ================= */
.layout {
  display: flex;
}

/* ================= SIDEBAR ================= */
.sidebar {
  width: 220px;
  background: #fff;
  border-right: 1px solid #e5eaf2;
  height: 100%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.sidebar a {
  display: block;
  padding: 12px 20px;
  color: #334155;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.sidebar a.active,
.sidebar a:hover {
  background: #eef3ff;
  color: #1d4ed8;
}

/* ================= MAIN CONTENT ================= */
/* ================= MAIN CONTENT ================= */
.content {
  flex: 1;
  height: 100%;
  overflow-y: auto;
  padding: 30px;
  background: #f6f8fc;
  display: flex;
  flex-direction: column;
  position: relative;
}

@media (max-width: 768px) {
  .content {
    padding: 16px;
    padding-bottom: 90px;
    display: block;
    height: auto;
    /* Allow full height */
    overflow: visible;
    /* Let window scroll */
  }
}

.notice {
  background: #eef3ff;
  padding: 12px 16px;
  border-left: 4px solid #1d4ed8;
  border-radius: 8px;
  margin: 20px 0;
}

/* ================= GRID ================= */
.grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

/* ================= CARD ================= */
.card {
  background: #ffffff;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.04);
}

.card h3 {
  margin-top: 0;
}

.card input {
  width: 100%;
  padding: 10px;
  margin: 10px 0;
  border-radius: 8px;
  border: 1px solid #ddd;
  outline: none;
}

.card input:focus {
  border-color: #1d4ed8;
}

/* ================= TAGS ================= */
.tags span {
  display: inline-block;
  background: #f1f4fb;
  padding: 6px 10px;
  border-radius: 20px;
  margin: 5px 5px 0 0;
  font-size: 13px;
  color: #334155;
}

/* ================= TEXT ================= */
.desc {
  font-size: 14px;
  color: #555;
}

/* ================= RESPONSIVE ================= */
@media (max-width: 768px) {
  .brand-name {
    font-size: 18px;
  }

  .brand-slogan {
    font-size: 12px;
  }

  .brand-icon {
    width: 36px;
  }

  .top-actions input {
    display: none;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }
}

/* ================= VISIBILITY UTILS (Passive) ================= */
@media (max-width: 768px) {
  .desktop-only {
    display: none !important;
  }
}

@media (min-width: 769px) {
  .mobile-only {
    display: none !important;
  }
}

/* ================= MOBILE ================= */
.mobile-topbar {
  display: none;
}

/* Bottom nav */
.bottom-nav {
  display: none;
}

/* ================= MOBILE BREAKPOINT ================= */
@media (max-width: 768px) {

  /* ẨN DESKTOP */
  .topbar,
  .sidebar {
    display: none;
  }

  /* HEADER MOBILE */
  .mobile-topbar {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    padding: 0 16px;
    background: #fff;
    border-bottom: 1px solid #e5eaf2;

    /* FIX: Make it Fixed */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
  }

  .mobile-brand {
    text-align: center;
    flex: 1;
  }

  .mobile-brand .brand-name {
    font-size: 16px;
    font-weight: 700;
  }

  .mobile-brand .brand-slogan {
    font-size: 11px;
    color: #000000;
  }

  .icon-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
  }

  /* CONTENT */
  .content {
    padding: 16px;
    padding-top: 62px;
    /* 60px Header + 2px Space (Tighter) */
    padding-bottom: 90px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  /* CARD */
  .card {
    padding: 16px;
  }

  /* TAGS */
  .tags span {
    font-size: 12px;
    padding: 5px 8px;
  }

  /* BOTTOM NAV */
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-top: 1px solid #e5eaf2;
    height: calc(64px + env(safe-area-inset-bottom));
    /* 👈 iPhone X+ Safe Area */
    padding-bottom: env(safe-area-inset-bottom);
    justify-content: space-around;
    align-items: center;
    z-index: 100;
  }

  .bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 11px;
    color: #64748b;
    text-decoration: none;
    justify-content: center;
    height: 100%;
    /* Canh giữa chiều dọc */
  }

  .bottom-nav a.active {
    color: #1d4ed8;
    font-weight: 600;
  }
}

.mobile-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-logo {
  width: 28px;
  height: auto;
}

.mobile-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

/* ================= RESET ================= */
* {
  box-sizing: border-box;
  font-family: Inter, system-ui, sans-serif;
}

body {
  margin: 0;
  background: #f6f8fc;
  color: #0f1e3a;
}

/* ================= COMMON ================= */
h1,
h2 {
  margin: 0 0 16px;
}

.section {
  margin-top: 0px;
}

.btn {
  padding: 6px 16px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: all .2s ease;
}

.btn.primary {
  background: #1d4ed8;
  color: #fff;
}

.btn.primary:hover {
  background: #163fc2;
}

.btn.outline {
  background: transparent;
  border: 2px solid #1d4ed8;
  color: #1d4ed8;
}

.btn.outline:hover {
  background: #eef3ff;
}

/* ================= HERO ================= */
.hero {
  background: #fff;
  padding: 28px;
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .04);
}

.notice {
  background: #eef3ff;
  border-left: 4px solid #1d4ed8;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.hero-search {
  display: flex;
  gap: 12px;
}

.hero-search input {
  flex: 1;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #dbe2ee;
}

/* ================= TOOL NỔI BẬT ================= */
.tool-highlight {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.tool-card {
  background: #fff;
  padding: 20px;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .04);
}

.tool-card h4 {
  margin: 0 0 6px;
}

.tool-card p {
  font-size: 14px;
  color: #555;
}

.meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  margin: 10px 0;
}

.tag {
  background: #eef3ff;
  color: #1d4ed8;
  padding: 4px 10px;
  border-radius: 20px;
}

/* ================= FILTER ================= */
.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filter {
  padding: 8px 14px;
  border-radius: 20px;
  border: 1px solid #dbe2ee;
  background: #fff;
  cursor: pointer;
  font-weight: 500;
}

.filter.active,
.filter:hover {
  background: #1d4ed8;
  color: #fff;
  border-color: #1d4ed8;
}

/* ================= GRID TOOL ================= */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.tool-item {
  background: #fff;
  padding: 20px;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .04);
}

.tool-item h4 {
  margin: 0 0 6px;
}

.tool-item p {
  font-size: 14px;
  color: #555;
}

/* ================= COURSE ================= */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.course-card {
  background: linear-gradient(135deg, #eef3ff, #ffffff);
  padding: 22px;
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .04);
}

.course-card h4 {
  margin: 0 0 6px;
}

.course-card p {
  font-size: 14px;
  color: #555;
}

/* ================= MOBILE ================= */
@media (max-width: 768px) {
  .hero-search {
    flex-direction: column;
  }

  .section {
    margin-top: 24px;
  }
}

.btn.btn-outline:hover {
  background: linear-gradient(135deg, #000000, #19191a);
  color: #fff;
}


/* ================= loguot ================= */

/* =========================
   USER DROPDOWN (HEADER)
   ========================= */

.topbar .top-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.user-menu {
  position: relative;
  display: inline-block;
}

.avatar-btn {
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
  position: relative;
}

/* dot online */
.dot-online {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid #fff;
}

/* dropdown bám phải */
.user-dropdown {
  position: absolute;
  top: 52px;
  right: 0;
  left: auto;

  width: 300px;
  background: #fff;
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .18);

  display: none;
  z-index: 99999;
}

.user-dropdown.active {
  display: block;
}

/* head */
.user-dropdown__head {
  display: flex;
  gap: 10px;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(0, 0, 0, .06);
  margin-bottom: 12px;
}

.user-dropdown__avatar img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.user-dropdown__name {
  font-weight: 700;
  line-height: 1.1;
}

.user-dropdown__email {
  font-size: 13px;
  color: rgba(0, 0, 0, .55);
  margin-top: 2px;
  word-break: break-word;
}

/* rows */
.user-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
}

.user-row .label {
  color: rgba(0, 0, 0, .55);
  font-size: 13px;
}

.user-row .value {
  font-weight: 600;
}

/* actions */
.user-dropdown__actions {
  margin-top: 12px;
}

.user-dropdown__actions .btn-logout {
  width: 100%;
  border-radius: 12px;
}

/* mobile */
@media (max-width:768px) {
  .user-dropdown {
    top: 48px;
    right: 10px;
    width: calc(100vw - 20px);
    max-width: 360px;
  }
}