:root {
  --bkp-bg: #041722;
  --bkp-sidebar: #03131d;
  --bkp-surface: #0b2c3e;
  --bkp-surface-light: #12394d;
  --bkp-accent: #ffc536;
  --bkp-text: #f6f8fa;
  --bkp-muted: #9caeb9;
  --bkp-border: rgba(255,255,255,.12);
  --sidebar-width: 260px;
  --login-background-image: none;
}


* {
  box-sizing: border-box;
}


html {
  scroll-behavior: smooth;
}


body {
  margin: 0;

  min-height: 100vh;

  background:
    radial-gradient(
      circle at top right,
      rgba(25,83,106,.16),
      transparent 40%
    ),
    var(--bkp-bg);

  color: var(--bkp-text);

  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Arial,
    sans-serif;
}


button,
input,
textarea,
select {
  font: inherit;
}


button {
  cursor: pointer;
}


.hidden {
  display: none !important;
}


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


.full {
  width: 100%;
}



/* =========================================================
   SIDEBAR
========================================================= */

.sidebar {
  position: fixed;

  inset: 0 auto 0 0;

  width: var(--sidebar-width);

  padding: 24px 16px;

  display: flex;

  flex-direction: column;

  background: var(--bkp-sidebar);

  border-right:
    1px solid rgba(255,255,255,.07);

  z-index: 100;
}


.sidebar-brand {
  display: flex;

  align-items: center;

  gap: 12px;

  padding:
    7px 6px 23px;
}


.brand-logo-wrap {
  width: 48px;
  height: 48px;

  flex: 0 0 auto;
}


.brand-logo,
.brand-logo-fallback {
  width: 48px;
  height: 48px;

  border-radius: 50%;
}


.brand-logo {
  object-fit: cover;

  border:
    2px solid var(--bkp-accent);
}


.brand-logo-fallback {
  display: flex;

  align-items: center;

  justify-content: center;

  color: #061a24;

  background: var(--bkp-accent);

  font-weight: 950;

  border:
    2px solid rgba(255,255,255,.2);
}


.site-name {
  max-width: 160px;

  font-size: 14px;

  line-height: 1.05;

  font-weight: 950;
}


.site-tagline {
  margin-top: 5px;

  color: var(--bkp-muted);

  font-size: 11px;
}


.sidebar-section-title {
  margin:
    10px 10px 8px;

  color: #6e8b9b;

  font-size: 10px;

  font-weight: 950;

  letter-spacing: 1.7px;
}


.sidebar-nav {
  display: flex;

  flex-direction: column;

  gap: 5px;
}


.nav-item {
  width: 100%;

  min-height: 46px;

  display: flex;

  align-items: center;

  gap: 13px;

  padding:
    10px 13px;

  border: 0;

  border-radius: 12px;

  color: #c6d2d9;

  background: transparent;

  text-align: left;

  font-weight: 650;
}


.nav-item:hover {
  background: rgba(255,255,255,.06);
}


.nav-item.active {
  color: white;

  background:
    linear-gradient(
      90deg,
      rgba(0,133,170,.28),
      rgba(255,197,54,.10)
    );
}


.nav-icon {
  width: 20px;

  text-align: center;
}


.staff-navigation {
  margin-top: 12px;
}


.academy365-card {
  width: 100%;

  margin-top: auto;

  padding: 16px;

  border:
    1px solid rgba(255,197,54,.32);

  border-radius: 14px;

  color: inherit;

  background:
    rgba(255,197,54,.07);

  text-align: left;
}


.academy365-title {
  margin-bottom: 6px;

  color: var(--bkp-accent);

  font-weight: 950;
}


.academy365-text {
  color: #a9bbc5;

  font-size: 12px;

  line-height: 1.45;
}



/* =========================================================
   MAIN / HEADER
========================================================= */

.app-main {
  min-height: 100vh;

  margin-left: var(--sidebar-width);

  padding:
    34px 30px 60px;
}


.mobile-header {
  display: none;
}


.page-header {
  min-height: 98px;

  display: flex;

  align-items: center;

  justify-content: space-between;

  gap: 25px;

  padding:
    5px 0 24px;
}


.page-title {
  margin: 0;

  font-size: 27px;

  font-weight: 950;

  letter-spacing: -.7px;
}


.page-subtitle {
  margin:
    4px 0 0;

  color: var(--bkp-muted);

  font-size: 14px;
}


.header-actions {
  display: flex;

  align-items: center;

  gap: 9px;
}


.header-button,
.button {
  min-height: 42px;

  padding:
    0 15px;

  border-radius: 11px;

  font-weight: 850;
}


.button {
  border: 0;
}


.header-button.secondary,
.button.secondary {
  border:
    1px solid rgba(255,255,255,.18);

  color: white;

  background: transparent;
}


.header-button.primary,
.button.primary {
  border: 0;

  color: #09202c;

  background: var(--bkp-accent);
}


.button.danger {
  color: #ffaaaa;

  background:
    rgba(255,60,60,.1);

  border:
    1px solid rgba(255,100,100,.2);
}


.connection-badge {
  padding:
    7px 10px;

  border-radius: 999px;

  color: #78e9bc;

  background:
    rgba(47,209,154,.12);

  font-size: 11px;

  font-weight: 850;
}


.connection-badge.error {
  color: #ff8a8a;

  background:
    rgba(255,77,77,.12);
}


.user-avatar {
  width: 43px;
  height: 43px;

  display: flex;

  align-items: center;

  justify-content: center;

  border-radius: 50%;

  border:
    2px solid var(--bkp-accent);

  color: white;

  background: #092b3a;

  font-size: 10px;

  font-weight: 950;
}



