/* =========================
  ScanWin — style.css
========================= */

/* =========================
  Brand Tokens Start
========================= */
:root {
  /* Brand colors */
  --sw-violet: #6e5df8;
  --sw-violet-600: #5a47e8;
  --sw-violet-50: #f5f4fe;
  --sw-lime: #d4ff3f;

  /* Surfaces */
  --sw-bg-app: #fafafb;
  --sw-bg-dark: #1a0d2e;
  --sw-bg-card: #ffffff;

  /* Text */
  --sw-text: #1a1232;
  --sw-text-muted: #6b6f7b;
  --sw-text-faint: #9ca3af;

  /* Borders */
  --sw-border: #ece9e0;
  --sw-border-strong: #d9d5cb;

  /* =========================
     Figma tokens
  ========================= */
  /* Brand */
  --sw-violet-500: #6d5ef7;
  --sw-violet-800: #3c3489;
  --sw-brand-subtle: #f5f4fe;
  --sw-brand-soft: #eeedfe;
  /* Text */
  --sw-text-primary: #0f1020;
  --sw-text-secondary: #6b7280;
  --sw-text-tertiary: #9ca3af;
  /* Surfaces */
  --sw-surface: #ffffff;
  --sw-surface-muted: #f3f4f6;
  --sw-page: #fafafb;
  /* Borders */
  --sw-border-subtle: #f3f4f6;
  --sw-border-default: #e5e7eb;
  --sw-border-strong2: #d1d5db;
  /* Status */
  --sw-success: #10b981;
  --sw-success-soft: #d1fae5;
  --sw-success-text: #065f46;
  --sw-emerald-600: #059669;
  --sw-warning-soft: #fef3c7;
  --sw-warning-text: #b45309;
  --sw-danger-soft: #fef2f2;
  --sw-danger-text: #dc2626;
  /* Type scale (Inter): size / line-height / weight / tracking */
  --sw-h1-size: 32px;
  --sw-h1-lh: 40px;
  --sw-h1-weight: 600;
  --sw-h1-ls: -1px; /* Figma Heading/H1 */
  --sw-h5-size: 16px;
  --sw-h5-lh: 24px;
  --sw-h5-weight: 600;
  --sw-h5-ls: 0; /* Figma Heading/H5 */
  --sw-bodyxs-size: 12px;
  --sw-bodyxs-lh: 16px;
  --sw-bodyxs-weight: 400; /* Figma Body/XS */
  /* Spacing (4px base; space-6 = Figma space/6 = 24) */
  --sw-space-1: 4px;
  --sw-space-2: 8px;
  --sw-space-3: 12px;
  --sw-space-4: 16px;
  --sw-space-5: 20px;
  --sw-space-6: 24px;
  --sw-space-8: 32px;
  --sw-space-10: 40px;
  /* Radius (from existing component usage) */
  --sw-radius-sm: 8px;
  --sw-radius-md: 10px;
  --sw-radius-lg: 16px;
  --sw-radius-xl: 20px;

  /* =========================
    Bootstrap theme bridge
  ========================= */
  --bs-body-font-family:
    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial,
    sans-serif;
  --bs-body-color: var(--sw-text);
  --bs-body-color-rgb: 26, 18, 50;
  --bs-emphasis-color: var(--sw-text-primary);
  --bs-emphasis-color-rgb: 15, 16, 32;
  --bs-tertiary-color: var(--sw-text-faint); /* = --sw-text-tertiary */
  --bs-tertiary-color-rgb: 156, 163, 175;
  --bs-primary: var(--sw-violet);
  --bs-primary-rgb: 110, 93, 248;
}
/* =========================
  Brand Tokens End
========================= */

/* =========================
  Global Resets / Typography Start
========================= */
html,
body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Helvetica,
    Arial,
    sans-serif;
  color: var(--sw-text);
  background: var(--sw-bg-app);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  scrollbar-gutter: stable;
}

