:root {
  --dl-brand: #06c755;
  --dl-brand-dark: #05a345;
  --dl-ink: #17212b;
  --dl-muted: #687385;
  --dl-bg: #f4f7f6;
  --dl-card-radius: 18px;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--dl-bg);
  color: var(--dl-ink);
  font-family: "PingFang TC", "Microsoft JhengHei", system-ui, -apple-system, "Segoe UI", sans-serif;
}

a {
  text-underline-offset: 0.18em;
}

.dl-app-nav,
.dashboard-nav,
.billing-nav,
.admin-nav {
  background: #1e272e;
}

.dl-card,
.course-card,
.order-card,
.user-card,
.card-custom,
.apply-card,
.metric-card,
.panel {
  border: 0;
  border-radius: var(--dl-card-radius);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

.btn,
.form-control,
.form-select,
.dropdown-menu,
.modal-content,
.offcanvas {
  border-radius: 0.85rem;
}

.btn.rounded-pill {
  border-radius: 50rem;
}

.table {
  --bs-table-bg: transparent;
}

.table > :not(caption) > * > * {
  padding: 0.9rem 1rem;
}

.dl-responsive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 1rem;
}

.dl-page-shell {
  width: min(100% - 1.5rem, 1180px);
  margin-inline: auto;
}

.dl-sticky-actions {
  position: sticky;
  bottom: 0;
  z-index: 10;
  padding: 0.75rem;
  background: rgba(244, 247, 246, 0.9);
  backdrop-filter: blur(10px);
}

.text-truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dl-has-global-nav {
  padding-bottom: 5.25rem;
}

.dl-global-nav {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  z-index: 1080;
  width: min(1120px, calc(100% - 1.5rem));
  transform: translateX(-50%);
  pointer-events: none;
}

.dl-global-nav__inner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem;
  color: #fff;
  background: rgba(23, 33, 43, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1.15rem;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.28);
  pointer-events: auto;
  backdrop-filter: blur(16px);
}

.dl-global-nav__brand,
.dl-global-nav__link,
.dl-notify__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.65rem;
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  border: 0;
  border-radius: 0.85rem;
  background: transparent;
}

.dl-global-nav__brand {
  flex: 0 0 auto;
  padding: 0 0.8rem;
  color: #fff;
  font-weight: 800;
}

.dl-global-nav__brand i {
  color: var(--dl-brand);
}

.dl-global-nav__links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
  flex: 1 1 auto;
  overflow-x: auto;
  scrollbar-width: none;
}

.dl-global-nav__links::-webkit-scrollbar {
  display: none;
}

.dl-global-nav__link {
  flex: 0 0 auto;
  padding: 0 0.75rem;
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

.dl-global-nav__link:hover,
.dl-global-nav__link.is-active,
.dl-notify__button:hover,
.dl-notify__button[aria-expanded="true"] {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.dl-global-nav__language {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.78rem;
  white-space: nowrap;
}

.dl-global-nav__language select {
  min-height: 2.3rem;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 0.75rem;
  padding: 0 0.55rem;
}

.dl-global-nav__language option {
  color: #111827;
}

.dl-notify {
  position: relative;
  flex: 0 0 auto;
}

.dl-notify__button {
  position: relative;
  width: 2.65rem;
  cursor: pointer;
}

.dl-notify__badge {
  position: absolute;
  top: 0.15rem;
  right: 0.15rem;
  min-width: 1.05rem;
  height: 1.05rem;
  padding: 0 0.25rem;
  color: #fff;
  background: #dc3545;
  border-radius: 999px;
  font-size: 0.68rem;
  line-height: 1.05rem;
  font-weight: 800;
}

.dl-notify__panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.7rem);
  width: min(380px, calc(100vw - 2rem));
  overflow: hidden;
  color: var(--dl-ink);
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 22px 55px rgba(15, 23, 42, 0.28);
}

.dl-notify__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid #edf1f4;
}

.dl-notify__mark-all {
  border: 0;
  color: var(--dl-brand-dark);
  background: transparent;
  font-size: 0.8rem;
  font-weight: 800;
}

.dl-notify__list {
  max-height: 430px;
  overflow: auto;
}

.dl-notify__item {
  position: relative;
  display: flex;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  color: var(--dl-ink);
  text-decoration: none;
  border-bottom: 1px solid #f1f3f5;
  background: #f8faf9;
}

