html, body, * {
  font-family: 'IBM Plex Sans Thai', sans-serif;
}

.fw-bold,
b,
strong {
  font-weight: 600 !important;
}

html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}
/*
body {
  margin-bottom: 60px;
}
*/
.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

.user-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid #dee2e6;
  border-radius: 999px;
  padding: 0.25rem 0.5rem 0.25rem 0.25rem;
  background-color: #fff;
}

.user-menu-trigger:hover {
  background-color: #f8f9fa;
}

.user-avatar-badge {
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
  color: #fff;
  background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
}

.user-menu-chevron {
  font-size: 0.75rem;
  color: #6c757d;
}

.user-menu-dropdown {
  min-width: 14rem;
}

.app-shell {
  margin: 0;
  background: #eef1f6;
  color: #1f2937;
  --sidebar-width: 270px;
}

.app-layout {
  position: relative;
  min-height: 100vh;
  display: flex;
  width: 100%;
}

.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  height: 100vh;
  flex-shrink: 0;
  background: linear-gradient(180deg, #0f172a 0%, #111827 100%);
  color: #e5e7eb;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  transition: width 0.25s ease, transform 0.25s ease;
  overflow: visible;
}

.sidebar-toggle-btn {
  position: absolute;
  top: 2rem;
  left: 270px;
  transform: translate(-50%, -50%);
  z-index: 200;
  width: 2.15rem;
  height: 2.15rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  background: #1e293b;
  color: #e5e7eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 2px 0 8px rgba(15, 23, 42, 0.3);
  transition: background-color 0.2s ease, color 0.2s ease, left 0.25s ease;
}

.sidebar-toggle-btn:hover {
  background: #2d3f55;
  color: #fff;
}

.sidebar-toggle-btn i {
  transition: transform 0.25s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  padding: 1.25rem 1rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.9rem 0.9rem 0.35rem;
}

.sidebar-logo {
  width: 46px;
  height: 46px;
  object-fit: contain;
  border-radius: 0.55rem;
  background: #ffffff;
  padding: 0.28rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 0.9rem 0.6rem;
  gap: 0.35rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: #e5e7eb;
  text-decoration: none;
  padding: 0.65rem 0.7rem;
  border-radius: 0.65rem;
  font-weight: 600;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.sidebar-link-button {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.sidebar-link.active {
  background: #2563eb;
  color: #fff;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}

.sidebar-link i {
  width: 1rem;
  text-align: center;
}

.sidebar-icon-badge-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
}

.sidebar-notification-badge {
  position: absolute;
  top: -0.55rem;
  right: -0.85rem;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.15rem;
  text-align: center;
  box-shadow: 0 0 0 2px #111827;
}

.sidebar-notification-menu {
  width: 260px;
  max-height: 330px;
  overflow-y: auto;
  border: 1px solid rgba(15, 23, 42, 0.12);
}

.sidebar-notification-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.8rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
}

.sidebar-notification-item {
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
}

.sidebar-notification-empty {
  padding: 0.45rem 0.8rem;
  color: #64748b;
  font-size: 0.8rem;
}

.app-shell.sidebar-collapsed .sidebar-toggle-btn {
  left: 92px;
}

.app-shell.sidebar-collapsed {
  --sidebar-width: 92px;
}

.app-shell.sidebar-collapsed .app-sidebar {
  width: 92px;
}

.app-shell.sidebar-collapsed .sidebar-brand {
  justify-content: center;
}

.app-shell.sidebar-collapsed .sidebar-logo-wrap {
  padding-top: 0.8rem;
  padding-bottom: 0.2rem;
}

.app-shell.sidebar-collapsed .sidebar-logo {
  width: 38px;
  height: 38px;
}

.app-shell.sidebar-collapsed .sidebar-brand span,
.app-shell.sidebar-collapsed .sidebar-link .sidebar-link-label,
.app-shell.sidebar-collapsed .user-menu-label,
.app-shell.sidebar-collapsed .user-menu-chevron {
  display: none;
}

.app-shell.sidebar-collapsed .sidebar-link {
  justify-content: center;
  padding-left: 0.6rem;
  padding-right: 0.6rem;
}

.app-shell.sidebar-collapsed .sidebar-link i,
.app-shell.sidebar-collapsed .sidebar-brand i {
  width: auto;
  margin: 0;
}

.app-shell.sidebar-collapsed .sidebar-user-section {
  padding-left: 0.7rem;
  padding-right: 0.7rem;
}

.app-shell.sidebar-collapsed .user-menu-trigger {
  justify-content: center;
  padding-right: 0.35rem;
}

.app-shell.sidebar-collapsed .sidebar-toggle-btn i {
  transform: rotate(180deg);
}

.sidebar-user-section {
  margin-top: auto;
  padding: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.app-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  margin-left: var(--sidebar-width);
  padding: 1rem;
  overflow: hidden;
  transition: margin-left 0.25s ease;
}

.content-surface {
  flex: 1;
  background: #fff;
  border-radius: 0.8rem;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
  padding: 0.8rem;
  min-height: 0;
}

.user-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 0.35rem 0.6rem 0.35rem 0.35rem;
  background-color: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.user-menu-trigger:hover {
  background-color: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.user-menu-label {
  font-weight: 600;
}

.user-menu-chevron {
  font-size: 0.75rem;
  color: #cbd5e1;
}

.user-menu-dropdown {
  min-width: 14rem;
}

@media (max-width: 991.98px) {
  .app-shell {
    --sidebar-width: 100%;
  }

  .app-layout {
    flex-direction: column;
  }

  .app-sidebar {
    position: relative;
    inset: auto;
    width: 100%;
    height: auto;
  }

  .sidebar-toggle-btn {
    display: none;
  }

  .app-content {
    height: auto;
    margin-left: 0;
    overflow: visible;
  }

  .content-surface {
    overflow: visible !important;
  }

  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .sidebar-link {
    flex: 1 1 calc(50% - 0.35rem);
    justify-content: center;
  }

  .content-surface {
    padding: 0.5rem;
  }

  .app-shell.sidebar-collapsed .app-sidebar {
    width: 100%;
  }

  .app-shell.sidebar-collapsed .sidebar-brand span,
  .app-shell.sidebar-collapsed .sidebar-link span,
  .app-shell.sidebar-collapsed .user-menu-label,
  .app-shell.sidebar-collapsed .user-menu-chevron {
    display: inline;
  }

}
