/**
 * DocClinic — Shell navigation (sidebar + top header)
 * Unified visual language for the admin layout.
 */

:root {
  --dc-shell-accent: #4f46e5;
  --dc-shell-accent-hover: #4338ca;
  --dc-shell-accent-soft: rgba(79, 70, 229, 0.14);
  --dc-shell-radius: 12px;
  --dc-shell-radius-sm: 10px;
  --dc-shell-header-h: 60px;
  --dc-shell-sidebar-w: 256px;
  --dc-shell-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
  --dc-shell-shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.12);
}

body.ui-theme-light {
  --dc-shell-header-bg: rgba(255, 255, 255, 0.92);
  --dc-shell-header-border: rgba(15, 23, 42, 0.08);
  --dc-shell-header-text: #1e293b;
  --dc-shell-sidebar-bg: linear-gradient(185deg, #1e293b 0%, #0f172a 55%, #0b1220 100%);
  --dc-shell-sidebar-border: rgba(255, 255, 255, 0.06);
  --dc-shell-sidebar-text: rgba(255, 255, 255, 0.72);
  --dc-shell-sidebar-text-active: #ffffff;
  --dc-shell-sidebar-hover: rgba(255, 255, 255, 0.08);
  --dc-shell-sidebar-active-bg: rgba(79, 70, 229, 0.22);
  --dc-shell-sidebar-title: rgba(255, 255, 255, 0.42);
  --dc-shell-toggler-bg: rgba(15, 23, 42, 0.06);
}

body.ui-theme-gray {
  --dc-shell-header-bg: rgba(247, 248, 250, 0.94);
  --dc-shell-header-border: #d7dde6;
  --dc-shell-header-text: #1f2a37;
  --dc-shell-sidebar-bg: linear-gradient(185deg, #334155 0%, #1e293b 100%);
  --dc-shell-sidebar-border: rgba(255, 255, 255, 0.08);
  --dc-shell-sidebar-text: rgba(255, 255, 255, 0.78);
  --dc-shell-sidebar-text-active: #ffffff;
  --dc-shell-sidebar-hover: rgba(255, 255, 255, 0.1);
  --dc-shell-sidebar-active-bg: rgba(99, 102, 241, 0.25);
  --dc-shell-sidebar-title: rgba(255, 255, 255, 0.45);
  --dc-shell-toggler-bg: rgba(15, 23, 42, 0.08);
}

body.ui-theme-dark {
  --dc-shell-header-bg: rgba(17, 24, 39, 0.94);
  --dc-shell-header-border: #24324a;
  --dc-shell-header-text: #e5e7eb;
  --dc-shell-sidebar-bg: linear-gradient(185deg, #111827 0%, #0b1220 100%);
  --dc-shell-sidebar-border: rgba(255, 255, 255, 0.06);
  --dc-shell-sidebar-text: rgba(255, 255, 255, 0.7);
  --dc-shell-sidebar-text-active: #ffffff;
  --dc-shell-sidebar-hover: rgba(255, 255, 255, 0.07);
  --dc-shell-sidebar-active-bg: rgba(99, 102, 241, 0.28);
  --dc-shell-sidebar-title: rgba(255, 255, 255, 0.38);
  --dc-shell-toggler-bg: rgba(255, 255, 255, 0.08);
}

.app-header.dc-shell-header {
  position: relative;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0;
  min-height: var(--dc-shell-header-h);
  height: var(--dc-shell-header-h);
  padding-inline: 0 !important;
  background: var(--dc-shell-header-bg) !important;
  border-bottom: 1px solid var(--dc-shell-header-border) !important;
  box-shadow: var(--dc-shell-shadow);
  backdrop-filter: blur(16px) saturate(1.25);
  -webkit-backdrop-filter: blur(16px) saturate(1.25);
  color: var(--dc-shell-header-text);
  z-index: 1030;
  overflow: visible;
  isolation: isolate;
}

.dc-shell-header-lead {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  align-self: stretch;
  flex: 1 1 auto;
  min-width: 0;
  gap: 0.85rem;
  padding-inline-start: max(0.35rem, env(safe-area-inset-right, 0.35rem));
  padding-inline-end: 0.5rem;
  overflow: hidden;
  height: 100%;
}

.dc-shell-header-lead .dc-shell-menu-toggle {
  flex: 0 0 auto;
  margin: 0 !important;
  position: relative;
  z-index: 12;
  pointer-events: auto;
}

.dc-shell-header-lead .dc-shell-header-brand {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  margin: 0 !important;
  margin-inline-start: 0.15rem !important;
  overflow: hidden;
  display: flex;
  align-items: center;
  position: static !important;
  inset: auto !important;
  width: auto !important;
  transform: none !important;
  z-index: 1;
  pointer-events: auto;
  height: 100%;
}

.dc-shell-header-lead .dc-shell-header-brand .dc-backpack-brand {
  max-width: 100%;
  min-width: 0;
}

.dc-shell-header-lead .dc-shell-header-brand .dc-backpack-brand__meta {
  min-width: 0;
  flex: 1 1 auto;
}

.dc-shell-header-lead .dc-shell-header-brand .dc-backpack-brand__title {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.app-header.dc-shell-header > .navbar-nav {
  align-items: center;
  min-height: var(--dc-shell-header-h);
  margin-inline-start: auto !important;
  margin-inline-end: 0.65rem !important;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  max-width: 100%;
}

.app-header.dc-shell-header::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(
    115deg,
    transparent 0%,
    rgba(79, 70, 229, 0.05) 28%,
    rgba(14, 165, 233, 0.07) 52%,
    rgba(99, 102, 241, 0.04) 72%,
    transparent 100%
  );
  background-size: 220% 100%;
  animation: dcHeaderShimmer 9s ease-in-out infinite;
}

.app-header.dc-shell-header::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  pointer-events: none;
  background: linear-gradient(90deg, #4f46e5, #6366f1, #0ea5e9, #818cf8, #4f46e5);
  background-size: 320% 100%;
  animation: dcHeaderAccentLine 7s linear infinite;
  opacity: 0.82;
}

@keyframes dcHeaderShimmer {
  0%,
  100% {
    background-position: 100% 0;
  }
  50% {
    background-position: 0% 0;
  }
}

@keyframes dcHeaderAccentLine {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 320% 50%;
  }
}

.app-header.dc-shell-header .navbar-brand,
.app-header.dc-shell-header .dc-shell-header-brand {
  padding-top: 0;
  padding-bottom: 0;
  position: static !important;
  left: auto !important;
  right: auto !important;
  width: auto !important;
  transition: transform 0.25s ease, filter 0.25s ease;
}

.app-header.dc-shell-header .dc-shell-header-brand .dc-backpack-brand {
  max-width: 100%;
}

.app-header.dc-shell-header .dc-shell-header-brand:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

/* ── Animated menu toggle (hamburger ↔ X) ── */
.app-header.dc-shell-header .dc-shell-menu-toggle {
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: var(--dc-shell-toggler-bg);
  color: var(--dc-shell-header-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  z-index: 12;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px var(--dc-shell-header-border);
  transition:
    background 0.25s ease,
    color 0.25s ease,
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.app-header.dc-shell-header .dc-shell-menu-toggle:hover {
  background: var(--dc-shell-accent-soft);
  color: var(--dc-shell-accent);
  transform: translateY(-1px);
  box-shadow:
    0 6px 18px rgba(79, 70, 229, 0.18),
    inset 0 0 0 1px rgba(79, 70, 229, 0.22);
}

.app-header.dc-shell-header .dc-shell-menu-toggle.is-active {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.18) 0%, rgba(14, 165, 233, 0.12) 100%);
  color: var(--dc-shell-accent);
  box-shadow:
    0 0 0 3px rgba(79, 70, 229, 0.12),
    inset 0 0 0 1px rgba(79, 70, 229, 0.28);
}

.app-header.dc-shell-header .dc-shell-menu-toggle .navbar-toggler-icon {
  display: none !important;
}

.dc-shell-menu-toggle__box {
  position: relative;
  display: block;
  width: 20px;
  height: 14px;
}

.dc-shell-menu-toggle__line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 99px;
  background: currentColor;
  transform-origin: center;
  transition:
    transform 0.32s cubic-bezier(0.68, -0.45, 0.27, 1.45),
    top 0.28s ease,
    opacity 0.2s ease,
    width 0.28s ease;
}

.dc-shell-menu-toggle__line:nth-child(1) {
  top: 0;
}

.dc-shell-menu-toggle__line:nth-child(2) {
  top: 6px;
}

.dc-shell-menu-toggle__line:nth-child(3) {
  top: 12px;
}

.dc-shell-menu-toggle.is-active .dc-shell-menu-toggle__line:nth-child(1) {
  top: 6px;
  transform: rotate(45deg);
}

.dc-shell-menu-toggle.is-active .dc-shell-menu-toggle__line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.dc-shell-menu-toggle.is-active .dc-shell-menu-toggle__line:nth-child(3) {
  top: 6px;
  transform: rotate(-45deg);
}

.app-header.dc-shell-header .navbar-toggler:not(.dc-shell-menu-toggle) {
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: var(--dc-shell-toggler-bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.app-header.dc-shell-header .navbar-toggler:not(.dc-shell-menu-toggle):hover {
  background: var(--dc-shell-accent-soft);
}

.app-header.dc-shell-header .navbar-toggler-icon {
  width: 1.15rem;
  height: 1.15rem;
}

.app-header.dc-shell-header .nav-link {
  color: var(--dc-shell-header-text) !important;
  border-radius: var(--dc-shell-radius-sm);
  transition:
    background 0.22s ease,
    color 0.22s ease,
    transform 0.22s ease,
    box-shadow 0.22s ease;
}

.app-header.dc-shell-header .navbar-nav.ml-auto > .nav-item > .nav-link:not(.notification-toggle) {
  width: 42px;
  height: 42px;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 3px;
  box-shadow: inset 0 0 0 1px transparent;
}

.app-header.dc-shell-header .navbar-nav.ml-auto > .nav-item > .nav-link:not(.notification-toggle):hover {
  background: var(--dc-shell-accent-soft);
  color: var(--dc-shell-accent) !important;
  transform: translateY(-2px);
  box-shadow:
    0 6px 16px rgba(79, 70, 229, 0.14),
    inset 0 0 0 1px rgba(79, 70, 229, 0.12);
}

.app-header.dc-shell-header .navbar-nav.ml-auto > .nav-item > .nav-link i.la {
  font-size: 1.35rem;
  line-height: 1;
}

.app-header.dc-shell-header .nav-item.dropdown.pr-4 > .nav-link {
  width: 42px !important;
  height: 42px !important;
  margin: 0 6px 0 10px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  overflow: hidden;
  box-shadow: 0 0 0 2px var(--dc-shell-header-bg), 0 0 0 3px var(--dc-shell-accent-soft);
}

.app-header.dc-shell-header .nav-item.dropdown.pr-4 > .nav-link .backpack-avatar-menu-container {
  background: linear-gradient(135deg, var(--dc-shell-accent) 0%, #6366f1 100%) !important;
  font-weight: 600 !important;
}

.app-header.dc-shell-header .dropdown-menu {
  border-radius: var(--dc-shell-radius);
  border: 1px solid var(--ui-border, #e6e9ef);
  box-shadow: var(--dc-shell-shadow-lg);
  padding: 0.35rem;
  margin-top: 8px;
}

.app-header.dc-shell-header .dropdown-item {
  border-radius: 8px;
  padding: 0.5rem 0.85rem;
  font-size: 0.9rem;
}

.app-header.dc-shell-header .dropdown-item.active {
  background: var(--dc-shell-accent-soft);
  color: var(--dc-shell-accent);
  font-weight: 600;
}

.app-header.dc-shell-header .dc-backpack-brand__title {
  color: var(--dc-shell-header-text);
}

/* ── Sidebar layout: CoreUI hides with -200px margin; we use 256px width ── */
.app-body .sidebar.dc-shell-sidebar {
  background: var(--dc-shell-sidebar-bg) !important;
  border-inline-end: 1px solid var(--dc-shell-sidebar-border) !important;
  flex: 0 0 var(--dc-shell-sidebar-w) !important;
  width: var(--dc-shell-sidebar-w) !important;
  min-width: var(--dc-shell-sidebar-w);
  max-width: var(--dc-shell-sidebar-w);
  padding-inline: 0 !important;
  overflow-x: hidden;
  transition: margin 0.22s ease, box-shadow 0.22s ease;
  z-index: 1019;
}

html[dir='rtl'] .app-body .sidebar.dc-shell-sidebar {
  margin-right: calc(-1 * var(--dc-shell-sidebar-w)) !important;
  margin-left: 0 !important;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.08);
}

html:not([dir='rtl']) .app-body .sidebar.dc-shell-sidebar {
  margin-left: calc(-1 * var(--dc-shell-sidebar-w)) !important;
  margin-right: 0 !important;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.08);
}

@media (min-width: 992px) {
  html[dir='rtl'] body.sidebar-lg-show .app-body .sidebar.dc-shell-sidebar,
  html[dir='rtl'] body.sidebar-show .app-body .sidebar.dc-shell-sidebar,
  html[dir='rtl'] body.sidebar-md-show .app-body .sidebar.dc-shell-sidebar,
  html[dir='rtl'] body.sidebar-sm-show .app-body .sidebar.dc-shell-sidebar {
    margin-right: 0 !important;
  }

  html:not([dir='rtl']) body.sidebar-lg-show .app-body .sidebar.dc-shell-sidebar,
  html:not([dir='rtl']) body.sidebar-show .app-body .sidebar.dc-shell-sidebar,
  html:not([dir='rtl']) body.sidebar-md-show .app-body .sidebar.dc-shell-sidebar,
  html:not([dir='rtl']) body.sidebar-sm-show .app-body .sidebar.dc-shell-sidebar {
    margin-left: 0 !important;
  }
}

@media (max-width: 991.98px) {
  html[dir='rtl'] .app-body .sidebar.dc-shell-sidebar {
    margin-right: calc(-1 * var(--dc-shell-sidebar-w)) !important;
    margin-left: 0 !important;
  }

  html:not([dir='rtl']) .app-body .sidebar.dc-shell-sidebar {
    margin-left: calc(-1 * var(--dc-shell-sidebar-w)) !important;
    margin-right: 0 !important;
  }

  html[dir='rtl'] body.sidebar-show .app-body .sidebar.dc-shell-sidebar {
    margin-right: 0 !important;
  }

  html:not([dir='rtl']) body.sidebar-show .app-body .sidebar.dc-shell-sidebar {
    margin-left: 0 !important;
  }
}

html[dir='rtl'] body:not(.sidebar-lg-show):not(.sidebar-show):not(.sidebar-md-show):not(.sidebar-sm-show) .app-body .sidebar.dc-shell-sidebar,
html:not([dir='rtl']) body:not(.sidebar-lg-show):not(.sidebar-show):not(.sidebar-md-show):not(.sidebar-sm-show) .app-body .sidebar.dc-shell-sidebar {
  box-shadow: none !important;
}

@media (min-width: 992px) {
  html[dir='rtl'] body.sidebar-lg-show.sidebar-fixed .main,
  html[dir='rtl'] body.sidebar-lg-show.sidebar-fixed .app-footer,
  html[dir='rtl'] body.sidebar-show.sidebar-fixed .main,
  html[dir='rtl'] body.sidebar-show.sidebar-fixed .app-footer {
    margin-right: var(--dc-shell-sidebar-w) !important;
  }

  html:not([dir='rtl']) body.sidebar-lg-show.sidebar-fixed .main,
  html:not([dir='rtl']) body.sidebar-lg-show.sidebar-fixed .app-footer,
  html:not([dir='rtl']) body.sidebar-show.sidebar-fixed .main,
  html:not([dir='rtl']) body.sidebar-show.sidebar-fixed .app-footer {
    margin-left: var(--dc-shell-sidebar-w) !important;
  }

  html[dir='rtl'] body:not(.sidebar-lg-show):not(.sidebar-show) .main,
  html[dir='rtl'] body:not(.sidebar-lg-show):not(.sidebar-show) .app-footer,
  html:not([dir='rtl']) body:not(.sidebar-lg-show):not(.sidebar-show) .main,
  html:not([dir='rtl']) body:not(.sidebar-lg-show):not(.sidebar-show) .app-footer {
    margin-inline-start: 0 !important;
    margin-inline-end: 0 !important;
  }
}

.app-body .main {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

/* CoreUI يثبت .sidebar-nav و .nav على 200px — يسبب فراغاً داخل عرض 256px */
.sidebar.dc-shell-sidebar .sidebar-nav,
.sidebar.dc-shell-sidebar .sidebar-nav > .nav,
.sidebar.dc-shell-sidebar .nav {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box;
}

.sidebar.dc-shell-sidebar .nav-item {
  width: 100%;
  max-width: 100%;
}

.sidebar.dc-shell-sidebar .nav-item.px-2 {
  padding-inline: 0.25rem !important;
}

.sidebar.dc-shell-sidebar .sidebar-nav {
  padding: 0.45rem 0.2rem 1rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

html[dir='rtl'] .sidebar.dc-shell-sidebar .sidebar-nav {
  padding: 0.45rem 0.15rem 1rem 0.2rem;
}

.sidebar.dc-shell-sidebar .sidebar-nav::-webkit-scrollbar {
  width: 6px;
}

.sidebar.dc-shell-sidebar .sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.22);
  border-radius: 99px;
}

.sidebar.dc-shell-sidebar .sidebar-nav > .nav {
  flex-direction: column;
  gap: 2px;
}

.sidebar.dc-shell-sidebar .nav-title {
  padding: 0.75rem 0.35rem 0.25rem;
  margin-top: 0.35rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dc-shell-sidebar-title) !important;
}

.sidebar.dc-shell-sidebar .nav-title:first-child {
  margin-top: 0;
  padding-top: 0.25rem;
}

.sidebar.dc-shell-sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  box-sizing: border-box;
  padding: 0.55rem 0.35rem !important;
  margin: 0 !important;
  border-radius: var(--dc-shell-radius-sm);
  color: var(--dc-shell-sidebar-text) !important;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.35;
  transition: background 0.15s ease, color 0.15s ease;
  position: relative;
}

.sidebar.dc-shell-sidebar .nav-link:hover {
  background: var(--dc-shell-sidebar-hover) !important;
  color: var(--dc-shell-sidebar-text-active) !important;
}

.sidebar.dc-shell-sidebar .nav-link.active {
  background: var(--dc-shell-sidebar-active-bg) !important;
  color: var(--dc-shell-sidebar-text-active) !important;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.sidebar.dc-shell-sidebar .nav-link.active::before {
  content: '';
  position: absolute;
  top: 8px;
  bottom: 8px;
  inset-inline-end: 0;
  width: 3px;
  border-radius: 4px 0 0 4px;
  background: linear-gradient(180deg, #818cf8 0%, var(--dc-shell-accent) 100%);
}

html[dir='ltr'] .sidebar.dc-shell-sidebar .nav-link.active::before {
  inset-inline-end: auto;
  inset-inline-start: 0;
  border-radius: 0 4px 4px 0;
}

.sidebar.dc-shell-sidebar .nav-icon {
  flex: 0 0 1.25rem;
  width: 1.25rem;
  font-size: 1.1rem !important;
  text-align: center;
  opacity: 0.88;
  margin: 0 !important;
}

.sidebar.dc-shell-sidebar .nav-link.active .nav-icon {
  opacity: 1;
  color: #a5b4fc;
}

.sidebar.dc-shell-sidebar .nav-link span {
  flex: 1;
  min-width: 0;
}

.sidebar.dc-shell-sidebar .nav-dropdown > .nav-link.nav-dropdown-toggle::after {
  margin-inline-start: auto;
  opacity: 0.55;
}

.sidebar.dc-shell-sidebar .nav-dropdown.open > .nav-link.nav-dropdown-toggle {
  background: var(--dc-shell-sidebar-hover) !important;
  color: var(--dc-shell-sidebar-text-active) !important;
}

.sidebar.dc-shell-sidebar .nav-dropdown-items {
  padding: 0.15rem 0 0.3rem;
  margin: 0 0.15rem 0.2rem;
  border-inline-start: 2px solid rgba(255, 255, 255, 0.1);
}

.sidebar.dc-shell-sidebar .nav-dropdown-items .nav-link {
  padding: 0.48rem 0.55rem !important;
  font-size: 0.86rem;
}

.sidebar.dc-shell-sidebar .dc-current-org-name {
  color: rgba(255, 255, 255, 0.92) !important;
  padding: 0 0.35rem;
}

.sidebar.dc-shell-sidebar .dc-backpack-brand__title {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  background: none !important;
  filter: none !important;
  animation: none !important;
}

.sidebar.dc-shell-sidebar .dc-backpack-brand__title::after {
  display: none !important;
}

.sidebar.dc-shell-sidebar .dc-backpack-brand__tagline {
  color: rgba(255, 255, 255, 0.55) !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

.sidebar.dc-shell-sidebar select.form-control,
.sidebar.dc-shell-sidebar .form-control {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
  color: #fff;
  border-radius: var(--dc-shell-radius-sm);
}

.sidebar.dc-shell-sidebar select.form-control option {
  color: #111;
  background: #fff;
}

.notification-wrapper {
  position: relative;
}

.notification-toggle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px !important;
  height: 40px !important;
  padding: 0 !important;
  border-radius: var(--dc-shell-radius-sm);
  transition: background 0.15s ease;
}

.notification-toggle:hover {
  background: var(--dc-shell-accent-soft);
  transform: translateY(-2px);
}

.notification-wrapper:has(.notification-badge) .notification-toggle {
  animation: dcBellPulse 2.4s ease-in-out infinite;
}

@keyframes dcBellPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.12);
  }
}