.dl-notify__item.is-read {
  background: #fff;
}

.dl-notify__item:hover {
  background: #eef9f2;
}

.dl-notify__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  flex: 0 0 2rem;
  color: var(--dl-brand-dark);
  background: rgba(6, 199, 85, 0.1);
  border-radius: 0.7rem;
}

.dl-notify__text {
  min-width: 0;
  flex: 1 1 auto;
}

.dl-notify__text strong {
  display: block;
  color: var(--dl-ink);
  font-size: 0.88rem;
  line-height: 1.35;
}

.dl-notify__text small {
  display: block;
  margin-top: 0.25rem;
  color: var(--dl-muted);
}

.dl-notify__dot {
  width: 0.55rem;
  height: 0.55rem;
  flex: 0 0 0.55rem;
  margin-top: 0.35rem;
  background: #dc3545;
  border-radius: 999px;
}

.dl-notify__empty {
  padding: 1.25rem;
  color: var(--dl-muted);
  text-align: center;
  font-size: 0.9rem;
}

@media (max-width: 575.98px) {
  .dl-has-global-nav {
    padding-bottom: 5.9rem;
  }

  .dl-global-nav {
    bottom: 0;
    width: 100%;
  }

  .dl-global-nav__inner {
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 1.15rem 1.15rem 0 0;
    padding: 0.45rem 0.5rem max(0.45rem, env(safe-area-inset-bottom));
  }

  .dl-global-nav__brand {
    width: 2.7rem;
    padding: 0;
  }

  .dl-global-nav__brand span,
  .dl-global-nav__language span,
  .dl-global-nav__link:nth-child(n+6) {
    display: none;
  }

  .dl-global-nav__link {
    min-width: 3.15rem;
    flex-direction: column;
    gap: 0.18rem;
    padding: 0.25rem 0.3rem;
    font-size: 0.68rem;
    line-height: 1.1;
  }

  .dl-global-nav__link i {
    font-size: 1.08rem;
  }

  .dl-global-nav__language select {
    width: 4.2rem;
    min-height: 2.45rem;
    font-size: 0.75rem;
  }

  .dl-notify__panel {
    position: fixed;
    right: 0.75rem;
    bottom: 5rem;
    width: calc(100vw - 1.5rem);
  }

  .container,
  .container-fluid {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  h1,
  .h1 {
    font-size: 1.75rem;
  }

  h2,
  .h2 {
    font-size: 1.45rem;
  }

  .table-responsive {
    border-radius: var(--dl-card-radius);
  }

  .btn-lg {
    --bs-btn-padding-y: 0.7rem;
    --bs-btn-font-size: 1rem;
  }
}

@media (min-width: 768px) and (max-width: 1199.98px) {
  .dl-page-shell {
    width: min(100% - 2rem, 980px);
  }
}

/* Unified top app shell. These rules intentionally override the older bottom floating nav. */
body.dl-has-global-nav {
  padding-top: 4.25rem;
  padding-bottom: 0;
}

body.dl-has-global-nav > nav:not(#dl-global-nav),
body.dl-has-global-nav > .navbar:not(#dl-global-nav),
body.dl-has-global-nav .top-navbar {
  display: none !important;
}

.dl-global-nav {
  position: fixed;
  top: 0;
  right: 0;
  bottom: auto;
  left: 0;
  z-index: 1080;
  width: 100%;
  transform: none;
  pointer-events: auto;
  background: rgba(23, 33, 43, 0.96);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(16px);
}

.dl-global-nav__bar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: min(100% - 1.25rem, 1220px);
  min-height: 4.25rem;
  margin-inline: auto;
  min-width: 0;
}

.dl-icon-button,
.dl-menu-toggle,
.dl-menu-close,
.dl-notify__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.55rem;
  height: 2.55rem;
  color: rgba(255, 255, 255, 0.86);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.8rem;
}

.dl-icon-button:hover,
.dl-menu-toggle:hover,
.dl-menu-close:hover,
.dl-notify__button:hover,
.dl-notify__button[aria-expanded="true"] {
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
}

.dl-global-nav__brand {
  min-height: 2.65rem;
  color: #fff;
  text-decoration: none;
  font-weight: 900;
  white-space: nowrap;
  min-width: 0;
}

.dl-global-nav__links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
  flex: 1 1 auto;
  overflow-x: auto;
  scrollbar-width: none;
}