/* =========================================================
   HERO
========================================================= */

.dashboard-grid {
  display: grid;

  grid-template-columns:
    minmax(0,2fr)
    minmax(310px,.9fr);

  gap: 18px;
}


.hero-card {
  position: relative;

  min-height: 465px;

  overflow: hidden;

  border-radius: 22px;

  border:
    1px solid var(--bkp-border);

  background:
    linear-gradient(
      135deg,
      #092c3e,
      #0b4559
    );

  background-size: cover;

  background-position: center;
}


.hero-overlay {
  position: absolute;

  inset: 0;

  background:
    linear-gradient(
      90deg,
      rgba(3,18,27,.95) 0%,
      rgba(3,18,27,.72) 48%,
      rgba(3,18,27,.12) 100%
    );
}


.hero-content {
  position: relative;

  z-index: 2;

  width: min(720px,80%);

  padding:
    38px 30px;
}


.hero-kicker,
.section-eyebrow {
  color: var(--bkp-accent);

  font-size: 11px;

  font-weight: 950;

  letter-spacing: 1.2px;
}


.hero-title {
  margin:
    16px 0 0;

  max-width: 690px;

  font-size:
    clamp(36px,4.4vw,61px);

  line-height: .99;

  letter-spacing: -2.7px;

  font-weight: 950;
}


.hero-title span {
  color: var(--bkp-accent);
}


.hero-excerpt {
  max-width: 650px;

  margin:
    20px 0;

  color: #d6e0e5;

  line-height: 1.55;

  font-size: 16px;
}


.hero-tags {
  display: flex;

  flex-wrap: wrap;

  gap: 8px;

  margin-bottom: 18px;
}


.tag,
.status-chip {
  display: inline-flex;

  align-items: center;

  padding:
    6px 9px;

  border-radius: 999px;

  border:
    1px solid rgba(255,255,255,.14);

  font-size: 10px;

  font-weight: 900;
}


.tag {
  color: white;

  background:
    rgba(4,23,34,.68);
}



/* =========================================================
   TODAY SIDE
========================================================= */

.dashboard-side {
  display: grid;

  gap: 16px;
}


.side-card,
.panel {
  border-radius: 18px;

  border:
    1px solid var(--bkp-border);

  background:
    linear-gradient(
      180deg,
      rgba(13,49,68,.94),
      rgba(5,30,43,.98)
    );
}


.side-card {
  padding: 20px;
}


.side-card-title {
  margin-bottom: 7px;

  color: var(--bkp-accent);

  font-size: 11px;

  font-weight: 950;

  letter-spacing: 1.2px;
}


.activity-item {
  width: 100%;

  min-height: 65px;

  display: flex;

  align-items: center;

  justify-content: space-between;

  gap: 15px;

  padding:
    10px 0;

  border: 0;

  border-bottom:
    1px solid rgba(255,255,255,.1);

  color: inherit;

  background: transparent;

  text-align: left;
}


.activity-item:hover {
  color: var(--bkp-accent);
}


.activity-item:last-child {
  border-bottom: 0;
}


.activity-item strong {
  display: block;

  margin-bottom: 3px;
}


.activity-item small {
  display: block;

  color: var(--bkp-muted);

  font-size: 12px;
}


.mini-badge {
  padding:
    8px 9px;

  border-radius: 8px;

  color: #05202b;

  font-size: 10px;

  font-weight: 950;
}


.mini-badge.blue {
  background: #45c5e9;
}


.mini-badge.yellow {
  background: var(--bkp-accent);
}


.mini-badge.green {
  background: #42d6a5;
}



/* =========================================================
   SECTIONS / CARDS
========================================================= */

.content-section {
  margin-top: 30px;
}


.section-header {
  display: flex;

  justify-content: space-between;

  align-items: flex-end;

  gap: 20px;

  margin-bottom: 15px;
}


.section-header h2 {
  margin: 0;

  font-size: 25px;
}


.section-action {
  border: 0;

  color: #b8c6ce;

  background: transparent;

  font-weight: 800;
}


.posts-grid,
.courses-grid {
  display: grid;

  gap: 16px;
}


.posts-grid {
  grid-template-columns:
    repeat(4,minmax(0,1fr));
}


.courses-grid {
  grid-template-columns:
    repeat(3,minmax(0,1fr));
}


.post-card,
.course-card {
  overflow: hidden;

  border-radius: 17px;

  border:
    1px solid var(--bkp-border);

  color: inherit;

  background: var(--bkp-surface);

  transition: .2s ease;

  text-align: left;
}


.post-card {
  position: relative;

  min-height: 295px;
}


.post-card:hover,
.course-card:hover {
  transform: translateY(-3px);

  border-color:
    rgba(255,197,54,.35);
}


.post-cover {
  height: 165px;

  background:
    linear-gradient(
      135deg,
      #1c526a,
      #0b2f41
    );

  background-size: cover;

  background-position: center;
}


.post-body,
.course-body {
  padding: 15px;
}


.post-category {
  display: inline-flex;

  margin-bottom: 9px;

  padding:
    5px 8px;

  border-radius: 5px;

  color: #04212c;

  background: #48d7e8;

  font-size: 9px;

  font-weight: 950;

  text-transform: uppercase;
}


.post-title,
.course-title {
  margin:
    0 0 7px;
}


.post-title {
  font-size: 17px;
}


.post-excerpt,
.course-description {
  color: var(--bkp-muted);

  font-size: 12px;

  line-height: 1.5;
}


.post-lock {
  position: absolute;

  right: 15px;

  bottom: 15px;

  padding:
    8px 10px;

  border-radius: 10px;

  color: white;

  background:
    rgba(3,18,27,.91);

  border:
    1px solid rgba(255,197,54,.3);

  font-size: 11px;

  font-weight: 900;
}