/* =========================
  Interactive focus states
========================= */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible,
[role="button"]:focus-visible,
[role="tab"]:focus-visible,
[role="menuitem"]:focus-visible {
  outline: 2px solid var(--sw-violet-500);
  outline-offset: 2px;
}

button:not(:disabled),
[role="button"],
[role="tab"],
[role="menuitem"] {
  cursor: pointer;
}

/* Re-skin Bootstrap primary button to ScanWin violet */
.btn-primary {
  --bs-btn-bg: var(--sw-violet);
  --bs-btn-border-color: var(--sw-violet);
  --bs-btn-hover-bg: var(--sw-violet-600);
  --bs-btn-hover-border-color: var(--sw-violet-600);
  --bs-btn-active-bg: var(--sw-violet-600);
  --bs-btn-active-border-color: var(--sw-violet-600);
  --bs-btn-focus-shadow-rgb: 110, 93, 248;
}

/* Generic violet text-link helper */
.text-violet {
  color: var(--sw-violet) !important;
}

.text-violet:hover {
  color: var(--sw-violet-600);
}
/* =========================
  Global Resets / Typography End
========================= */

/* =========================
  App Shell — Sidebar Start
========================= */
.sw-sidebar {
  background: #fff;
  padding: 24px 16px;
}

.sw-sidebar__drawer-head {
  display: flex;
  padding: 20px 16px 16px;
  border-bottom: 1px solid #f3f4f6;
}
.sw-sidebar__drawer-head .sw-sidebar__brand {
  margin: 0;
  padding: 0;
}
.sw-sidebar__close {
  width: 32px;
  height: 32px;
  background: none;
  display: inline-flex;
  color: #6b7280;
  cursor: pointer;
}
.sw-sidebar__close:hover {
  background: #f3f4f6;
  color: #0f1020;
}

/* =========================
  Sidebar Drawer Profile Start
========================= */
.sw-drawer-profile {
  margin: auto 12px 12px 12px;
  margin-top: auto;
  background: #f3f4f6;
  border: 1px solid #f3f4f6;
  border-radius: 12px;
  display: flex;
}

.sw-drawer-profile__chip {
  display: flex;
  gap: 10px;
  padding: 4px 12px 4px 4px;
  background: none;
  cursor: pointer;
  font: inherit;
}

.sw-drawer-profile__id {
  flex: 1;
  display: flex;
  min-width: 0;
}

.sw-drawer-profile__name {
  font-size: 13px;
  line-height: 16px;
}

.sw-drawer-profile__role {
  font-size: 11px;
  line-height: 14px;
}

.sw-drawer-profile__chev {
  width: 14px;
  height: 14px;
  color: var(--sw-text-muted);
  transition: transform 0.18s ease;
}

.sw-drawer-profile__chip:not(.collapsed) .sw-drawer-profile__chev {
  transform: rotate(180deg);
}

.sw-drawer-profile__expand {
  display: flex;
}

.sw-drawer-profile__expand.collapsing {
  transition: none;
}

.sw-drawer-profile__chip.collapsed + .sw-drawer-profile__expand {
  display: none;
}

.sw-drawer-profile__menu {
  display: flex;
}

.sw-drawer-profile__sep {
  border: 0;
  border-top: 1px solid #d9d9d9;
}

.sw-drawer-profile__item {
  display: flex;
  gap: 10px;
  height: 32px;
  padding: 10px;
  font-size: 13px;
  line-height: 18px;
  color: #1a1232;
}

.sw-drawer-profile__item:hover,
.sw-drawer-profile__item:active {
  background: rgba(255, 255, 255, 0.6);
  color: #1a1232;
}

.sw-drawer-profile__item-icon {
  width: 18px;
  height: 18px;
  color: var(--sw-text-muted);
}

.sw-drawer-profile__item-arrow {
  width: 12px;
  height: 12px;
}

.sw-drawer-profile__item--danger {
  color: #ef4444;
}