.dl-global-nav__link {
  min-height: 2.55rem;
  padding: 0 0.75rem;
  color: rgba(255, 255, 255, 0.76);
  border-radius: 0.8rem;
  text-decoration: none;
  flex: 0 0 auto;
}

.dl-global-nav__link:hover,
.dl-global-nav__link.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.dl-global-nav__language {
  flex: 0 0 auto;
  min-width: 0;
}

.dl-global-nav__language select {
  min-height: 2.45rem;
  max-width: 6rem;
}

.dl-menu-backdrop {
  position: fixed;
  inset: 0;
  top: 4.25rem;
  z-index: 1078;
  background: rgba(15, 23, 42, 0.45);
}

.dl-menu-panel {
  position: fixed;
  top: 4.75rem;
  left: max(0.75rem, calc((100vw - 1220px) / 2 + 0.625rem));
  z-index: 1079;
  width: min(680px, calc(100vw - 1.5rem));
  max-height: calc(100vh - 5.5rem);
  overflow: auto;
  padding: 1rem;
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.25);
}

.dl-menu__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #eef2f6;
}

.dl-menu__head strong {
  font-size: 1.05rem;
}

.dl-menu__head .dl-icon-button {
  color: var(--dl-ink);
  background: #f3f6f7;
  border-color: #e7ecef;
}

.dl-menu__section {
  padding-top: 1rem;
}

.dl-menu__section h3 {
  margin: 0 0 0.6rem;
  color: var(--dl-muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.dl-menu__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.55rem;
}

.dl-menu__item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 3.25rem;
  padding: 0.75rem;
  color: var(--dl-ink);
  background: #f8faf9;
  border: 1px solid #eef2f6;
  border-radius: 0.8rem;
  text-decoration: none;
  font-weight: 800;
}

.dl-menu__item:hover,
.dl-menu__item.is-active {
  color: var(--dl-brand-dark);
  background: rgba(6, 199, 85, 0.09);
  border-color: rgba(6, 199, 85, 0.22);
}

.dl-menu__item i {
  color: var(--dl-brand-dark);
}

.dl-notify__panel {
  top: calc(100% + 0.65rem);
  right: 0;
  bottom: auto;
}

body.dl-menu-open {
  overflow: hidden;
}

@media (max-width: 1199.98px) {
  .dl-global-nav__bar {
    width: 100%;
    padding: 0 0.75rem;
  }

  .dl-global-nav__links {
    display: none;
  }

  .dl-global-nav__brand {
    flex: 1 1 auto;
  }

  .dl-global-nav__language span {
    display: none;
  }

  .dl-global-nav__language select {
    width: 4.7rem;
    font-size: 0.78rem;
  }
}

@media (min-width: 1200px) {
  .dl-menu-toggle {
    flex: 0 0 auto;
  }

  .dl-global-nav__brand {
    flex: 0 0 auto;
  }

  .dl-global-nav__link span {
    max-width: 8rem;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (max-width: 767.98px) {
  body.dl-has-global-nav {
    padding-top: 4rem;
    padding-bottom: 0;
  }

  .dl-global-nav {
    bottom: auto;
    width: 100%;
  }

  .dl-global-nav__bar {
    width: 100%;
    min-height: 4rem;
    padding: 0 0.75rem;
  }

  .dl-global-nav__brand span {
    display: inline;
  }

  .dl-global-nav__links {
    display: none;
  }

  .dl-global-nav__language span {
    display: none;
  }

  .dl-global-nav__language select {
    width: 4.2rem;
    font-size: 0.75rem;
  }

  .dl-menu-backdrop {
    top: 4rem;
  }

  .dl-menu-panel {
    top: 4rem;
    left: 0;
    width: min(92vw, 380px);
    max-height: calc(100vh - 4rem);
    border-radius: 0 1rem 1rem 0;
  }

  .dl-menu__grid {
    grid-template-columns: 1fr;
  }

  .dl-notify__panel {
    position: fixed;
    top: 4.35rem;
    right: 0.75rem;
    bottom: auto;
    width: calc(100vw - 1.5rem);
  }
}