.course-cover {
  height: 145px;

  display: flex;

  align-items: flex-end;

  padding: 15px;

  background:
    linear-gradient(
      135deg,
      #16475d,
      #082635
    );

  background-size: cover;

  background-position: center;
}


.course-cover span {
  color: var(--bkp-accent);

  font-size: 10px;

  font-weight: 950;
}



/* =========================================================
   GENERIC PAGES
========================================================= */

.page-hero {
  padding:
    35px;

  margin-bottom: 22px;

  border-radius: 20px;

  background:
    linear-gradient(
      135deg,
      #0b3143,
      #071f2c
    );

  border:
    1px solid var(--bkp-border);
}


.page-hero h2 {
  margin:
    5px 0 10px;

  font-size:
    clamp(30px,4vw,48px);
}


.page-hero p {
  max-width: 760px;

  color: var(--bkp-muted);

  line-height: 1.6;
}


.toolbar {
  display: flex;

  flex-wrap: wrap;

  align-items: center;

  justify-content: space-between;

  gap: 12px;

  margin-bottom: 18px;
}


.toolbar-group {
  display: flex;

  flex-wrap: wrap;

  gap: 8px;
}


.filter-button {
  padding:
    8px 11px;

  border-radius: 999px;

  border:
    1px solid rgba(255,255,255,.12);

  color: #b8c8d0;

  background: transparent;
}


.filter-button.active {
  color: #071b26;

  background: var(--bkp-accent);
}


.panel {
  padding: 20px;

  margin-bottom: 16px;
}


.stats-grid {
  display: grid;

  grid-template-columns:
    repeat(4,minmax(0,1fr));

  gap: 14px;

  margin-bottom: 20px;
}


.stat-card {
  padding: 20px;

  border-radius: 15px;

  border:
    1px solid var(--bkp-border);

  background: var(--bkp-surface);
}


.stat-number {
  display: block;

  margin-bottom: 7px;

  color: var(--bkp-accent);

  font-size: 30px;

  font-weight: 950;
}


.list-row {
  display: grid;

  grid-template-columns:
    1fr auto;

  align-items: center;

  gap: 15px;

  padding:
    14px 0;

  border-bottom:
    1px solid rgba(255,255,255,.08);
}


.list-row:last-child {
  border-bottom: 0;
}


.row-actions {
  display: flex;

  gap: 7px;
}


.small-button {
  padding:
    7px 10px;

  border-radius: 8px;

  border:
    1px solid rgba(255,255,255,.13);

  color: white;

  background:
    rgba(255,255,255,.04);

  font-size: 11px;
}


.small-button.accent {
  color: #071b26;

  background: var(--bkp-accent);

  border-color: transparent;
}


.small-button.danger {
  color: #ff9999;
}


.loading-panel,
.empty-panel {
  padding: 35px;

  border-radius: 16px;

  border:
    1px solid var(--bkp-border);

  color: var(--bkp-muted);

  background: var(--bkp-surface);
}



/* =========================================================
   POST DETAIL
========================================================= */

.article {
  max-width: 920px;

  margin: 0 auto;
}


.article-cover {
  min-height: 430px;

  margin-bottom: 28px;

  border-radius: 20px;

  background:
    linear-gradient(
      135deg,
      #16475d,
      #082635
    );

  background-size: cover;

  background-position: center;
}


.article h1 {
  font-size:
    clamp(34px,5vw,58px);

  line-height: 1.04;
}


.article-lead {
  color: #c0d0d8;

  font-size: 18px;

  line-height: 1.65;
}


.article-content {
  margin-top: 30px;

  font-size: 17px;

  line-height: 1.8;
}


.article-content p {
  margin:
    0 0 22px;
}



/* =========================================================
   MEMBERSHIP
========================================================= */

.benefits-grid {
  display: grid;

  grid-template-columns:
    repeat(3,minmax(0,1fr));

  gap: 15px;
}


.benefit-card {
  padding: 22px;

  border-radius: 16px;

  border:
    1px solid var(--bkp-border);

  background: var(--bkp-surface);
}


.benefit-icon {
  margin-bottom: 15px;

  font-size: 30px;
}



/* =========================================================
   COURSE DETAIL
========================================================= */

.module-card {
  margin-bottom: 15px;

  padding: 20px;

  border-radius: 16px;

  border:
    1px solid var(--bkp-border);

  background: var(--bkp-surface);
}


.lesson-row {
  display: flex;

  align-items: center;

  justify-content: space-between;

  gap: 15px;

  padding:
    12px 0;

  border-top:
    1px solid rgba(255,255,255,.08);
}


.lesson-meta {
  color: var(--bkp-muted);

  font-size: 11px;
}



/* =========================================================
   FORMS
========================================================= */

.form-label {
  display: block;

  margin:
    14px 0 7px;

  color: #b9c8d0;

  font-size: 12px;

  font-weight: 800;
}


.form-input,
.form-textarea,
.form-select {
  width: 100%;

  padding:
    12px 13px;

  border-radius: 10px;

  border:
    1px solid rgba(255,255,255,.14);

  outline: none;

  color: white;

  background:
    rgba(0,0,0,.18);
}


.form-textarea {
  min-height: 180px;

  resize: vertical;
}


.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--bkp-accent);
}


.form-grid {
  display: grid;

  grid-template-columns:
    repeat(2,minmax(0,1fr));

  gap: 14px;
}


.form-error {
  margin-top: 14px;

  padding:
    10px 12px;

  border-radius: 9px;

  color: #ff9b9b;

  background:
    rgba(255,80,80,.12);
}