.sw-drawer-profile__item--danger .sw-drawer-profile__item-icon {
  color: #ef4444;
}

.sw-drawer-profile__item--danger:hover,
.sw-drawer-profile__item--danger:active {
  background: #fef2f2;
  color: #dc2626;
}

.sw-drawer-profile__item--danger:hover .sw-drawer-profile__item-icon,
.sw-drawer-profile__item--danger:active .sw-drawer-profile__item-icon {
  color: #dc2626;
}
/* =========================
  Sidebar Drawer Profile End
========================= */

.sw-sidebar.offcanvas {
  display: flex;
  flex-direction: column;
}
.sw-sidebar.offcanvas > nav,
.sw-sidebar.offcanvas > .sw-sidebar__group {
  flex-shrink: 0;
}

.sw-sidebar__brand {
  display: flex;
  gap: 7px;
  padding: 8px;
  margin-bottom: 24px;
}

.sw-sidebar__brand-mark {
  width: 28px;
  height: 28px;
}

.sw-sidebar__brand-name {
  font-size: 20px;
  letter-spacing: -0.4px;
}

.sw-sidebar__group {
  font-size: 11px;
  letter-spacing: 0.6px;
  color: #b3b3bb;
  margin: 16px 12px 8px;
}

.sw-sidebar .nav {
  --bs-nav-link-padding-x: 12px;
  --bs-nav-link-padding-y: 0;
  --bs-nav-link-font-size: 14px;
  --bs-nav-link-font-weight: 500;
  --bs-nav-link-color: var(--sw-text-muted);
  --bs-nav-link-hover-color: var(--sw-text);
  --bs-nav-pills-border-radius: 10px;
  --bs-nav-pills-link-active-color: var(--sw-violet);
  --bs-nav-pills-link-active-bg: var(--sw-violet-50);
}

.sw-nav-item {
  display: flex;
  gap: 12px;
  height: 40px;
  transition:
    background 0.12s,
    color 0.12s;
  margin-bottom: 2px;
}

.sw-nav-item:hover {
  background: #f6f6f8;
}

.sw-nav-item:focus:not(:hover):not(.active) {
  color: var(--bs-nav-link-color);
}

.sw-nav-item:focus-visible {
  outline: 2px solid var(--sw-violet-500);
  box-shadow: none;
  z-index: 1;
}

.sw-nav-item.active {
  font-weight: 600;
}

.sw-nav-item__icon {
  width: 20px;
  height: 20px;
}
/* =========================
  App Shell — Sidebar End
========================= */

/* =========================
  App Shell — Main Column Start
========================= */

.sw-app__main {
  flex: 1;
  min-width: 0;
  display: flex;
}

.sw-app__content {
  padding: 32px;
  flex: 1;
}
/* =========================
  App Shell — Main Column End
========================= */

/* =========================
  App Shell — Topbar (Desktop) Start
========================= */
.sw-topbar {
  display: flex;
  gap: 12px;
  padding: 16px 32px;
  border-bottom: 1px solid #f3f4f6;
  background: #fff;
  z-index: 5;
}

.sw-topbar__title {
  display: flex;
  gap: 2px;
}

.sw-topbar__title-kicker {
  font-size: 12px;
  line-height: 16px;
}

.sw-topbar__title-h {
  font-size: 22px;
  line-height: 28px;
  letter-spacing: -0.44px;
}

.sw-topbar__search {
  width: 280px;
  min-width: 0;
  height: 40px;
  display: flex;
  padding: 8px 12px;
  background: #f3f4f6;
  border: 1px solid #f3f4f6;
  transition:
    border-color 0.15s,
    box-shadow 0.15s,
    background 0.15s;
}

.sw-topbar__search:hover {
  background: #eceef1;
  border-color: #e5e7eb;
}

.sw-topbar__search:focus-within {
  background: var(--sw-surface, #fff);
  border-color: var(--sw-violet);
  box-shadow: 0 0 0 3px rgba(110, 93, 248, 0.15);
}

.sw-topbar__search input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13px;
  color: var(--sw-text);
}