.notification-icon {
  font-size: 1.35rem !important;
  color: var(--dc-shell-header-text, #2f3c4f);
  line-height: 1;
}

.notification-badge {
  position: absolute;
  top: 4px;
  inset-inline-end: 2px;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #fff;
  border-radius: 50px;
  min-width: 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  padding: 0 5px;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.35);
  border: 2px solid var(--dc-shell-header-bg, #fff);
}

.notification-dropdown {
  width: min(380px, calc(100vw - 24px));
  border: 1px solid var(--ui-border, #e6e9ef) !important;
  border-radius: var(--dc-shell-radius) !important;
  overflow: hidden;
  box-shadow: var(--dc-shell-shadow-lg) !important;
  margin-top: 10px !important;
}

.notification-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--ui-bg-soft, #f8f9fb);
  border-bottom: 1px solid var(--ui-border, #edf0f5);
  font-weight: 800;
  font-size: 1rem;
  color: var(--ui-text, #3c4b64);
}

.notification-count {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #fff;
  border-radius: 50px;
  min-width: 22px;
  height: 22px;
  line-height: 22px;
  text-align: center;
  font-size: 11px;
  padding: 0 7px;
}

.notification-body {
  max-height: min(420px, 60vh);
  overflow-y: auto;
  background: var(--ui-card, #fff);
}

.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--ui-border, #f1f3f7);
  transition: background 0.15s ease;
  direction: rtl;
  text-align: right;
}

.notification-item:hover {
  background: var(--ui-bg-soft, #f9fafc);
  text-decoration: none;
}

.notification-item-icon {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--dc-shell-accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--dc-shell-accent);
  margin-top: 1px;
}

.notification-item-content {
  flex: 1;
  min-width: 0;
}

.notification-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ui-text, #222);
  margin-bottom: 3px;
  line-height: 1.45;
}

.notification-text {
  font-size: 0.84rem;
  color: var(--ui-text-muted, #6b778c);
  line-height: 1.65;
  word-break: break-word;
}

.notification-time {
  margin-top: 5px;
  font-size: 0.75rem;
  color: var(--ui-text-muted, #9aa4b2);
}

.notification-empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--ui-text-muted, #8a93a2);
  background: var(--ui-card, #fff);
}

.notification-footer {
  padding: 12px 16px;
  background: var(--ui-card, #fff);
  border-top: 1px solid var(--ui-border, #edf0f5);
}

.notification-footer a {
  color: var(--dc-shell-accent);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.88rem;
}

.notification-footer a:hover {
  text-decoration: underline;
  color: var(--dc-shell-accent-hover);
}

@media (min-width: 992px) {
  .app-body .main {
    padding-top: 0.5rem;
  }
}

@media (max-width: 991.98px) {
  :root {
    --dc-shell-header-h: 52px;
  }

  body.sidebar-show .app-body .sidebar.dc-shell-sidebar {
    z-index: 1020;
    box-shadow: var(--dc-shell-shadow-lg) !important;
  }

  body.sidebar-show .app-body .main::before {
    z-index: 1018;
  }

  .app-header.dc-shell-header {
    padding-inline-start: env(safe-area-inset-left, 0);
    padding-inline-end: env(safe-area-inset-right, 0);
  }

  .dc-shell-header-lead {
    gap: 0.75rem;
    padding-inline-start: max(0.25rem, env(safe-area-inset-right, 0.25rem));
    padding-inline-end: 0.35rem;
  }

  .app-header.dc-shell-header .dc-shell-menu-toggle {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .dc-shell-menu-toggle__box {
    width: 18px;
    height: 12px;
  }

  .dc-shell-menu-toggle__line:nth-child(2) {
    top: 5px;
  }

  .dc-shell-menu-toggle__line:nth-child(3) {
    top: 10px;
  }

  .dc-shell-menu-toggle.is-active .dc-shell-menu-toggle__line:nth-child(1),
  .dc-shell-menu-toggle.is-active .dc-shell-menu-toggle__line:nth-child(3) {
    top: 5px;
  }

  .app-header.dc-shell-header .dc-shell-header-brand .dc-backpack-brand__title {
    font-size: 0.84rem;
  }

  .app-header.dc-shell-header .dc-shell-header-brand:hover {
    transform: none;
    filter: none;
  }

  .app-header.dc-shell-header > .navbar-nav {
    margin-inline-end: max(0.35rem, env(safe-area-inset-left, 0.35rem)) !important;
  }

  .app-header.dc-shell-header .navbar-nav.ml-auto > .nav-item > .nav-link:not(.notification-toggle) {
    width: 36px;
    height: 36px;
    margin: 0 1px;
  }

  .app-header.dc-shell-header .navbar-nav.ml-auto > .nav-item > .nav-link i.la {
    font-size: 1.2rem;
  }

  .app-header.dc-shell-header .nav-item.dropdown.pr-4 > .nav-link {
    width: 36px !important;
    height: 36px !important;
    margin: 0 2px 0 4px !important;
  }

  .notification-toggle {
    width: 36px !important;
    height: 36px !important;
  }

  .notification-icon {
    font-size: 1.2rem !important;
  }

  .notification-dropdown {
    width: min(380px, calc(100vw - 16px));
    max-width: calc(100vw - 16px);
    inset-inline-end: 0 !important;
    inset-inline-start: auto !important;
    transform: none !important;
  }

  html[dir='rtl'] .notification-dropdown.dropdown-menu-right {
    right: 0 !important;
    left: auto !important;
  }

  .app-body .main {
    padding-top: 0.25rem;
  }
}

@media (max-width: 575.98px) {
  :root {
    --dc-shell-header-h: 48px;
  }

  .dc-shell-header-lead {
    gap: 0.6rem;
    padding-inline-start: max(0.2rem, env(safe-area-inset-right, 0.2rem));
  }

  .dc-shell-header-lead .dc-shell-header-brand {
    margin-inline-start: 0.2rem !important;
  }

  .app-header.dc-shell-header .dc-shell-menu-toggle {
    width: 36px;
    height: 36px;
    border-radius: 9px;
  }

  .app-header.dc-shell-header .dc-shell-header-brand .dc-backpack-brand__title {
    font-size: 0.78rem;
    letter-spacing: 0;
  }

  .app-header.dc-shell-header .navbar-nav.ml-auto > .nav-item > .nav-link:not(.notification-toggle),
  .notification-toggle,
  .app-header.dc-shell-header .nav-item.dropdown.pr-4 > .nav-link {
    width: 34px !important;
    height: 34px !important;
  }

  .app-header.dc-shell-header .navbar-nav.ml-auto > .nav-item > .nav-link i.la,
  .notification-icon {
    font-size: 1.1rem !important;
  }

  .notification-badge {
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    font-size: 9px;
    top: 2px;
    inset-inline-end: 0;
  }

  .app-header.dc-shell-header .dropdown-menu.dropdown-menu-right {
    width: min(220px, calc(100vw - 20px));
  }
}

@media (max-width: 399.98px) {
  .app-header.dc-shell-header .dc-shell-header-brand .dc-backpack-brand__title {
    font-size: 0.72rem;
  }

  .app-header.dc-shell-header .navbar-nav.ml-auto > .nav-item > .nav-link:not(.notification-toggle),
  .notification-toggle,
  .app-header.dc-shell-header .nav-item.dropdown.pr-4 > .nav-link {
    width: 32px !important;
    height: 32px !important;
    margin: 0 !important;
  }

  .app-header.dc-shell-header .navbar-nav.ml-auto > .nav-item > .nav-link i.la,
  .notification-icon {
    font-size: 1rem !important;
  }
}

@media (hover: none) {
  .app-header.dc-shell-header .nav-link:hover,
  .app-header.dc-shell-header .dc-shell-menu-toggle:hover,
  .notification-toggle:hover {
    transform: none;
  }
}

.sidebar.dc-shell-sidebar.bg-light,
.app-header.dc-shell-header.bg-light {
  background: unset !important;
}

@media (prefers-reduced-motion: reduce) {
  .app-header.dc-shell-header::before,
  .app-header.dc-shell-header::after,
  .notification-wrapper:has(.notification-badge) .notification-toggle {
    animation: none !important;
  }

  .dc-shell-menu-toggle__line,
  .app-header.dc-shell-header .nav-link,
  .app-header.dc-shell-header .dc-shell-menu-toggle,
  .app-header.dc-shell-header .dc-shell-header-brand {
    transition-duration: 0.01ms !important;
  }
}