.form-actions {
  display: flex;

  justify-content: flex-end;

  gap: 9px;

  margin-top: 22px;
}



/* =========================================================
   MODALS
========================================================= */

.modal-root {
  position: fixed;

  inset: 0;

  z-index: 1000;

  display: flex;

  align-items: center;

  justify-content: center;

  padding: 20px;
}


.modal-backdrop {
  position: absolute;

  inset: 0;

  background:
    rgba(0,10,16,.82);

  backdrop-filter: blur(7px);
}


.auth-background {
  background-color:
    rgba(0,10,16,.86);

  background-image:
    linear-gradient(
      rgba(0,10,16,.65),
      rgba(0,10,16,.84)
    ),
    var(--login-background-image);

  background-size: cover;

  background-position: center;
}


.auth-box,
.dynamic-modal-box {
  position: relative;

  z-index: 2;

  border-radius: 22px;

  border:
    1px solid rgba(255,255,255,.14);

  background:
    linear-gradient(
      180deg,
      #0d3244,
      #061e2b
    );

  box-shadow:
    0 30px 90px rgba(0,0,0,.45);
}


.auth-box {
  width: min(440px,100%);

  padding: 36px;
}


.dynamic-modal-box {
  width: min(720px,95vw);

  max-height: 88vh;

  overflow-y: auto;

  padding: 26px;
}


.dynamic-modal-header {
  display: flex;

  align-items: center;

  justify-content: space-between;

  gap: 15px;

  margin-bottom: 18px;
}


.dynamic-modal-header h2 {
  margin: 0;
}


.modal-close {
  position: absolute;

  top: 12px;

  right: 16px;

  width: 38px;

  height: 38px;

  border: 0;

  color: #9caeb9;

  background: transparent;

  font-size: 27px;
}


.modal-close.static {
  position: static;
}


.auth-logo {
  width: 55px;

  height: 55px;

  display: flex;

  align-items: center;

  justify-content: center;

  margin-bottom: 22px;

  border-radius: 50%;

  color: #061e2b;

  background: var(--bkp-accent);

  font-weight: 950;
}


.auth-eyebrow,
.settings-eyebrow {
  color: var(--bkp-accent);

  font-size: 10px;

  font-weight: 900;

  letter-spacing: 1.4px;
}



/* =========================================================
   SETTINGS
========================================================= */

.settings-modal {
  position: fixed;

  inset: 0;

  z-index: 1200;

  display: flex;

  justify-content: flex-end;
}


.settings-panel {
  position: relative;

  z-index: 2;

  width: min(860px,94vw);

  height: 100vh;

  overflow-y: auto;

  padding: 30px;

  background: #061d29;

  border-left:
    1px solid rgba(255,255,255,.12);
}


.settings-header {
  display: flex;

  justify-content: space-between;

  gap: 20px;

  padding-bottom: 24px;

  border-bottom:
    1px solid rgba(255,255,255,.1);
}


.settings-header h2 {
  margin:
    6px 0;
}


.settings-section {
  padding:
    28px 0;

  border-bottom:
    1px solid rgba(255,255,255,.08);
}


.asset-grid {
  display: grid;

  grid-template-columns:
    repeat(2,minmax(0,1fr));

  gap: 14px;
}


.asset-editor {
  display: flex;

  align-items: center;

  gap: 14px;

  padding: 14px;

  border-radius: 13px;

  border:
    1px solid rgba(255,255,255,.1);

  background:
    rgba(255,255,255,.035);
}


.asset-editor.vertical {
  align-items: stretch;

  flex-direction: column;
}


.asset-preview {
  flex: 0 0 auto;

  display: flex;

  align-items: center;

  justify-content: center;

  overflow: hidden;

  border:
    1px solid rgba(255,255,255,.12);

  color: var(--bkp-accent);

  background: #0b3042;

  background-size: cover;

  background-position: center;

  font-size: 11px;

  font-weight: 950;
}


.asset-preview.square,
.asset-preview.round {
  width: 80px;
  height: 80px;
}


.asset-preview.square {
  border-radius: 14px;
}


.asset-preview.round {
  border-radius: 50%;
}


.asset-preview.favicon {
  width: 60px;
  height: 60px;

  border-radius: 11px;
}


.asset-preview.landscape {
  width: 100%;
  height: 140px;

  border-radius: 11px;
}


.color-grid {
  display: grid;

  grid-template-columns:
    repeat(3,minmax(0,1fr));

  gap: 12px;
}


.color-field {
  display: flex;

  align-items: center;

  gap: 12px;

  padding: 12px;

  border-radius: 11px;

  border:
    1px solid rgba(255,255,255,.1);

  background:
    rgba(255,255,255,.035);
}


.color-field input {
  width: 43px;
  height: 43px;

  border: 0;

  background: transparent;
}


.settings-actions {
  position: sticky;

  bottom: -30px;

  display: flex;

  align-items: center;

  justify-content: flex-end;

  gap: 10px;

  margin:
    0 -30px -30px;

  padding:
    18px 30px;

  border-top:
    1px solid rgba(255,255,255,.1);

  background:
    rgba(6,29,41,.97);
}


.success-message {
  margin-right: auto;

  color: #68dda9;

  font-size: 12px;
}



/* =========================================================
   FOOTER
========================================================= */

.site-footer {
  display: flex;

  justify-content: space-between;

  margin-top: 50px;

  padding:
    20px 0;

  border-top:
    1px solid rgba(255,255,255,.08);

  color: #708a99;

  font-size: 11px;
}