.sw-topbar__search input::placeholder {
  color: var(--sw-text-faint);
}

.sw-streak {
  display: inline-flex;
  gap: 6px;
  height: 32px;
  padding: 8px 12px;
  background: linear-gradient(90deg, #f59e0a 0%, #ed4545 100%);
  font-size: 12px;
  line-height: 16px;
}

.sw-streak__icon {
  width: 16px;
  height: 16px;
}

.sw-streak:hover {
  color: #fff;
  filter: brightness(1.05);
}

/* Bell button */
.sw-bell {
  width: 40px;
  height: 40px;
  display: inline-flex;
  background: #f3f4f6;
  border: 1px solid #f3f4f6;
  color: var(--sw-text-muted);
}

.sw-bell:hover {
  background: #e9eaee;
  color: var(--sw-text);
}

.sw-bell__dot {
  top: 9px;
  right: 9px;
  width: 8px;
  height: 8px;
  background: #ef4444;
  border: 1.5px solid #fff;
}

.sw-user-menu {
  display: inline-flex;
  padding: 4px 12px 4px 4px;
  background: #f3f4f6;
  border: 1px solid #f3f4f6;
  cursor: pointer;
  font: inherit;
}

.sw-user-menu:hover {
  background: #e9eaee;
  color: var(--sw-text);
}

.sw-user-menu__name {
  font-size: 13px;
  line-height: 16px;
  max-width: 160px;
  text-overflow: ellipsis;
}

.sw-user-menu__role {
  font-size: 11px;
  line-height: 14px;
  max-width: 160px;
  text-overflow: ellipsis;
}

.sw-user-menu__chev {
  transition: transform 0.18s ease;
}

.sw-user-menu.show .sw-user-menu__chev {
  transform: rotate(180deg);
}

/* =========================
  Avatar Dropdown Start
========================= */
.sw-user-dropdown {
  --bs-dropdown-zindex: 50;
  --bs-dropdown-min-width: 0;
  --bs-dropdown-padding-y: 0;
  --bs-dropdown-spacer: 2px;
  --bs-dropdown-bg: #fff;
  --bs-dropdown-border-color: var(--sw-border);
  --bs-dropdown-border-radius: 14px;
  --bs-dropdown-link-color: #1a1232;
  --bs-dropdown-link-hover-color: #1a1232;
  --bs-dropdown-link-hover-bg: #f3f4f6;
  --bs-dropdown-link-active-color: #1a1232;
  --bs-dropdown-link-active-bg: #f3f4f6;
  --bs-dropdown-item-padding-x: 10px;
  --bs-dropdown-item-padding-y: 10px;
  --bs-dropdown-item-border-radius: 8px;
  margin-top: var(--bs-dropdown-spacer);
  display: block;
  width: 300px;
  background-clip: border-box;
  box-shadow: 0 8px 32px rgba(15, 10, 33, 0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transform-origin: top right;
  transition:
    opacity 0.16s ease-out,
    transform 0.16s ease-out,
    visibility 0s linear 0.16s;
}

.sw-user-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition:
    opacity 0.16s ease-out,
    transform 0.16s ease-out,
    visibility 0s;
}

@media (prefers-reduced-motion: reduce) {
  .sw-user-dropdown {
    transition: none;
  }
}

.sw-user-dropdown__profile {
  display: flex;
  gap: 12px;
  background: #fafafb;
}

.sw-user-dropdown__info {
  display: flex;
  min-width: 0;
  flex: 1;
}

.sw-user-dropdown__id {
  display: flex;
  gap: 2px;
  min-width: 0;
}

.sw-user-dropdown__name {
  font-size: 14px;
  line-height: 18px;
  text-overflow: ellipsis;
}

.sw-user-dropdown__handle {
  font-size: 12px;
  line-height: 16px;
  color: #6b7280;
  text-overflow: ellipsis;
}

.sw-user-dropdown__tier {
  display: inline-flex;
  gap: 5px;
  padding: 2px 8px;
  background: var(--sw-violet-50);
  font-size: 9px;
  letter-spacing: 0.54px;
}

.sw-user-dropdown__tier-badge {
  width: 12px;
  height: 12px;
  background: #e0a82e;
  display: inline-flex;
}

.sw-user-dropdown__tier-badge svg {
  width: 7px;
  height: 7px;
}

.sw-user-dropdown__section {
  border-top: 1px solid var(--sw-border);
}

.sw-user-dropdown__list {
  list-style: none;
}

.sw-user-dropdown__item {
  display: flex;
  gap: 10px;
  font-size: 13px;
  line-height: 18px;
  transition: background 0.12s;
}

.sw-user-dropdown .sw-user-dropdown__item:not(:hover) {
  color: var(--bs-dropdown-link-color);
  background-color: transparent;
}

.sw-user-dropdown__item-icon {
  width: 18px;
  height: 18px;
  color: #6b7280;
}

.sw-user-dropdown__item-arrow {
  width: 12px;
  height: 12px;
}

.sw-user-dropdown__item--danger {
  --bs-dropdown-link-color: #ef4444;
  --bs-dropdown-link-hover-color: #dc2626;
  --bs-dropdown-link-hover-bg: #fef2f2;
  --bs-dropdown-link-active-color: #dc2626;
  --bs-dropdown-link-active-bg: #fef2f2;
}

.sw-user-dropdown__item--danger .sw-user-dropdown__item-icon {
  color: #ef4444;
}

.sw-user-dropdown__item--danger:hover .sw-user-dropdown__item-icon {
  color: #dc2626;
}

.sw-mobile-nav {
  display: none;
  padding: 16px 20px;
  background: #fff;
  border-bottom: 1px solid #f3f4f6;
  z-index: 10;
}

.sw-mobile-nav .sw-sidebar__brand {
  margin: 0;
  padding: 0;
  gap: 4px;
}

.sw-mobile-nav .sw-sidebar__brand-mark {
  width: 32px;
  height: 32px;
}

.sw-mobile-nav .sw-sidebar__brand-name {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.42px;
}

.sw-mobile-nav__right {
  display: flex;
  gap: 20px;
}

.sw-mobile-nav__right-inner {
  display: flex;
  gap: 12px;
}

.sw-mobile-nav .sw-bell {
  width: 33px;
  height: 32px;
}

.sw-mobile-nav .sw-bell__dot {
  top: 4px;
  right: 4px;
}

.sw-mobile-menu-btn {
  background: none;
  width: 24px;
  height: 24px;
  display: inline-flex;
}

.sw-card {
  --bs-card-spacer-y: 24px;
  --bs-card-spacer-x: 24px;
  --bs-card-border-color: var(--sw-border-default);
  --bs-card-border-radius: 16px;
  box-shadow: 0 1px 2px rgba(15, 16, 32, 0.04);
}

.sw-card__title {
  font-size: 18px;
  line-height: 100%;
  font-weight: 600;
  color: var(--sw-text-primary);
  margin: 0 0 4px 0;
}

.sw-card__subtitle {
  font-size: 13px;
  color: var(--sw-text-secondary);
  margin: 0;
}

.sw-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
}

