body .sidebar:not(.is-collapsed) {
  border: 1px solid #ffffff14;
  border-radius: 20px;
  background:
    radial-gradient(ellipse at 0 0, #345fc752, transparent 55%),
    linear-gradient(175deg, #122b60, #0b1d40 85%);
  box-shadow: 0 16px 48px #10244824;
}

body .sidebar:not(.is-collapsed) .brand-block {
  padding: 6px 0 26px;
  border-bottom-color: #ffffff14;
}

body .sidebar:not(.is-collapsed) .nav-links {
  gap: 8px;
}

body .sidebar:not(.is-collapsed) .nav-link {
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: #c7d5ec;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: none;
}

body .sidebar:not(.is-collapsed) .nav-link:hover {
  background: #ffffff0d;
  border-color: #ffffff0f;
  color: #ffffff;
  animation: none;
}

body .sidebar:not(.is-collapsed) .nav-link.active {
  border-color: #8eb5ff38;
  background: linear-gradient(110deg, #3466cf70, #3466cf30);
  color: #ffffff;
  box-shadow: inset 3px 0 0 #82aeff;
}

body .sidebar:not(.is-collapsed) .nav-link::before {
  opacity: 0.8;
}

body .sidebar:not(.is-collapsed) .nav-group[open] > summary {
  background: #ffffff0a;
  color: #ffffff;
}

body .sidebar:not(.is-collapsed) .nav-submenu {
  width: auto;
  margin: 8px 0 8px 26px;
  padding: 0 0 0 10px;
  border-left: 1px solid #ffffff24;
  gap: 4px;
}

body .sidebar:not(.is-collapsed) .nav-submenu-link {
  min-height: 40px;
  padding-left: 14px;
  white-space: normal;
  line-height: 1.4;
  font-size: 0.8rem;
}

body .sidebar:not(.is-collapsed) .sidebar-logout-button {
  min-height: 46px;
  border: 1px solid #ffffff18;
  border-radius: 12px;
  background: #ffffff05;
  color: #c7d5ec;
  font-weight: 600;
}

body .sidebar:not(.is-collapsed) .sidebar-logout-button:hover {
  background: #ffffff0d;
  border-color: #ffffff30;
  color: #ffffff;
}

body .sidebar :is(a, summary, button):focus-visible {
  outline: 2px solid #a4c5ff;
  outline-offset: 3px;
}

body .sidebar .sidebar-updates-button {
  display: flex;
  align-items: center;
  text-decoration: none;
}

body .sidebar .sidebar-updates-button::after {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M18 8a6 6 0 0 0-12 0c0 7-3 7-3 9h18c0-2-3-2-3-9M10 21h4' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M18 8a6 6 0 0 0-12 0c0 7-3 7-3 9h18c0-2-3-2-3-9M10 21h4' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

body .sidebar .sidebar-updates-button + .sidebar-logout-button {
  margin-top: 10px;
}

body .sidebar .sidebar-updates-button + .sidebar-logout-button::before {
  display: none;
}

.sidebar-notification-indicator {
  position: absolute;
  top: 7px;
  right: 7px;
  z-index: 1;
  width: 10px;
  height: 10px;
  border: 2px solid #102448;
  border-radius: 50%;
  background: #facc15;
  box-shadow: 0 0 0 2px #facc1529;
  pointer-events: none;
}

body .sidebar .sidebar-updates-button.has-notifications::after {
  transform-origin: 50% 20%;
  animation: sidebar-bell-shake 2.8s ease-in-out infinite;
}

@keyframes sidebar-bell-shake {
  0%, 36%, 100% { rotate: 0deg; }
  5%, 17%, 29% { rotate: -15deg; }
  11%, 23% { rotate: 15deg; }
}

body.sidebar-notifications-open {
  overflow: hidden;
}

.sidebar-notifications-dialog {
  width: min(960px, calc(100vw - 32px));
  max-height: min(820px, calc(100vh - 48px));
  max-height: min(820px, calc(100dvh - 48px));
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 1px solid #e5eaf0;
  border-radius: 16px;
  background: #f6f8fb;
  color: #18283f;
  box-shadow: 0 24px 80px #12203933;
}

.sidebar-notifications-dialog::backdrop {
  background: #07173480;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.sidebar-notifications-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 38px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px;
  border-bottom: 1px solid #e5eaf0;
  background: #fff;
}

.sidebar-notifications-header::before {
  content: "";
  width: 44px; height: 44px; border-radius: 14px;
  background: #eaf0ff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23315fce' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 8a6 6 0 0 0-12 0c0 7-3 7-3 9h18c0-2-3-2-3-9M10 21h4'/%3E%3C/svg%3E") center / 24px 24px no-repeat;
}
.sidebar-notifications-header > div { min-width: 0; }
.sidebar-notifications-header h2 { margin: 0 0 6px; color: #18283f; font-size: clamp(1.1rem, 2vw, 1.3rem); font-weight: 650; line-height: 1.4; letter-spacing: -0.025em; }
.sidebar-notifications-header p { margin: 0; color: #617087; font-size: 0.85rem; font-weight: 400; line-height: 1.6; }
.sidebar-notifications-content { display: grid; gap: 24px; padding: 24px; }
.sidebar-notifications-section { min-width: 0; padding: 20px; border: 1px solid #e5eaf0; border-radius: 14px; background: #ffffff; }
.sidebar-notifications-section h3 { margin: 0 0 16px; font-size: 1.05rem; font-weight: 650; color: #18283f; line-height: 1.4; }
.sidebar-notifications-status { margin: 0; padding: 16px; border-radius: 10px; background: #f5f7fc; color: #617087; font-size: 0.85rem; font-weight: 400; line-height: 1.65; overflow-wrap: anywhere; }
.sidebar-notifications-status:empty { display: none; }
.sidebar-notifications-list { display: grid; gap: 14px; }
.sidebar-notifications-list:not(:empty) { margin-top: 16px; }
.sidebar-notification-card { padding: 20px; border: 1px solid #e5eaf0; border-radius: 12px; background: #fff; }
.sidebar-notification-card h4 { margin: 0 0 8px; color: #18283f; font-size: 1.05rem; font-weight: 650; overflow-wrap: anywhere; }
.sidebar-notification-meta { margin: 0 0 16px; color: #617087; font-size: 0.78rem; overflow-wrap: anywhere; }
.sidebar-notification-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; }
.sidebar-notification-list-item { padding: 0; overflow: hidden; }
.sidebar-notification-summary { padding: 18px 20px; color: #18283f; cursor: pointer; }
.sidebar-notification-summary:hover { background: #eef3f9; }
.sidebar-notification-summary:focus-visible { outline: 3px solid #8eb8ef; outline-offset: -3px; }
.sidebar-notification-summary-title { font-weight: 650; overflow-wrap: anywhere; }
.sidebar-notification-excerpt { display: block; margin-top: 6px; color: #617087; font-size: 0.85rem; font-weight: 400; line-height: 1.6; overflow-wrap: anywhere; }
.sidebar-notification-list-item[open] > summary { margin-bottom: 18px; border-bottom: 1px solid #e5eaf0; background: #f5f7fc; }
.sidebar-notification-list-item > .sidebar-notification-meta,
.sidebar-notification-list-item > .sidebar-notification-body,
.sidebar-notification-list-item > .sidebar-notification-read-status { margin-left: 20px; margin-right: 20px; }
.sidebar-notification-list-item > .update-image-trigger { width: calc(100% - 40px); margin: 18px 20px; }
.sidebar-notification-list-item > .sidebar-notification-body { margin-bottom: 18px; }
.sidebar-notification-read-status { color: #a12635; font-size: 0.85rem; }
.sidebar-notification-read-status:empty { display: none; }

.update-image-trigger {
  display: grid;
  gap: 10px;
  width: 100%;
  min-width: 0;
  margin-top: 18px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #245893;
  font: inherit;
  text-align: left;
  cursor: zoom-in;
}
.update-image-trigger img { display: block; width: 100%; height: auto; border: 1px solid #dce5ef; border-radius: 12px; box-sizing: border-box; }
.update-image-trigger span { font-size: 0.85rem; line-height: 1.5; }
.update-image-trigger:focus-visible { outline: 3px solid #8eb8ef; outline-offset: 4px; border-radius: 12px; }
.update-image-dialog {
  width: min(1440px, calc(100vw - 24px));
  height: calc(100dvh - 32px);
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid #dce5ef;
  border-radius: 16px;
  background: #f8fafc;
  color: #17365e;
}
.update-image-dialog[open] { display: flex; flex-direction: column; }
.update-image-dialog::backdrop { background: #071734b3; }
body:has(.update-image-dialog[open]) { overflow: hidden; }
.update-image-dialog-header { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid #dce5ef; background: #fff; }
.update-image-dialog-header h3 { flex: 1 1 200px; min-width: 0; margin: 0; font-size: 1rem; overflow-wrap: anywhere; }
.update-image-dialog-header button { padding: 9px 14px; border: 1px solid #b7cce5; border-radius: 8px; background: #fff; color: #17365e; font: inherit; cursor: pointer; }
.update-image-dialog-header button:focus-visible { outline: 3px solid #8eb8ef; outline-offset: 2px; }
.update-image-viewport { flex: 1; min-height: 0; overflow: auto; padding: 16px; }
.update-image-viewport img { display: block; width: 100%; max-width: 100%; height: auto; margin: 0 auto; }
.sidebar-notifications-notices { padding: 20px; border-color: #e5eaf0; }

.sidebar-notifications-close,
.sidebar-notifications-action {
  border: 1px solid #dce5ef;
  border-radius: 10px;
  background: #fff;
  color: #17365e;
  font: inherit;
  cursor: pointer;
}

.sidebar-notifications-close { flex-shrink: 0; width: 38px; height: 38px; padding: 0; border-color: #e5eaf0; background: #f5f7fc; color: #617087; font-size: 1.35rem; }
.sidebar-notifications-action { margin-top: 16px; min-height: 42px; padding: 10px 16px; border-color: #e5eaf0; color: #315fce; font-size: 0.85rem; font-weight: 600; }
.sidebar-notifications-action:disabled { opacity: 0.6; cursor: wait; }
.sidebar-notifications-close:hover, .sidebar-notifications-action:hover { background: #eef3f9; }
.sidebar-notifications-close:focus-visible, .sidebar-notifications-action:focus-visible { outline: 2px solid #245893; outline-offset: 3px; }

@media (max-width: 600px) {
  .sidebar-notifications-header, .sidebar-notifications-content { padding: 18px; }
  .sidebar-notifications-content { gap: 16px; }
  .sidebar-notifications-section { padding: 16px; }
  .sidebar-notifications-header { gap: 12px; }
  .sidebar-notification-card { padding: 16px; }
}

@media (min-width: 901px) and (prefers-reduced-motion: no-preference) {
  body .sidebar {
    min-width: 0;
    flex-shrink: 0;
    transition:
      flex-basis 480ms cubic-bezier(0.4, 0, 0.2, 1),
      width 480ms cubic-bezier(0.4, 0, 0.2, 1),
      padding 480ms cubic-bezier(0.4, 0, 0.2, 1),
      border-radius 480ms ease,
      box-shadow 480ms ease;
  }

  body .sidebar:not(.is-collapsed) .nav-links {
    width: calc(var(--sidebar-expanded-width) - 2 * var(--sidebar-padding-x) - 2px);
  }

  body:not(.sidebar-startup-stable) .sidebar:not(.is-collapsed) .nav-links,
  body:not(.sidebar-startup-stable) .sidebar:not(.is-collapsed) .sidebar-logout-button {
    animation: dashboard-menu-reveal 420ms 60ms cubic-bezier(0.4, 0, 0.2, 1) both;
  }
}

@keyframes dashboard-menu-reveal {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  body .sidebar,
  body .sidebar *,
  body .sidebar *::before,
  body .sidebar *::after {
    animation: none !important;
    transition: none !important;
  }

}