/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width:1180px) {

  .dashboard-grid {
    grid-template-columns: 1fr;
  }


  .dashboard-side {
    grid-template-columns:
      1fr 1fr;
  }


  .posts-grid {
    grid-template-columns:
      repeat(2,minmax(0,1fr));
  }


  .stats-grid {
    grid-template-columns:
      repeat(2,minmax(0,1fr));
  }

}


@media (max-width:780px) {

  .sidebar {
    width: 280px;

    transform:
      translateX(-100%);

    transition: .2s;

    box-shadow:
      20px 0 50px rgba(0,0,0,.35);
  }


  .sidebar.mobile-open {
    transform:
      translateX(0);
  }


  .app-main {
    margin-left: 0;

    padding: 15px;
  }


  .mobile-header {
    height: 54px;

    display: flex;

    align-items: center;

    gap: 10px;
  }


  .icon-button {
    border: 0;

    color: white;

    background: transparent;

    font-size: 20px;
  }


  .page-header {
    align-items: flex-start;
  }


  .page-title {
    font-size: 22px;
  }


  .header-actions {
    flex-wrap: wrap;

    justify-content: flex-end;
  }


  .header-button.secondary,
  .connection-badge {
    display: none;
  }


  .dashboard-side {
    grid-template-columns: 1fr;

    margin-top: 16px;
  }


  .hero-card {
    min-height: 470px;
  }


  .hero-content {
    width: 100%;

    padding:
      28px 22px;
  }


  .hero-title {
    font-size: 38px;
  }


  .posts-grid,
  .courses-grid,
  .benefits-grid,
  .stats-grid,
  .form-grid,
  .asset-grid,
  .color-grid {
    grid-template-columns: 1fr;
  }


  .settings-panel {
    width: 100%;

    padding: 20px;
  }

}

/* ==========================================================
   BKP SIDEBAR FOOTER FIX V7.3.15
   Supabase Online + Dang xuat cung mot hang
========================================================== */

.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}


/* day phan footer xuong cuoi sidebar */
.sidebar-bottom {
  margin-top: auto;

  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;

  gap: 8px;

  padding: 12px 13px 16px;

  width: 100%;
  box-sizing: border-box;
}


/* SUPABASE ONLINE */
#connectionBadge,
.connection-badge {
  width: auto !important;
  min-width: 0;

  margin: 0 !important;

  padding: 7px 10px;

  border-radius: 999px;

  display: flex;
  align-items: center;

  font-size: 10px;
  font-weight: 800;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;

  color: #55e7ae;

  background: rgba(0, 180, 130, 0.18);

  border: 1px solid rgba(0, 210, 150, 0.10);
}


/* LOGIN / LOGOUT BUTTON */
#sidebarLoginButton,
.sidebar-login-button {
  appearance: none;
  -webkit-appearance: none;

  width: auto !important;
  min-width: 82px;

  margin: 0 !important;

  padding: 7px 11px;

  border-radius: 999px;

  border: 1px solid rgba(255, 197, 54, 0.45);

  background: rgba(255, 197, 54, 0.08);

  color: #ffc536;

  font-family: inherit;
  font-size: 11px;
  font-weight: 850;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  gap: 5px;

  cursor: pointer;

  white-space: nowrap;

  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    transform 0.18s ease;
}


#sidebarLoginButton:hover,
.sidebar-login-button:hover {
  background: #ffc536;
  color: #041722;

  border-color: #ffc536;

  transform: translateY(-1px);
}


#sidebarLoginButton:active,
.sidebar-login-button:active {
  transform: translateY(0);
}


/* tren man hinh cuc hep moi cho xuong 2 hang */
@media (max-width: 330px) {

  .sidebar-bottom {
    grid-template-columns: 1fr;
  }

  #sidebarLoginButton,
  .sidebar-login-button {
    width: 100% !important;
  }

}

/* ==========================================================
   BKP MOBILE HEADER FIX V7.3.18
   Clean mobile topbar
========================================================== */