.sw-view-all {
  font-size: 13px;
  font-weight: 600;
  color: var(--sw-violet);
}

.sw-view-all:hover {
  color: var(--sw-violet-600);
}

.sw-empty {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  padding: 40px 24px;
  min-height: 200px;
}

.sw-empty__icon {
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--sw-brand-soft);
  color: var(--sw-violet-500);
}

.sw-empty__icon svg {
  width: 26px;
  height: 26px;
}

.sw-empty__title {
  font-size: 15px;
  font-weight: 600;
  line-height: 20px;
  color: var(--sw-text-primary);
}

.sw-empty__text {
  font-size: 13px;
  line-height: 18px;
  color: var(--sw-text-secondary);
  max-width: 280px;
  margin: 0;
}

.sw-card--empty .sw-empty {
  display: flex;
}
.sw-card--empty .sw-activity__list,
.sw-card--empty .sw-ltable,
.sw-card--empty .sw-view-all {
  display: none;
}

.sw-share-modal {
  --bs-modal-width: min(520px, calc(100vw - 32px));
  --bs-modal-margin: 16px;
  --bs-modal-border-width: 0px;
  --bs-modal-border-radius: 20px;
}

.sw-share-modal.fade .modal-dialog {
  transform: none;
  transition: none;
}

.sw-share-modal.fade:not(.show) {
  opacity: 1;
  transition: opacity 0s linear 0.28s;
  pointer-events: none;
}

