:root {
  --app-bg: #edf2f8;
  --app-surface: #ffffff;
  --app-primary: #0b5cab;
  --app-primary-soft: #e9f2ff;
  --app-border: #d7e0ec;
  --app-text: #0f1f33;
  --app-muted: #5f6f83;
  --sidebar-width: 258px;
  --tabbar-height: 64px;
  --navbar-height: 60px;
  --z-sidebar: 1060;
  --z-overlay: 1050;
  --z-tabbar: 1040;
  --z-navbar: 1030;
}

/* Dropdowns should be hidden until Bootstrap adds `.show`. */
.dropdown-menu {
  display: none;
}

.dropdown-menu.show {
  display: block;
}

.app-main {
  padding: 1.15rem !important;
}

.app-surface {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 12px;
  box-shadow: 0 14px 34px -28px rgba(15, 31, 51, 0.42);
}

/* Notification UI */
.notification-bell {
  color: #5f6f83 !important;
}

.notification-bell:hover {
  color: #0f1f33 !important;
  background: #eef4ff;
}

.notification-badge {
  font-size: 0.63rem;
  padding: 0.22rem 0.4rem;
}

.notification-dropdown {
  width: min(420px, 92vw);
  border-radius: 14px;
  overflow: hidden;
}

.notification-dropdown-header {
  background: #f8fbff;
}

.notification-dropdown-list {
  max-height: 420px;
  overflow: auto;
}

.notification-item {
  border-left: 3px solid transparent;
}

.notification-item.notification-unread {
  background: #f5f9ff;
  border-left-color: #8db3df;
}

.notification-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e9f2ff;
  color: var(--app-primary);
}

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

.notification-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--app-primary);
  display: inline-block;
}

/* Default desktop shell */
@media (min-width: 992px) {
  body {
    overflow-x: hidden;
  }

  #sidebar-wrapper {
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 1000;
  }

  .mobile-tabbar {
    display: none !important;
  }
}

/* Mobile shell */
@media (max-width: 991.98px) {
  body {
    background-color: var(--app-bg) !important;
    padding-bottom: var(--tabbar-height) !important;
    overflow-x: hidden;
  }

  .navbar {
    min-height: var(--navbar-height);
    z-index: var(--z-navbar);
  }

  #sidebar-wrapper {
    position: fixed !important;
    top: 0;
    left: 0;
    height: 100vh !important;
    width: var(--sidebar-width) !important;
    z-index: var(--z-sidebar) !important;
    transform: translateX(-100%) !important;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1) !important;
    margin-left: 0 !important;
    background: #fcfdff !important;
    box-shadow: 14px 0 38px -18px rgba(15, 31, 51, 0.45) !important;
    border-right: 1px solid var(--app-border) !important;
  }

  #wrapper.drawer-open #sidebar-wrapper {
    transform: translateX(0) !important;
  }

  #wrapper.drawer-open::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: var(--z-overlay);
    background: rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(1px);
    animation: fadeIn 0.2s ease;
  }

  .mobile-tabbar {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--tabbar-height);
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid var(--app-border);
    z-index: var(--z-tabbar);
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom);
    backdrop-filter: blur(10px);
  }

  .mobile-tabbar a,
  .mobile-tabbar button {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #607186;
    text-decoration: none;
    font-size: 0.65rem;
    font-weight: 600;
    border: none;
    background: none;
    gap: 3px;
  }

  .mobile-tabbar a.active {
    color: var(--app-primary);
  }

  .mobile-tabbar i {
    font-size: 1.16rem;
  }

  main.container-fluid,
  .app-main {
    padding: 0.95rem !important;
  }

  .dropdown-menu {
    display: none;
    z-index: 2000 !important;
    background-color: #ffffff !important;
    box-shadow: 0 12px 28px -15px rgba(15, 31, 51, 0.45) !important;
    border: 1px solid var(--app-border) !important;
  }

  .dropdown-menu.show {
    display: block !important;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Hide scrollbar where needed without disabling scroll */
.custom-scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.custom-scrollbar-hide::-webkit-scrollbar {
  display: none;
}