@media (max-width: 900px) {

  /* ========================================================
     TOPBAR
  ======================================================== */

  .topbar {
    position: sticky !important;
    top: 0 !important;
    z-index: 150 !important;

    width: 100% !important;
    min-height: 64px !important;

    margin: 0 !important;

    padding:
      max(10px, env(safe-area-inset-top))
      14px
      10px !important;

    box-sizing: border-box !important;

    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;

    gap: 10px !important;

    background: rgba(4, 23, 34, 0.96) !important;

    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);

    border-bottom:
      1px solid rgba(255,255,255,.06);
  }


  /* ========================================================
     LEFT SIDE
     ☰ + TITLE
  ======================================================== */

  .topbar-left {
    flex: 1 1 auto !important;
    min-width: 0 !important;

    display: flex !important;
    align-items: center !important;

    gap: 10px !important;

    margin: 0 !important;
    padding: 0 !important;
  }


  /* ========================================================
     HAMBURGER
  ======================================================== */

  #mobileMenuButton {
    display: inline-flex !important;

    width: 42px !important;
    height: 42px !important;

    min-width: 42px !important;
    min-height: 42px !important;

    max-width: 42px !important;
    max-height: 42px !important;

    flex: 0 0 42px !important;

    margin: 0 !important;
    padding: 0 !important;

    align-items: center !important;
    justify-content: center !important;

    border-radius: 12px !important;

    border:
      1px solid rgba(255,255,255,.13) !important;

    background:
      rgba(255,255,255,.035) !important;

    color: #f6f8fa !important;

    font-size: 20px !important;
    line-height: 1 !important;

    box-shadow: none !important;
  }


  /* ========================================================
     BACK / HOME
     Mobile bỏ để header không chật.
     Trong app vẫn dùng nút Quay lại ở logic khác khi cần.
  ======================================================== */

  #backButton,
  #homeButton {
    display: none !important;
  }


  /* ========================================================
     TITLE AREA
  ======================================================== */

  .page-heading {
    flex: 1 1 auto !important;
    min-width: 0 !important;

    margin: 0 !important;
    padding: 0 !important;
  }


  #pageTitle,
  .page-title {
    display: block !important;

    width: 100% !important;

    margin: 0 !important;
    padding: 0 !important;

    font-size: 20px !important;
    line-height: 1.15 !important;

    font-weight: 900 !important;

    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;

    color: #f6f8fa !important;
  }


  #pageSubtitle,
  .page-subtitle {
    display: none !important;
  }


  /* ========================================================
     RIGHT SIDE
  ======================================================== */

  .topbar-right {
    flex: 0 0 auto !important;

    display: flex !important;
    align-items: center !important;

    gap: 0 !important;

    margin: 0 !important;
    padding: 0 !important;
  }


  /* --------------------------------------------------------
     Mobile không cần nút Đăng xuất ở header.
     Đăng xuất đã có trong sidebar.
  -------------------------------------------------------- */

  #headerLoginButton {
    display: none !important;
  }


  /* ========================================================
     AVATAR
  ======================================================== */

  #userAvatar,
  .user-avatar {
    display: inline-flex !important;

    width: 42px !important;
    height: 42px !important;

    min-width: 42px !important;
    min-height: 42px !important;

    max-width: 42px !important;
    max-height: 42px !important;

    flex: 0 0 42px !important;

    margin: 0 !important;
    padding: 0 !important;

    align-items: center !important;
    justify-content: center !important;

    border-radius: 50% !important;

    border:
      2px solid #ffc536 !important;

    background:
      #0b2c3e !important;

    color:
      #ffffff !important;

    font-size: 11px !important;
    font-weight: 900 !important;

    line-height: 1 !important;

    overflow: hidden !important;

    box-shadow: none !important;
  }


  /* ========================================================
     CONTENT STARTS CLEANLY BELOW HEADER
  ======================================================== */

  .main-area {
    width: 100% !important;
    min-width: 0 !important;

    margin: 0 !important;
    padding: 0 !important;
  }


  #viewContainer,
  .view-container {
    width: 100% !important;

    margin: 0 !important;

    padding:
      16px
      14px
      max(26px, env(safe-area-inset-bottom))
      !important;

    box-sizing: border-box !important;
  }

}


/* ==========================================================
   SMALL MOBILE
========================================================== */

@media (max-width: 480px) {

  .topbar {
    min-height: 60px !important;

    padding-left: 10px !important;
    padding-right: 10px !important;
  }


  #mobileMenuButton {
    width: 40px !important;
    height: 40px !important;

    min-width: 40px !important;
    min-height: 40px !important;

    max-width: 40px !important;
    max-height: 40px !important;

    flex-basis: 40px !important;
  }


  #userAvatar,
  .user-avatar {
    width: 40px !important;
    height: 40px !important;

    min-width: 40px !important;
    min-height: 40px !important;

    max-width: 40px !important;
    max-height: 40px !important;

    flex-basis: 40px !important;
  }


  #pageTitle,
  .page-title {
    font-size: 19px !important;
  }

}


/* ==========================================================
   VERY SMALL MOBILE
========================================================== */

@media (max-width: 360px) {

  #pageTitle,
  .page-title {
    font-size: 17px !important;
  }

}

/* ==========================================================
   BKP DESKTOP LAYOUT FIX V7.3.19
   Fix sidebar che main content tren desktop
========================================================== */

@media (min-width: 901px) {

  /* ========================================================
     APP SHELL
     Sidebar chiem 258px that su
     Main chi dung phan con lai
  ======================================================== */

  .app-shell {
    display: grid !important;

    grid-template-columns:
      258px
      minmax(0, 1fr) !important;

    width: 100% !important;
    max-width: 100vw !important;

    min-height: 100vh !important;

    margin: 0 !important;
    padding: 0 !important;

    overflow-x: hidden !important;
  }


  /* ========================================================
     SIDEBAR
  ======================================================== */

  #sidebar,
  .sidebar {
    position: sticky !important;

    top: 0 !important;
    left: auto !important;

    width: 258px !important;
    min-width: 258px !important;
    max-width: 258px !important;

    height: 100vh !important;
    min-height: 100vh !important;

    transform: none !important;

    z-index: 100 !important;

    box-sizing: border-box !important;

    overflow-y: auto !important;
    overflow-x: hidden !important;

    box-shadow: none !important;
  }


  /* ========================================================
     MAIN AREA
  ======================================================== */

  .main-area {
    grid-column: 2 !important;

    width: auto !important;
    max-width: 100% !important;
    min-width: 0 !important;

    margin: 0 !important;
    margin-left: 0 !important;

    padding: 0 !important;

    box-sizing: border-box !important;

    overflow-x: hidden !important;
  }


  /* ========================================================
     HEADER
  ======================================================== */

  .topbar {
    width: 100% !important;
    max-width: 100% !important;

    margin: 0 !important;

    box-sizing: border-box !important;
  }


  /* ========================================================
     MAIN CONTENT
  ======================================================== */

  #viewContainer,
  .view-container {
    width: 100% !important;
    max-width: 100% !important;

    margin: 0 !important;

    box-sizing: border-box !important;

    overflow-x: hidden !important;
  }


  /* ========================================================
     MOBILE ELEMENTS MUST NOT AFFECT DESKTOP
  ======================================================== */

  #mobileMenuButton {
    display: none !important;
  }


  #bkp716MobileOverlay,
  .bkp716-mobile-overlay {
    display: none !important;

    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }


  /* ========================================================
     GENERAL GRID / CARD SAFETY
  ======================================================== */

  .stats-grid,
  .form-grid,
  .settings-media-grid {
    min-width: 0 !important;
  }


  .panel,
  .card,
  .hero-card {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }


  img,
  video {
    max-width: 100% !important;
  }

}