.sw-share-modal:not(.show) .sw-share-modal__panel {
  pointer-events: none;
}

body.sw-share-locked {
  overflow: hidden;
  padding-right: 0 !important;
}

body.sw-share-locked .modal-backdrop {
  --bs-backdrop-bg: #0f1020;
  width: 100%;
  height: 100%;
  transition: none;
  animation: sw-share-backdrop-in 0.22s ease-out;
}

body.sw-share-locked.sw-share-closing .modal-backdrop {
  opacity: 0;
  transition: opacity 0.22s ease-out;
}

@keyframes sw-share-backdrop-in {
  from {
    opacity: 0;
  }
}

.sw-share-modal__panel {
  max-height: calc(100vh - 32px);
  box-shadow: 0 24px 64px rgba(15, 16, 32, 0.24);
  overflow: hidden;
  transform: translateY(20px) scale(0.98);
  opacity: 0;
  transition:
    transform 0.28s cubic-bezier(0.32, 0.72, 0, 1),
    opacity 0.22s ease-out;
}

.sw-share-modal.show .sw-share-modal__panel {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.sw-share-modal__head {
  padding: 28px 28px 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
}

.sw-share-modal__head-text {
  flex: 1;
  min-width: 0;
}

.sw-share-modal__title {
  font-size: 22px;
  font-weight: 600;
  line-height: 28px;
  color: #0f1020;
  margin: 0 0 4px;
}

.sw-share-modal__subtitle {
  font-size: 13px;
  font-weight: 400;
  line-height: 18px;
  color: #6b7280;
  margin: 0;
}

.sw-share-modal__close {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #f3f4f6;
  border: 0;
  color: #6b7280;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.sw-share-modal__close svg {
  width: 16px;
  height: 16px;
}

.sw-share-modal__close:hover {
  background: #e5e7eb;
  color: #0f1020;
}

/* Mobile bottom-sheet variant */
@media (max-width: 575.98px) {
  .sw-share-modal {
    --bs-modal-margin: 0px;
  }

  .sw-share-modal .modal-dialog {
    align-items: flex-end;
  }

  .sw-share-modal.fade:not(.show) {
    transition-delay: 0.32s;
  }

  .sw-share-modal__panel {
    max-height: 92vh;
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
    opacity: 1;
    transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
  }

  .sw-share-modal.show .sw-share-modal__panel {
    transform: translateY(0);
  }

  .sw-share-modal__panel::before {
    content: "";
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 4px;
    border-radius: 999px;
    background: #d1d5db;
  }

  .sw-share-modal__head {
    padding: 28px 28px 20px;
  }

  .sw-share-modal__subtitle {
    white-space: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sw-share-modal__panel,
  .sw-share-modal.fade:not(.show),
  body.sw-share-locked.sw-share-closing .modal-backdrop {
    transition: none;
  }

  body.sw-share-locked .modal-backdrop {
    animation: none;
  }
}

.sw-toast-region {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 1090;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: calc(100vw - 48px);
}

.sw-toast {
  pointer-events: auto;
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 360px;
  max-width: 100%;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--sw-border);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 16, 32, 0.16);
  overflow: hidden;
  transform: translateX(110%);
  opacity: 0;
  transition:
    transform 0.32s cubic-bezier(0.32, 0.72, 0, 1),
    opacity 0.22s ease-out;
}