/* ==========================================================
   LARGE DESKTOP
========================================================== */

@media (min-width: 1400px) {

  .app-shell {
    grid-template-columns:
      258px
      minmax(0, 1fr) !important;
  }

}

/* ==========================================================
   BKP V7.3.22 STABLE NAVIGATION + MODAL FIX
   Canonical desktop/mobile header and lesson modal styles
========================================================== */

body.modal-open {
  overflow: hidden;
}

/* ---------- Modal shell compatibility ---------- */
.modal-root.modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
}

.modal-root.modal.hidden,
.settings-modal.modal.hidden {
  display: none !important;
}

#dynamicModal .dynamic-modal-box,
#dynamicModal .dynamic-modal-card {
  position: relative;
  z-index: 2;
  width: min(820px, 94vw);
  max-width: 820px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 26px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 20px;
  background: linear-gradient(180deg,#0d3244,#061e2b);
  box-shadow: 0 30px 90px rgba(0,0,0,.5);
}

#dynamicModal .dynamic-modal-header,
#dynamicModal .modal-header {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  padding-right: 44px;
}

#dynamicModal .modal-close {
  top: 8px;
  right: 8px;
}

/* ---------- Desktop top bar ---------- */
@media (min-width: 901px) {

  .topbar {
    width: 100% !important;
    min-height: 78px;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 18px;
    padding: 16px 28px !important;
    border-bottom: 1px solid rgba(255,255,255,.06);
    background: rgba(4,23,34,.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  .topbar-left {
    min-width: 0;
    flex: 1 1 auto;
    display: flex !important;
    align-items: center !important;
    gap: 10px;
  }

  .topbar-right {
    flex: 0 0 auto;
    display: flex !important;
    align-items: center !important;
    gap: 9px !important;
  }

  #backButton:not(.hidden) {
    width: auto !important;
    min-width: 148px;
    height: 42px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px;
    padding: 0 12px 0 8px !important;
    margin: 0 !important;
    flex: 0 0 auto !important;
    border: 1px solid rgba(255,197,54,.26) !important;
    border-radius: 13px !important;
    background: linear-gradient(135deg,rgba(255,197,54,.10),rgba(255,255,255,.025)) !important;
    color: var(--bkp-text) !important;
    box-shadow: none !important;
    transition: transform .16s ease,border-color .16s ease,background .16s ease;
  }

  #backButton:not(.hidden):hover {
    transform: translateX(-2px);
    border-color: rgba(255,197,54,.62) !important;
    background: rgba(255,197,54,.10) !important;
  }

  .back-button-arrow {
    width: 28px;
    height: 28px;
    min-width: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: var(--bkp-accent);
    color: #041722;
    font-size: 17px;
    font-weight: 950;
    line-height: 1;
  }

  .back-button-label {
    font-size: 11px;
    font-weight: 900;
    white-space: nowrap;
  }

  .back-button-destination {
    max-width: 118px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-left: 8px;
    border-left: 1px solid rgba(255,255,255,.12);
    color: var(--bkp-muted);
    font-size: 9px;
    font-weight: 750;
  }

  #homeButton {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    border: 1px solid rgba(255,255,255,.13) !important;
    border-radius: 12px !important;
    background: rgba(255,255,255,.035) !important;
    color: var(--bkp-text) !important;
    box-shadow: none !important;
  }
}

/* ---------- Mobile header: menu + back + title + avatar ---------- */
@media (max-width: 900px) {

  #backButton:not(.hidden) {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    max-width: 40px !important;
    max-height: 40px !important;
    flex: 0 0 40px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid rgba(255,197,54,.28) !important;
    border-radius: 12px !important;
    background: rgba(255,197,54,.07) !important;
    color: var(--bkp-accent) !important;
  }

  #backButton .back-button-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    background: transparent;
    color: var(--bkp-accent);
    font-size: 23px;
    line-height: 1;
  }

  #backButton .back-button-label,
  #backButton .back-button-destination {
    display: none !important;
  }

  #dynamicModal.modal-root.modal {
    align-items: flex-end;
    padding: 0;
  }

  #dynamicModal .dynamic-modal-box,
  #dynamicModal .dynamic-modal-card {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 92dvh !important;
    margin: 0 !important;
    padding: 20px 16px max(20px,env(safe-area-inset-bottom)) !important;
    border-radius: 22px 22px 0 0 !important;
  }
}

/* ---------- Lesson content ---------- */
.lesson-view-loading {
  min-height: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.lesson-section-title {
  margin-top: 28px;
  margin-bottom: 10px;
}

.lesson-text-block {
  color: var(--bkp-text);
  font-size: 14px;
  line-height: 1.75;
}

.lesson-media-section {
  margin-top: 18px;
}

.lesson-main-image {
  display: block;
  width: 100%;
  max-height: 440px;
  object-fit: contain;
  border-radius: 14px;
  background: #000;
}

.lesson-media-error {
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 15px;
  color: var(--bkp-muted);
  font-size: 11px;
}

.lesson-external-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.lesson-coach-note {
  margin-top: 28px;
  padding: 17px;
  border-radius: 13px;
  border: 1px solid rgba(255,197,54,.20);
  background: rgba(255,197,54,.06);
}


/* ==========================================================
   BKP ACADEMY V7.4.1 - MY ACADEMY / STUDENT DASHBOARD
========================================================== */

.bkp741-hero {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:22px;
  padding:24px;
  margin-bottom:18px;
  border-radius:18px;
  border:1px solid rgba(255,197,54,.20);
  background:linear-gradient(135deg,rgba(255,197,54,.075),rgba(11,44,62,.74));
}

.bkp741-hero h2 {
  margin:6px 0 8px;
  font-size:clamp(24px,3vw,36px);
  line-height:1.05;
}

.bkp741-hero p {
  margin:0;
  color:var(--bkp-muted);
  line-height:1.6;
}

.bkp741-membership-badge {
  display:inline-flex;
  align-items:center;
  min-height:34px;
  padding:0 12px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.13);
  background:rgba(255,255,255,.04);
  color:var(--bkp-muted);
  font-size:10px;
  font-weight:950;
  white-space:nowrap;
}