.sw-toast.show {
  transform: translateX(0);
  opacity: 1;
}

/* Colored accent stripe on the left edge per kind */
.sw-toast::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--sw-violet);
}

.sw-toast--success::before {
  background: #10b981;
}
.sw-toast--error::before {
  background: #ef4444;
}
.sw-toast--info::before {
  background: var(--sw-violet);
}

.sw-toast__icon {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--sw-violet-50);
  color: var(--sw-violet);
}

.sw-toast--success .sw-toast__icon {
  background: #d1fae5;
  color: #047857;
}
.sw-toast--error .sw-toast__icon {
  background: #fee2e2;
  color: #b91c1c;
}

.sw-toast__icon svg {
  width: 18px;
  height: 18px;
}

.sw-toast__text {
  flex: 1;
  min-width: 0;
}

.sw-toast__title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  line-height: 18px;
  color: #0f1020;
  margin-bottom: 2px;
}

.sw-toast__body {
  display: block;
  font-size: 12px;
  font-weight: 400;
  line-height: 16px;
  color: #6b7280;
  word-break: break-word;
}

.sw-toast__close {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: none;
  border: 0;
  color: #9ca3af;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.sw-toast__close svg {
  width: 14px;
  height: 14px;
}

.sw-toast__close:hover {
  background: #f3f4f6;
  color: #0f1020;
}

.sw-toast__bar {
  position: absolute;
  left: 4px;
  right: 0;
  bottom: 0;
  height: 2px;
  background: rgba(110, 93, 248, 0.16);
  transform-origin: left center;
  animation: sw-toast-bar 3.5s linear forwards;
}

.sw-toast--success .sw-toast__bar {
  background: rgba(16, 185, 129, 0.18);
}
.sw-toast--error .sw-toast__bar {
  background: rgba(239, 68, 68, 0.18);
}

.sw-toast:hover .sw-toast__bar,
.sw-toast:focus-within .sw-toast__bar {
  animation: none;
}

@keyframes sw-toast-bar {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

/* Mobile: stack at top-center, slide from top */
@media (max-width: 575.98px) {
  .sw-toast-region {
    top: 16px;
    right: 16px;
    left: 16px;
    align-items: stretch;
    max-width: none;
  }

  .sw-toast {
    width: auto;
    transform: translateY(-120%);
  }

  .sw-toast.show {
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .sw-toast,
  .sw-toast__bar {
    transition: none;
    animation: none;
  }
}

.sw-notif-popup {
  position: fixed;
  inset: 0;
  z-index: 1080;
  pointer-events: none;
}

.sw-notif-popup:not(:has(> .offcanvas-backdrop)) {
  display: none;
}

.sw-notif-popup > .offcanvas-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: auto;
  height: auto;
  background: transparent;
  opacity: 1;
  transition: opacity 0.2s linear;
  pointer-events: auto;
}

.sw-notif-popup > .offcanvas-backdrop:not(.show) {
  pointer-events: none;
}

.sw-notif-popup__panel {
  position: absolute;
  z-index: 1;
  pointer-events: auto;
  top: 62px;
  right: 32px;
  width: 420px;
  max-height: min(80vh, 720px);
  background: #fff;
  border: 1px solid #ece9e0;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(15, 10, 33, 0.12);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  outline: 0;
  visibility: hidden;
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  transform-origin: top right;
  transition:
    opacity 0.18s ease-out,
    transform 0.18s ease-out;
}

.sw-notif-popup__panel.showing,
.sw-notif-popup__panel.show:not(.hiding) {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.sw-notif-popup__panel.showing,
.sw-notif-popup__panel.show,
.sw-notif-popup__panel.hiding {
  visibility: visible;
}

/* Mobile-only appbar (hidden on desktop) */
.sw-notif-popup__appbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  flex-shrink: 0;
}

.sw-notif-popup__appbar-title {
  flex: 1;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
  color: #0f1020;
}

.sw-notif-popup__back {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #f3f4f6;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #1a1232;
  cursor: pointer;
  flex-shrink: 0;
}

.sw-notif-popup__back svg {
  width: 18px;
  height: 18px;
}

.sw-notif-popup__appbar-spacer {
  width: 32px;
  flex-shrink: 0;
}

/* Header */
.sw-notif-popup__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #ece9e0;
  flex-shrink: 0;
}

.sw-notif-popup__title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sw-notif-popup__title {
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
  letter-spacing: -0.08px;
  color: #0f1020;
  margin: 0;
}

.sw-notif-popup__count {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: #f0ebff;
  color: #6e5df8;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.sw-notif-popup__settings {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #f3f4f6;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #1a1232;
  cursor: pointer;
}

.sw-notif-popup__settings svg {
  width: 16px;
  height: 16px;
}

.sw-notif-popup__mark-read {
  display: none;
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 12px;
  font-weight: 600;
  color: #6e5df8;
  cursor: pointer;
}

/* Tabs */
.sw-notif-popup__tabs {
  display: flex;
  gap: 4px;
  padding: 10px 16px;
  border-bottom: 1px solid #ece9e0;
  flex-shrink: 0;
}

.sw-notif-popup__tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 0;
  background: transparent;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: #6b6f7b;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
}

.sw-notif-popup__tab:hover {
  color: #1a1232;
}

.sw-notif-popup__tab.is-active {
  background: #f0ebff;
  color: #6e5df8;
  font-weight: 600;
}

.sw-notif-popup__tab-count {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  background: #f3f4f6;
  color: #1a1232;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
}

.sw-notif-popup__tab.is-active .sw-notif-popup__tab-count {
  background: #6e5df8;
  color: #fff;
}

/* List */
.sw-notif-popup__list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: 0;
}

.sw-notif-popup__item {
  display: flex;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid #f5f4fe;
  cursor: pointer;
  transition: background 0.15s;
}

.sw-notif-popup__item:last-child {
  border-bottom: 0;
}

.sw-notif-popup__item:hover {
  background: #f5f4fe;
}

/* Unread items get a slightly tinted bg */
.sw-notif-popup__item--unread {
  background: #fafafb;
}

.sw-notif-popup__avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.4px;
  flex-shrink: 0;
}

.sw-notif-popup__avatar svg {
  width: 18px;
  height: 18px;
}

.sw-notif-popup__content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sw-notif-popup__text {
  font-size: 13px;
  font-weight: 400;
  line-height: 18px;
  color: #1a1232;
  margin: 0;
}

.sw-notif-popup__text strong {
  font-weight: 600;
}

.sw-notif-popup__meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sw-notif-popup__time {
  font-size: 11px;
  font-weight: 400;
  color: #9ca3af;
}

.sw-notif-popup__dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #6e5df8;
  flex-shrink: 0;
}

/* Mobile: full-screen sheet slides in from the right */
@media (max-width: 767.98px) {
  .sw-notif-popup > .offcanvas-backdrop {
    background: #fafafb;
  }

  .sw-notif-popup__panel {
    top: 0;
    right: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    max-height: none;
    border-radius: 0;
    border: 0;
    box-shadow: none;
    transform: translateX(24px);
    transform-origin: center;
  }

  .sw-notif-popup__panel.showing,
  .sw-notif-popup__panel.show:not(.hiding) {
    transform: translateX(0);
  }

  .sw-notif-popup__appbar {
    display: flex;
    border-bottom: 0;
  }

  .sw-notif-popup__settings {
    display: none;
  }

  .sw-notif-popup__mark-read {
    display: inline-block;
  }

  .sw-notif-popup__text {
    font-size: 14px;
    line-height: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sw-notif-popup__panel {
    transition: none;
  }
}