.bkp741-membership-badge.active {
  color:#5ee2aa;
  border-color:rgba(94,226,170,.30);
  background:rgba(94,226,170,.075);
}

.bkp741-stats {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:12px;
  margin-bottom:18px;
}

.bkp741-stat {
  min-width:0;
  padding:17px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.10);
  background:var(--bkp-surface);
}

.bkp741-stat strong {
  display:block;
  color:var(--bkp-accent);
  font-size:25px;
  line-height:1;
  margin-bottom:6px;
}

.bkp741-stat span {
  color:var(--bkp-muted);
  font-size:10px;
}

.bkp741-section-card {
  padding:20px;
  margin-bottom:18px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(11,44,62,.52);
}

.bkp741-section-card h3 {
  margin:4px 0 0;
  font-size:18px;
}

.bkp741-section-head {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:15px;
  margin-bottom:16px;
}

.bkp741-course-grid {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:13px;
}

.bkp741-course {
  min-width:0;
  padding:18px;
  border-radius:15px;
  border:1px solid rgba(255,197,54,.18);
  background:linear-gradient(145deg,rgba(255,197,54,.045),rgba(255,255,255,.02));
}

.bkp741-course h3 {
  margin:7px 0 12px;
  font-size:21px;
}

.bkp741-course-progress-copy {
  color:var(--bkp-muted);
  font-size:11px;
}

.bkp741-course-progress-copy strong {
  color:var(--bkp-text);
  font-size:16px;
}

.bkp741-progressbar {
  width:100%;
  height:9px;
  margin:10px 0 14px;
  overflow:hidden;
  border-radius:999px;
  background:rgba(255,255,255,.08);
}

.bkp741-progressbar > div {
  height:100%;
  border-radius:999px;
  background:var(--bkp-accent);
}

.bkp741-next {
  min-height:48px;
  margin-bottom:14px;
}

.bkp741-next span {
  display:block;
  color:var(--bkp-muted);
  font-size:8px;
  font-weight:900;
  letter-spacing:1px;
  margin-bottom:4px;
}

.bkp741-next strong {
  font-size:12px;
  line-height:1.45;
}

.bkp741-two-column {
  display:grid;
  grid-template-columns:1.2fr .8fr;
  gap:18px;
}

.bkp741-milestones {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
  margin-top:14px;
}

.bkp741-mile {
  display:flex;
  align-items:center;
  gap:10px;
  padding:12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.09);
  background:rgba(255,255,255,.025);
}

.bkp741-mile > span {
  width:34px;
  height:34px;
  flex:0 0 34px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:50%;
  border:1px solid rgba(255,197,54,.25);
  color:var(--bkp-accent);
  font-size:10px;
  font-weight:950;
}

.bkp741-mile.done {
  border-color:rgba(94,226,170,.22);
  background:rgba(94,226,170,.045);
}

.bkp741-mile.done > span {
  background:#5ee2aa;
  border-color:#5ee2aa;
  color:#041722;
}

.bkp741-mile strong,
.bkp741-mile small {
  display:block;
}

.bkp741-mile small {
  color:var(--bkp-muted);
  font-size:9px;
  margin-top:3px;
}

.bkp741-event {
  display:grid;
  gap:6px;
  margin:14px 0;
  padding:14px;
  border-radius:12px;
  border:1px solid rgba(255,197,54,.16);
  background:rgba(255,197,54,.04);
}

.bkp741-event span {
  color:var(--bkp-muted);
  font-size:11px;
}

.bkp741-account-actions {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.bkp741-profile-grid {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
}

.bkp741-profile-grid > div {
  min-width:0;
  padding:13px;
  border-radius:11px;
  border:1px solid rgba(255,255,255,.08);
  background:rgba(255,255,255,.025);
}

.bkp741-profile-grid span,
.bkp741-profile-grid strong {
  display:block;
}

.bkp741-profile-grid span {
  color:var(--bkp-muted);
  font-size:9px;
  margin-bottom:5px;
}

.bkp741-profile-grid strong {
  overflow:hidden;
  text-overflow:ellipsis;
  font-size:12px;
}

@media(max-width:900px) {
  .bkp741-hero {
    flex-direction:column;
    padding:18px;
  }

  .bkp741-stats {
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .bkp741-course-grid,
  .bkp741-two-column {
    grid-template-columns:1fr;
  }

  .bkp741-profile-grid {
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}

@media(max-width:560px) {
  .bkp741-section-card {
    padding:15px;
  }

  .bkp741-section-head {
    flex-direction:column;
  }

  .bkp741-account-actions {
    width:100%;
  }

  .bkp741-account-actions .button {
    flex:1 1 150px;
  }

  .bkp741-milestones,
  .bkp741-profile-grid {
    grid-template-columns:1fr;
  }
}
