/* Synergyworks workspace — light sky-blue professional theme */
:root {
  --sw-brand: #0390f3;
  --sw-brand-deep: #0270c9;
  --sw-sky: #e8f4ff;
  --sw-sky-2: #d6ecff;
  --sw-ink: #0f172a;
  --sw-muted: #64748b;
  --sw-line: rgba(15, 23, 42, 0.08);
  --sw-line-strong: rgba(2, 112, 201, 0.16);
  --sw-surface: #ffffff;
  --sw-canvas: #e7eef6;
  --sw-aside: #ffffff;
  --sw-aside-2: #f8fbff;
  --sw-chat-wall: #dceaf7;
  --sw-radius: 16px;
  --sw-shadow: 0 10px 28px rgba(15, 23, 42, 0.06), 0 1px 0 rgba(255, 255, 255, 0.9) inset;
}

/* Canvas must paint the full scroll height. Metronic sets html,body { height:100% },
   so a gradient on body stops at the first viewport and the rest of a long page is white. */
html {
  height: auto !important;
  min-height: 100%;
  background:
    radial-gradient(circle at 100% 0%, rgba(3, 144, 243, 0.08), transparent 38%),
    linear-gradient(180deg, #eef3f8 0%, var(--sw-canvas) 45%, #e3ebf4 100%) fixed !important;
}

body.sw-app,
body.sw-portal,
body.sw-login {
  font-family: "Urbanist", system-ui, sans-serif !important;
}

body.sw-app *:not([class^="icon-"]):not([class*=" icon-"]):not(.ki):not(.flaticon):not(.flaticon2):not(.la):not(.fa):not(.fas):not(.far):not(.fab),
body.sw-portal *:not([class^="icon-"]):not([class*=" icon-"]):not(.ki):not(.flaticon):not(.flaticon2):not(.la):not(.fa):not(.fas):not(.far):not(.fab),
body.sw-login *:not([class^="icon-"]):not([class*=" icon-"]):not(.ki):not(.flaticon):not(.flaticon2):not(.la):not(.fa):not(.fas):not(.far):not(.fab) {
  font-family: "Urbanist", system-ui, sans-serif !important;
}

body.sw-app [class^="icon-"],
body.sw-app [class*=" icon-"],
body.sw-portal [class^="icon-"],
body.sw-portal [class*=" icon-"],
body.sw-login [class^="icon-"],
body.sw-login [class*=" icon-"],
body.sw-app [class^="icon-"]::before,
body.sw-app [class*=" icon-"]::before,
body.sw-portal [class^="icon-"]::before,
body.sw-portal [class*=" icon-"]::before,
body.sw-login [class^="icon-"]::before,
body.sw-login [class*=" icon-"]::before {
  font-family: "icomoon" !important;
  speak: never;
  font-style: normal !important;
  font-weight: normal !important;
  font-variant: normal;
  text-transform: none;
  line-height: 1;
  -webkit-font-smoothing: antialiased;
  opacity: 1 !important;
}

/* Override Metronic gray `i` color so icons stay visible */
body.sw-app i[class^="icon-"],
body.sw-app i[class*=" icon-"],
body.sw-portal i[class^="icon-"],
body.sw-portal i[class*=" icon-"] {
  color: inherit !important;
}
body.sw-app i[class^="icon-"]::before,
body.sw-app i[class*=" icon-"]::before,
body.sw-portal i[class^="icon-"]::before,
body.sw-portal i[class*=" icon-"]::before {
  color: inherit !important;
}

body.sw-app,
body.sw-portal {
  height: auto !important;
  min-height: 100vh !important;
  background:
    radial-gradient(circle at 100% 0%, rgba(3, 144, 243, 0.08), transparent 38%),
    linear-gradient(180deg, #eef3f8 0%, var(--sw-canvas) 45%, #e3ebf4 100%) fixed !important;
  color: var(--sw-ink);
}

body.sw-app .d-flex.flex-column.flex-root,
body.sw-app .page,
body.sw-app #kt_wrapper,
body.sw-app #kt_content,
body.sw-app .content,
body.sw-portal .d-flex.flex-column.flex-root,
body.sw-portal .page,
body.sw-portal #kt_wrapper,
body.sw-portal #kt_content,
body.sw-portal .content {
  background:
    radial-gradient(circle at 100% 0%, rgba(3, 144, 243, 0.08), transparent 38%),
    linear-gradient(180deg, #eef3f8 0%, var(--sw-canvas) 45%, #e3ebf4 100%) fixed !important;
  min-height: 100vh;
  min-height: 100dvh;
}

/* —— Aside (white panel against cool canvas) —— */
body.sw-app .aside,
body.sw-app #kt_aside {
  background: linear-gradient(180deg, var(--sw-aside) 0%, var(--sw-aside-2) 100%) !important;
  border-right: 1px solid var(--sw-line-strong) !important;
  box-shadow: 8px 0 28px rgba(15, 23, 42, 0.05);
  width: 270px !important;
  max-width: 270px !important;
  z-index: 98;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  min-height: 100dvh !important;
  padding: 0 !important;
  margin: 0 !important;
}

body.sw-app .aside-menu-wrapper,
body.sw-app #kt_aside_menu_wrapper {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 0 !important;
  margin: 0 !important;
  scrollbar-width: thin;
  scrollbar-color: rgba(2, 112, 201, 0.28) transparent;
}
body.sw-app .aside-menu-wrapper::-webkit-scrollbar,
body.sw-app #kt_aside_menu_wrapper::-webkit-scrollbar { width: 6px; }
body.sw-app .aside-menu-wrapper::-webkit-scrollbar-thumb,
body.sw-app #kt_aside_menu_wrapper::-webkit-scrollbar-thumb {
  background: rgba(2, 112, 201, 0.3);
  border-radius: 999px;
}
body.sw-app .aside-menu-wrapper::-webkit-scrollbar-track,
body.sw-app #kt_aside_menu_wrapper::-webkit-scrollbar-track { background: transparent; }

/* Kill Metronic PerfectScrollbar clipping that blocks native scroll */
body.sw-app .aside.ps,
body.sw-app .aside-menu.ps,
body.sw-app #kt_aside_menu.ps {
  overflow: visible !important;
}
body.sw-app .aside .ps__rail-x,
body.sw-app .aside .ps__rail-y,
body.sw-app .aside-menu .ps__rail-x,
body.sw-app .aside-menu .ps__rail-y {
  display: none !important;
}

@media (min-width: 992px) {
  body.sw-app.aside-fixed .aside,
  body.sw-app.aside-fixed #kt_aside {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    height: 100vh !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    max-height: 100dvh !important;
  }
  body.sw-app.aside-fixed .wrapper,
  body.sw-app.aside-fixed #kt_wrapper {
    padding-left: 270px !important;
    min-height: 100vh;
  }
  body.sw-app.aside-fixed.header-fixed .header {
    left: 270px !important;
  }
}

body.sw-app .brand,
body.sw-app #kt_brand {
  background: transparent !important;
  border-bottom: 1px solid var(--sw-line) !important;
  padding: 14px 20px !important;
  min-height: 64px !important;
  height: 64px !important;
  display: flex !important;
  align-items: center !important;
  flex: 0 0 auto !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

body.sw-app .brand-logo {
  display: flex !important;
  align-items: center !important;
  width: 100%;
  min-width: 0;
}
body.sw-app .brand-logo img {
  height: 46px !important;
  max-width: 200px !important;
  width: auto !important;
  object-fit: contain;
  filter: none;
}
body.sw-portal .sw-aside-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: var(--sw-brand);
  color: #fff;
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
}
body.sw-portal .sw-aside-brand-name {
  min-width: 0;
  color: var(--sw-ink);
  font-weight: 800;
  font-size: 0.95rem;
  line-height: 1.25;
}
body.sw-portal .brand-logo { gap: 10px; }

body.sw-app .aside-menu,
body.sw-app #kt_aside_menu {
  margin: 0 !important;
  padding: 10px 0 20px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

body.sw-app .aside-menu .menu-nav {
  margin: 0 !important;
  padding: 0 14px !important;
  list-style: none !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

body.sw-app .aside-menu .menu-nav > .menu-section {
  margin: 14px 4px 6px !important;
  padding: 0 6px !important;
  flex-grow: 0 !important;
  display: block !important;
}
body.sw-app .aside-menu .menu-nav > .menu-section:first-child {
  margin-top: 4px !important;
}

body.sw-app .aside-menu .menu-nav > .menu-section .menu-text {
  color: #7aa3c4 !important;
  font-size: 11px !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700 !important;
  margin: 0 !important;
  line-height: 1.3 !important;
}
body.sw-app .aside-menu .menu-nav > .menu-section .menu-icon,
body.sw-app .aside-menu .menu-nav > .menu-section > i {
  display: none !important;
}

body.sw-app .aside-menu .menu-nav > .menu-item {
  flex-grow: 0 !important;
  float: none !important;
  padding: 0 !important;
  margin: 0 !important;
  width: 100% !important;
  display: block !important;
}

body.sw-app .aside-menu .menu-nav > .menu-item > .menu-link,
body.sw-app .aside-menu .menu-link {
  border-radius: 12px !important;
  margin: 0 !important;
  padding: 10px 14px !important;
  color: #334155 !important;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  min-height: 42px !important;
  flex-grow: 0 !important;
  text-decoration: none !important;
}

body.sw-app .aside-menu .menu-link .sw-nav-icon {
  width: 22px !important;
  min-width: 22px !important;
  text-align: center;
  color: #0c4a6e !important;
  font-size: 17px !important;
  flex: 0 0 22px !important;
  opacity: 1 !important;
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}
body.sw-app .aside-menu .menu-link .sw-nav-icon,
body.sw-app .aside-menu .menu-link .sw-nav-icon::before {
  font-family: 'icomoon' !important;
  font-style: normal !important;
  font-weight: normal !important;
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}
body.sw-app .aside-menu .sw-nav-dash {
  width: 18px !important;
  min-width: 18px !important;
  flex: 0 0 18px !important;
  text-align: center;
  color: #64748b !important;
  font-family: inherit !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
}
body.sw-app .aside-menu .sw-nav-accordion__panel .menu-link .sw-nav-sub-icon {
  width: 18px !important;
  min-width: 18px !important;
  flex: 0 0 18px !important;
  font-size: 11px !important;
  color: #64748b !important;
  opacity: 0.7 !important;
}
body.sw-app .aside-menu .sw-nav-accordion__panel .menu-link .sw-nav-sub-icon::before {
  color: #64748b !important;
}
body.sw-app .aside-menu .sw-nav-accordion__panel .menu-item-active > .menu-link .sw-nav-sub-icon,
body.sw-app .aside-menu .sw-nav-accordion__panel .menu-item-active > .menu-link .sw-nav-sub-icon::before {
  color: #0284c7 !important;
  opacity: 1 !important;
}
body.sw-app .aside-menu .menu-link .menu-text {
  color: #0f172a !important;
  font-weight: 650 !important;
  font-size: 14px !important;
  line-height: 1.25 !important;
  padding: 0 !important;
  margin: 0 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.sw-app .aside-menu .menu-item-active > .menu-link .menu-text {
  color: #ffffff !important;
}

body.sw-app .aside-menu .menu-item:not(.menu-item-active) > .menu-link:hover {
  background: rgba(3, 144, 243, 0.1) !important;
  color: var(--sw-brand-deep) !important;
}

body.sw-app .aside-menu .menu-item-active > .menu-link {
  background: linear-gradient(135deg, var(--sw-brand) 0%, var(--sw-brand-deep) 100%) !important;
  color: #fff !important;
  box-shadow: 0 8px 18px rgba(3, 144, 243, 0.28);
}

body.sw-app .aside-menu .menu-nav > .menu-item > .menu-link .menu-text,
body.sw-app .aside-menu .sw-nav-accordion__toggle .menu-text {
  color: #08324f !important;
  font-weight: 700 !important;
}
body.sw-app .aside-menu .menu-nav > .menu-item > .menu-link .sw-nav-icon,
body.sw-app .aside-menu .menu-nav > .menu-item > .menu-link .sw-nav-icon::before {
  color: #08324f !important;
}
body.sw-app .aside-menu .sw-nav-accordion__panel .menu-link .menu-text {
  color: #8eabc4 !important;
  font-weight: 600 !important;
}
body.sw-app .aside-menu .sw-nav-accordion__panel .menu-link .sw-nav-dash {
  color: #a9c2d6 !important;
}
body.sw-app .aside-menu .menu-item-active > .menu-link .menu-text,
body.sw-app .aside-menu .menu-item-active > .menu-link .sw-nav-icon,
body.sw-app .aside-menu .menu-item-active > .menu-link .sw-nav-icon::before,
body.sw-app .aside-menu .menu-item-active > .menu-link .sw-nav-dash {
  color: #ffffff !important;
}

body.sw-app button.sw-nav-accordion__toggle {
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
  text-align: left;
  color: inherit;
}
body.sw-app .sw-nav-chevron {
  width: 8px;
  height: 8px;
  margin-left: auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  opacity: 0.55;
  flex: 0 0 auto;
}
body.sw-app .sw-nav-accordion.is-open > .sw-nav-accordion__toggle .sw-nav-chevron {
  transform: rotate(45deg);
  margin-top: -2px;
}
body.sw-app .sw-nav-accordion__panel {
  display: none;
  list-style: none;
  margin: 2px 0 6px;
  padding: 0 0 0 12px;
}
body.sw-app .sw-nav-accordion.is-open > .sw-nav-accordion__panel {
  display: block;
}
body.sw-app .sw-nav-accordion__panel .menu-link {
  min-height: 34px !important;
  padding: 6px 10px !important;
  font-size: 13px;
}
body.sw-app .sw-nav-accordion__panel .sw-nav-accordion__panel {
  padding-left: 8px;
}

body.sw-app .aside-menu .menu-item-active > .menu-link .sw-nav-dash {
  color: #ffffff !important;
}

/* —— Header —— */
body.sw-app #kt_header.header {
  background: #ffffff !important;
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--sw-line-strong) !important;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
}

body.sw-app #kt_header h4,
body.sw-app .sw-page-title {
  font-weight: 700 !important;
  letter-spacing: -0.02em;
  color: var(--sw-ink) !important;
}

body.sw-app .sw-header-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 64px;
}

.sw-empty {
  text-align: center;
  padding: 22px 14px;
  color: var(--sw-muted);
}

.sw-empty i {
  display: block;
  font-size: 32px !important;
  color: #0369a1 !important;
  margin-bottom: 12px;
  opacity: 1 !important;
}
.sw-empty i::before {
  color: inherit !important;
}

.sw-empty strong {
  display: block;
  color: var(--sw-ink);
  font-size: 16px;
  margin-bottom: 6px;
  font-weight: 700;
}

.sw-empty p {
  margin: 0 auto;
  max-width: 28rem;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.5;
}

body.sw-app .sw-mobile-toggle {
  display: none;
  border: 0;
  background: var(--sw-sky);
  color: var(--sw-brand-deep);
  width: 40px;
  height: 40px;
  border-radius: 12px;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
}

body.sw-app .content {
  padding-top: 12px !important;
  padding-bottom: 24px !important;
}

body.sw-app .container-fluid {
  max-width: 1280px;
}

body.sw-app .gutter-b {
  margin-bottom: 0.85rem !important;
}

/* Compact Metronic chrome that was creating large empty gaps */
body.sw-app #kt_header.header {
  min-height: 56px !important;
  height: 56px !important;
  /* Metronic only fixes the header at ≥992px — keep it fixed on mobile too */
  position: fixed !important;
  top: 0;
  right: 0;
  /* Above aside (99) so topbar dropdowns are never covered */
  z-index: 100;
}
body.sw-app.header-fixed .wrapper {
  padding-top: 56px !important;
}
body.sw-app .sw-page-title {
  padding-top: 10px !important;
  padding-bottom: 10px !important;
  font-size: 1.15rem !important;
  margin: 0 !important;
}
body.sw-app .subheader,
body.sw-app #kt_subheader {
  display: none !important;
}
/* Sidebar spacing handled in the Aside block above — do not re-squash margins here. */
body.sw-app .brand,
body.sw-app #kt_brand {
  min-height: 64px !important;
  height: 64px !important;
  padding: 14px 20px !important;
}
body.sw-app .table tbody td {
  padding-top: 10px !important;
  padding-bottom: 10px !important;
}
body.sw-app .table thead th {
  padding-top: 10px !important;
  padding-bottom: 10px !important;
}
body.sw-app .mb-5,
body.sw-portal .mb-5 { margin-bottom: 0.85rem !important; }
body.sw-app .mb-4,
body.sw-portal .mb-4 { margin-bottom: 0.7rem !important; }
body.sw-app .mb-6,
body.sw-portal .mb-6 { margin-bottom: 1rem !important; }
body.sw-app .p-5,
body.sw-portal .p-5 { padding: 1rem !important; }
body.sw-app .form-group,
body.sw-portal .form-group {
  margin-bottom: 0.85rem !important;
}
body.sw-app .form-group label,
body.sw-portal .form-group label {
  font-weight: 700;
  font-size: 13px;
  color: var(--sw-ink);
  margin-bottom: 4px;
}
/* Portal uses same aside shell as admin (body.sw-app.sw-portal) */
body.sw-portal.sw-app .sw-card {
  margin-bottom: 12px !important;
}
body.sw-portal .brand,
body.sw-portal #kt_brand {
  height: auto !important;
  min-height: 64px !important;
  flex-wrap: wrap;
  align-items: flex-start !important;
  padding-bottom: 10px !important;
}
body.sw-portal .sw-portal-brand-meta {
  color: #0369a1;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  width: 100%;
  padding: 0;
  margin-top: 4px;
}

/* —— Cards / forms / buttons —— */
body.sw-app .card.card-custom,
body.sw-portal .sw-card,
.sw-soft-panel {
  background: var(--sw-surface) !important;
  border: 1px solid var(--sw-line-strong) !important;
  border-radius: var(--sw-radius) !important;
  box-shadow: var(--sw-shadow) !important;
  overflow: hidden;
}

body.sw-app .card.card-custom > .card-header {
  background: transparent !important;
  border-bottom: 1px solid var(--sw-line) !important;
  min-height: 48px;
  padding-top: 10px;
  padding-bottom: 10px;
  padding-left: 16px;
  padding-right: 16px;
}

/* Compact message threads (support / invoices) */
.sw-thread {
  max-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
}
.sw-thread-item {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--sw-line);
}
.sw-thread-item:last-child { border-bottom: 0; }
.sw-thread-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 4px;
}
.sw-thread-meta strong { font-size: 13px; }
.sw-thread-meta span { color: var(--sw-muted); font-size: 11px; font-weight: 600; white-space: nowrap; }
.sw-thread-body {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--sw-ink);
  white-space: pre-wrap;
}
.sw-toolbar {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

body.sw-app .card.card-custom .card-title,
body.sw-portal .sw-card h3 {
  font-weight: 700 !important;
  letter-spacing: -0.02em;
  color: var(--sw-ink) !important;
}

body.sw-app .card.card-custom .card-body,
body.sw-portal .sw-card {
  padding: 16px 18px !important;
}

.sw-card-icon,
body.sw-app .card-title .sw-card-icon,
body.sw-app h3 .sw-card-icon,
body.sw-portal h3 .sw-card-icon {
  color: #0369a1 !important;
  margin-right: 8px;
  font-size: 16px !important;
  vertical-align: -2px;
  opacity: 1 !important;
}
.sw-card-icon::before,
body.sw-app .card-title .sw-card-icon::before {
  color: inherit !important;
}

.sw-list-text .text-muted i,
.sw-list-text .text-muted i::before,
.sw-meta-icon,
.sw-meta-icon::before {
  color: #0284c7 !important;
  opacity: 1 !important;
  font-size: 12px !important;
}

.sw-list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--sw-line);
}
.sw-list-row:last-child { border-bottom: 0; }

.sw-meta-grid {
  display: grid;
  gap: 12px;
}
.sw-meta-grid > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sw-meta-grid span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.sw-meta-grid strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--sw-ink);
}

.sw-license-card {
  border: 1px solid var(--sw-line);
  border-radius: 14px;
  padding: 14px 16px;
  background: #f8fbff;
  margin-top: 12px;
}
.sw-license-card:first-child { margin-top: 8px; }
.sw-license-card__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}
.sw-license-card__title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.sw-license-card__title strong {
  display: block;
  font-size: 15px;
}
.sw-license-card__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.sw-license-card__dates {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--sw-line);
}
.sw-license-card__dates > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 90px;
}
.sw-license-card__dates span.text-muted {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.sw-license-card__arrow {
  color: #94a3b8;
  font-weight: 700;
  margin-top: 12px;
}
.sw-license-card__key {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sw-license-card__key span {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--sw-muted);
}
.sw-license-card__key code {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--sw-line);
  color: #0f172a;
  font-size: 13px;
  word-break: break-all;
}

.sw-list-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}
.sw-list-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #dbeafe;
  color: #0369a1 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 16px !important;
}
.sw-list-icon i,
.sw-list-icon i::before {
  color: inherit !important;
  font-size: inherit !important;
}
.sw-list-text { min-width: 0; }
.sw-list-text a,
.sw-list-text strong {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sw-hero-kicker i,
.sw-hero-kicker i::before {
  color: #0369a1 !important;
  font-size: 13px !important;
}
.sw-btn-icon {
  margin-right: 6px;
  color: inherit !important;
}
.sw-icon-btn i,
.sw-icon-btn i::before {
  color: #0369a1 !important;
  font-size: 17px !important;
}

body.sw-app .btn-primary,
body.sw-portal .btn-primary,
.sw-btn-primary {
  background: linear-gradient(135deg, var(--sw-brand) 0%, var(--sw-brand-deep) 100%) !important;
  border: none !important;
  border-radius: 999px !important;
  font-weight: 700 !important;
  box-shadow: 0 10px 22px rgba(3, 144, 243, 0.22);
  padding-left: 1.15rem !important;
  padding-right: 1.15rem !important;
}

body.sw-app .btn-light-primary,
body.sw-portal .btn-light-primary {
  background: var(--sw-sky) !important;
  color: var(--sw-brand-deep) !important;
  border: 1px solid rgba(3, 144, 243, 0.18) !important;
  border-radius: 999px !important;
  font-weight: 700 !important;
}

body.sw-app .form-control,
body.sw-portal .form-control {
  border-radius: 12px !important;
  border-color: #cfe4f8 !important;
  background: #fff !important;
}

body.sw-app .form-control:focus,
body.sw-portal .form-control:focus {
  border-color: var(--sw-brand) !important;
  box-shadow: 0 0 0 3px rgba(3, 144, 243, 0.14) !important;
}

body.sw-app .label-light-primary,
body.sw-app .badge-light-primary,
body.sw-portal .badge-light-primary,
body.sw-app .label-light-success,
body.sw-portal .badge-light-success,
body.sw-portal .badge-light-warning,
body.sw-portal .badge-light-secondary {
  border-radius: 999px !important;
  font-weight: 700 !important;
}

body.sw-app .label-light-primary,
body.sw-app .badge-light-primary {
  background: var(--sw-sky) !important;
  color: var(--sw-brand-deep) !important;
}

body.sw-portal .badge-light-success {
  background: rgba(16, 185, 129, 0.14) !important;
  color: #047857 !important;
}

body.sw-portal .badge-light-warning {
  background: rgba(245, 158, 11, 0.16) !important;
  color: #b45309 !important;
}

body.sw-portal .badge-light-secondary {
  background: rgba(100, 116, 139, 0.14) !important;
  color: #475569 !important;
}

body.sw-app .table thead th,
body.sw-portal .table thead th {
  font-weight: 700 !important;
  font-size: 11px !important;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--sw-muted) !important;
  border-top: 0 !important;
  border-bottom: 1px solid var(--sw-line) !important;
  white-space: nowrap;
  padding-top: 12px !important;
  padding-bottom: 12px !important;
}

body.sw-app .table tbody td,
body.sw-portal .table tbody td {
  border-top-color: var(--sw-line) !important;
  vertical-align: middle !important;
  font-weight: 600;
  padding-top: 14px !important;
  padding-bottom: 14px !important;
}

body.sw-app .table-responsive {
  border-radius: 12px;
}

body.sw-app a:not(.btn):not(.menu-link):not(.brand-logo):not(.sw-nav a),
body.sw-portal a:not(.btn):not(.sw-nav a) {
  color: var(--sw-brand-deep);
}

body.sw-app .wrapper,
body.sw-app #kt_wrapper {
  background: transparent !important;
}

/* —— Hero / stats (light sky) —— */
.sw-hero {
  position: relative;
  border-radius: 16px;
  padding: 14px 18px;
  margin-bottom: 12px;
  overflow: hidden;
  color: var(--sw-ink);
  background:
    radial-gradient(circle at 92% 10%, rgba(3, 144, 243, 0.18), transparent 42%),
    linear-gradient(135deg, #ffffff 0%, #f4f9ff 60%, #eaf4ff 100%);
  border: 1px solid var(--sw-line-strong);
  box-shadow: var(--sw-shadow);
}

.sw-hero::after {
  content: "";
  position: absolute;
  right: -40px;
  bottom: -60px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(3, 144, 243, 0.12);
  pointer-events: none;
}

.sw-hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--sw-brand-deep);
  margin-bottom: 6px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(3, 144, 243, 0.18);
  padding: 5px 10px;
  border-radius: 999px;
  position: relative;
  z-index: 1;
}
.sw-hero-kicker i { font-size: 12px; color: var(--sw-brand); }

.sw-hero h1,
.sw-hero .sw-hero-title {
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: clamp(1.35rem, 2vw, 1.75rem);
  margin: 0 0 6px;
  color: var(--sw-ink);
  background: none;
  -webkit-text-fill-color: unset;
  position: relative;
  z-index: 1;
}

.sw-hero p {
  margin: 0;
  max-width: 52rem;
  color: var(--sw-muted);
  font-size: 14px;
  line-height: 1.5;
  position: relative;
  z-index: 1;
}

.sw-stat-row { margin-left: -8px; margin-right: -8px; }
.sw-stat-row > [class*="col-"] { padding-left: 8px; padding-right: 8px; }

.sw-flow-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.sw-flow-step {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #f0f9ff;
  border: 1px solid rgba(3, 144, 243, 0.16);
  color: var(--sw-ink) !important;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none !important;
}
.sw-flow-step span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--sw-brand);
  color: #fff;
  font-size: 11px;
}
.sw-flow-step:hover {
  background: #e0f2fe;
}

.sw-alert-band {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, #eff6ff 0%, #f8fbff 100%);
  border: 1px solid var(--sw-line-strong);
  margin-bottom: 4px;
}
.sw-alert-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none !important;
  color: var(--sw-ink) !important;
  background: #fff;
  border: 1px solid var(--sw-line);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}
.sw-alert-chip i { font-size: 14px !important; }
.sw-alert-chip.is-warning { border-color: rgba(217, 119, 6, 0.28); color: #92400e !important; background: #fffbeb; }
.sw-alert-chip.is-danger { border-color: rgba(220, 38, 38, 0.25); color: #991b1b !important; background: #fef2f2; }
.sw-alert-chip.is-info { border-color: rgba(3, 144, 243, 0.28); color: #075985 !important; background: #eff6ff; }

a.sw-stat-linkable {
  display: block;
  text-decoration: none !important;
  color: inherit !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
a.sw-stat-linkable:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
}

.sw-stat {
  border-radius: 14px;
  padding: 16px 16px 14px;
  background: var(--sw-surface);
  border: 1px solid var(--sw-line);
  box-shadow: var(--sw-shadow);
  height: 100%;
  position: relative;
  overflow: hidden;
}

.sw-stat::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--sw-brand), #7dd3fc);
}

.sw-stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #dbeafe;
  color: #0369a1 !important;
  margin-bottom: 10px;
  font-size: 18px !important;
}
.sw-stat-icon i,
.sw-stat-icon i::before {
  color: inherit !important;
  font-size: inherit !important;
}
.sw-stat.is-brand .sw-stat-icon,
.sw-stat.is-ink .sw-stat-icon {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff !important;
}
.sw-stat.is-brand .sw-stat-icon i,
.sw-stat.is-brand .sw-stat-icon i::before,
.sw-stat.is-ink .sw-stat-icon i,
.sw-stat.is-ink .sw-stat-icon i::before {
  color: #ffffff !important;
}

.sw-stat .sw-stat-label {
  color: var(--sw-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.sw-stat .sw-stat-value {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--sw-ink);
  line-height: 1.1;
}
.sw-stat .sw-stat-value-sm { font-size: 1.25rem !important; }

/* Finance module */
.sw-finance-payer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--sw-line);
}
.sw-finance-payer:last-child { border-bottom: 0; }
.sw-finance-amount {
  white-space: nowrap;
  color: #0369a1;
  font-size: 15px;
}
.sw-finance-bar {
  margin-top: 8px;
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  max-width: 280px;
}
.sw-finance-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #0390f3, #0270c9);
}
.sw-stat .text-white-50 { color: rgba(255, 255, 255, 0.78) !important; font-weight: 600; }
.sw-stat-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-weight: 700;
  font-size: 13px;
  color: var(--sw-brand-deep) !important;
  text-decoration: none;
}
.sw-stat.is-brand .sw-stat-link,
.sw-stat.is-ink .sw-stat-link { color: #fff !important; }

.sw-stat.is-brand {
  background: linear-gradient(135deg, var(--sw-brand) 0%, #38bdf8 100%);
  border: none;
  color: #fff;
  box-shadow: 0 12px 24px rgba(3, 144, 243, 0.22);
}
.sw-stat.is-brand::before { display: none; }
.sw-stat.is-brand .sw-stat-label { color: rgba(255, 255, 255, 0.85); }
.sw-stat.is-brand .sw-stat-value { color: #fff; }

.sw-stat.is-ink {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  border: none;
  color: #fff;
}
.sw-stat.is-ink::before { display: none; }
.sw-stat.is-ink .sw-stat-label { color: rgba(255, 255, 255, 0.85); }
.sw-stat.is-ink .sw-stat-value { color: #fff; }

:root {
  --sw-impersonation-h: 48px;
  --sw-header-h: 56px;
}

.sw-impersonation {
  background: linear-gradient(90deg, #38bdf8, #0390f3);
  color: #fff;
  padding: 10px 16px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1200;
  min-height: var(--sw-impersonation-h);
  box-sizing: border-box;
}

/* Fixed chrome sits below the impersonation strip so the top navbar stays visible */
body.sw-app.sw-impersonating {
  padding-top: var(--sw-impersonation-h) !important;
  box-sizing: border-box;
}
body.sw-app.sw-impersonating.header-fixed .header,
body.sw-app.sw-impersonating.header-fixed #kt_header {
  top: var(--sw-impersonation-h) !important;
  z-index: 100 !important;
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  height: var(--sw-header-h) !important;
  min-height: var(--sw-header-h) !important;
}
body.sw-app.sw-impersonating.header-fixed .wrapper,
body.sw-app.sw-impersonating.header-fixed #kt_wrapper {
  /* body padding already reserved the strip; keep only header height here */
  padding-top: var(--sw-header-h) !important;
}
body.sw-app.sw-impersonating.aside-fixed .aside,
body.sw-app.sw-impersonating.aside-fixed #kt_aside {
  top: var(--sw-impersonation-h) !important;
  height: calc(100vh - var(--sw-impersonation-h)) !important;
  max-height: calc(100vh - var(--sw-impersonation-h)) !important;
}

/* —— Portal —— */
.sw-portal-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.sw-portal-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  padding: 16px 18px;
  border-radius: 18px;
  background: linear-gradient(135deg, #ffffff 0%, var(--sw-sky) 100%);
  border: 1px solid var(--sw-line);
  box-shadow: var(--sw-shadow);
  flex-wrap: wrap;
}

.sw-portal-top img { height: 32px; width: auto; filter: none; }
.sw-portal-top .sw-portal-meta {
  color: var(--sw-brand-deep);
  font-size: 13px;
  font-weight: 700;
  margin-top: 4px;
}
.sw-portal-top .sw-portal-user {
  color: var(--sw-ink);
  font-weight: 600;
  margin-right: 12px;
}

.sw-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.sw-nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--sw-line);
  color: var(--sw-ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  transition: all 0.15s ease;
}

.sw-nav a i,
.sw-nav a i::before {
  color: #0369a1 !important;
  font-size: 15px !important;
  opacity: 1 !important;
}
.sw-nav a:hover { border-color: rgba(3, 144, 243, 0.45); color: var(--sw-brand-deep); background: var(--sw-sky); }
.sw-nav a.active {
  background: linear-gradient(135deg, var(--sw-brand) 0%, var(--sw-brand-deep) 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 18px rgba(3, 144, 243, 0.22);
}
.sw-nav a.active i,
.sw-nav a.active i::before { color: #fff !important; }

/* Table / card action buttons — keep icons readable */
body.sw-app .btn i[class^="icon-"],
body.sw-app .btn i[class*=" icon-"],
body.sw-portal .btn i[class^="icon-"],
body.sw-portal .btn i[class*=" icon-"] {
  color: inherit !important;
  font-size: 13px !important;
  margin-right: 4px;
  opacity: 1 !important;
  vertical-align: -1px;
}
body.sw-app .btn-primary i[class^="icon-"],
body.sw-app .btn-primary i[class*=" icon-"],
body.sw-app .btn-primary i::before,
body.sw-portal .btn-primary i[class^="icon-"],
body.sw-portal .btn-primary i[class*=" icon-"],
body.sw-portal .btn-primary i::before {
  color: #fff !important;
}
body.sw-app .table td .sw-row-icon,
body.sw-portal .table td .sw-row-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #dbeafe;
  color: #0369a1 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px !important;
  margin-right: 10px;
  vertical-align: middle;
}
body.sw-app .table td .sw-row-icon i,
body.sw-app .table td .sw-row-icon i::before,
body.sw-portal .table td .sw-row-icon i,
body.sw-portal .table td .sw-row-icon i::before {
  color: inherit !important;
}

body.sw-portal .sw-card {
  padding: 20px 22px !important;
  margin-bottom: 16px;
}

/* —— Auth (light sky) —— */
body.sw-login {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 12% 18%, rgba(56, 189, 248, 0.35), transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(3, 144, 243, 0.18), transparent 42%),
    linear-gradient(160deg, #f7fbff 0%, #e8f4ff 45%, #dbeafe 100%);
  color: var(--sw-ink);
}

.sw-login-wrap,
.sw-login-wrap * { box-sizing: border-box; }
.sw-login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, 1.1fr) minmax(320px, 0.9fr);
  align-items: stretch;
}
.sw-login-branded .sw-login-brand {
  background: linear-gradient(165deg, var(--sw-brand) 0%, var(--sw-brand-deep) 100%);
  color: #fff;
}
.sw-login-branded .sw-login-brand h1,
.sw-login-branded .sw-login-lockup strong { color: #fff; }
.sw-login-branded .sw-login-brand p { color: rgba(255, 255, 255, 0.88); }
.sw-login-branded .sw-login-brand .sw-login-mark {
  background: #fff;
  color: var(--sw-brand-deep);
}
.sw-login-branded .sw-login-lockup img {
  height: 92px;
  max-width: min(100%, 360px);
  padding: 12px 16px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.16);
}
.sw-login-branded .sw-login-points li { color: rgba(255, 255, 255, 0.94); }
.sw-login-branded .sw-login-points li::before { background: #fff; }

@media (max-width: 991px) {
  .sw-login-wrap { grid-template-columns: 1fr; }
  .sw-login-brand { padding: 40px 24px 12px !important; text-align: center; align-items: center; }
  .sw-login-points { text-align: left; }
}

.sw-login-brand {
  padding: 64px 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.sw-login-brand img {
  height: 72px;
  width: auto;
  max-width: 280px;
  object-fit: contain;
  margin-bottom: 0;
  filter: none;
}
.sw-login-lockup,
.sw-login-card-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.sw-login-lockup { margin-bottom: 22px; }
.sw-login-lockup strong {
  display: block;
  font-size: 1.15rem;
  color: var(--sw-ink);
  line-height: 1.25;
}
.sw-login-mark {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--sw-brand);
  color: #fff;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 0.04em;
  flex: 0 0 auto;
}
.sw-login-card-brand {
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--sw-line);
}
.sw-login-card-brand {
  align-items: flex-start;
  flex-direction: column;
  gap: 10px;
}
.sw-login-card-brand img {
  height: 58px;
  width: auto;
  max-width: 240px;
  object-fit: contain;
}
.sw-login-card-brand .sw-login-mark { width: 48px; height: 48px; border-radius: 14px; font-size: 1rem; }
.sw-login-card-brand strong { display: block; font-size: 1rem; line-height: 1.25; }

.sw-login-brand h1 {
  font-size: clamp(1.9rem, 3.2vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 14px;
  color: var(--sw-ink);
  background: none;
  -webkit-text-fill-color: unset;
}

.sw-login-brand p {
  color: var(--sw-muted);
  max-width: 28rem;
  line-height: 1.6;
  font-weight: 600;
}

.sw-login-points {
  list-style: none;
  padding: 0;
  margin: 28px 0 0;
  display: grid;
  gap: 10px;
}
.sw-login-points li {
  color: #334155;
  font-weight: 600;
  font-size: 14px;
  padding-left: 22px;
  position: relative;
}
.sw-login-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sw-brand);
}

.sw-login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.sw-login-card {
  width: 100%;
  max-width: 440px;
  box-sizing: border-box;
  background: #fff;
  color: var(--sw-ink);
  border-radius: 22px;
  padding: 36px 32px;
  border: 1px solid var(--sw-line);
  box-shadow: 0 18px 40px rgba(2, 112, 201, 0.12);
}

.sw-login-card h2 { font-weight: 700; letter-spacing: -0.02em; margin: 0 0 6px; font-size: 1.7rem; }
.sw-login-card .sw-sub { color: var(--sw-muted); margin-bottom: 22px; font-weight: 600; font-size: 14px; line-height: 1.45; }
.sw-login-card label { display: block; font-weight: 700; margin-bottom: 8px; font-size: 14px; }
.sw-login-card .sw-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.sw-login-card .sw-label-row label { display: inline; margin-bottom: 0; }
.sw-login-card .sw-label-row .sw-auth-link { margin-left: auto; white-space: nowrap; }
.sw-login-card input[type="email"],
.sw-login-card input[type="password"],
.sw-login-card input[type="text"] {
  width: 100%;
  border: 1px solid #cfe4f8;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
  font: inherit;
  box-sizing: border-box;
  background: #fbfdff;
}
.sw-login-card input:focus {
  outline: none;
  border-color: var(--sw-brand);
  box-shadow: 0 0 0 3px rgba(3, 144, 243, 0.14);
  background: #fff;
}
.sw-login-card .sw-check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 14px;
  color: var(--sw-muted);
  margin: 4px 0 18px;
  cursor: pointer;
}
.sw-login-card .sw-check input { width: auto; margin: 0; accent-color: var(--sw-brand); }
.sw-login-card button {
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 14px 18px;
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  background: linear-gradient(135deg, var(--sw-brand), var(--sw-brand-deep));
  box-shadow: 0 12px 22px rgba(3, 144, 243, 0.25);
  cursor: pointer;
}
.sw-auth-link { color: var(--sw-brand-deep); font-weight: 700; text-decoration: none; font-size: 13px; }
.sw-auth-link:hover { text-decoration: underline; }
.sw-auth-footer {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  font-weight: 600;
  font-size: 14px;
  color: var(--sw-muted);
}
.sw-login-card .sw-back {
  display: inline-block;
  margin-top: 14px;
  color: var(--sw-brand-deep);
  font-weight: 700;
  text-decoration: none;
  font-size: 14px;
}

.sw-alert-success {
  background: #e9f9ee;
  color: #1a7f3c;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-weight: 600;
}
.sw-alert-danger {
  background: #fee2e2;
  color: #991b1b;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-weight: 600;
}

.sw-activity-item {
  border-bottom: 1px solid var(--sw-line);
  padding: 12px 0;
}
.sw-activity-item:last-child { border-bottom: 0; }
.sw-activity-item .meta { color: var(--sw-muted); font-size: 12px; font-weight: 600; }

.sw-aside-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  z-index: 97;
}

/* —— Mobile —— */
@media (max-width: 991.98px) {
  body.sw-app .sw-mobile-toggle { display: inline-flex; }

  body.sw-app .aside,
  body.sw-app #kt_aside {
    position: fixed !important;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100vh !important;
    max-height: 100vh !important;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    z-index: 99;
  }

  /* Keep mobile drawer under the impersonation strip */
  body.sw-app.sw-impersonating .aside,
  body.sw-app.sw-impersonating #kt_aside {
    top: var(--sw-impersonation-h) !important;
    height: calc(100vh - var(--sw-impersonation-h)) !important;
    max-height: calc(100vh - var(--sw-impersonation-h)) !important;
  }

  body.sw-app.sw-aside-open .aside {
    transform: translateX(0);
  }

  body.sw-app.sw-aside-open .sw-aside-backdrop {
    display: block;
  }

  body.sw-app.aside-fixed .wrapper,
  body.sw-app.aside-fixed #kt_wrapper {
    padding-left: 0 !important;
  }

  body.sw-app.aside-fixed.header-fixed .header,
  body.sw-app.aside-fixed.header-fixed #kt_header {
    left: 0 !important;
  }

  body.sw-app .topbar .sw-user-name { display: none; }

  body.sw-app .content { padding-top: 16px !important; }

  .sw-hero { padding: 20px 18px; margin-bottom: 16px; }

  .sw-portal-top { padding: 14px; }
  .sw-nav a { flex: 1 1 auto; justify-content: center; }
}

@media (max-width: 575.98px) {
  body.sw-app #kt_header .form-control { display: none !important; }
  .sw-login-card { padding: 28px 20px; border-radius: 18px; }
}

/* —— Topbar: notifications + profile —— */
.sw-topbar-widgets {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 40;
}
.sw-dues-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 12px;
  border-radius: 14px;
  border: 1px solid var(--sw-line);
  background: #fff;
  color: var(--sw-ink);
  text-decoration: none;
  line-height: 1.1;
}
.sw-dues-chip i,
.sw-dues-chip i::before { color: var(--sw-brand-deep) !important; font-size: 16px; }
.sw-dues-chip-label {
  display: block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--sw-muted);
}
.sw-dues-chip strong { font-size: 13px; font-weight: 800; }
.sw-dues-chip.is-due { background: #fff5f5; border-color: #fecaca; }
.sw-dues-chip.is-due strong { color: #b91c1c; }
.sw-dues-chip.is-clear strong { color: #047857; }
.sw-dues-chip:hover { text-decoration: none; color: inherit; }

.sw-dropdown { position: relative; }

.sw-icon-btn,
.sw-profile-btn {
  border: 1px solid var(--sw-line);
  background: #fff;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  color: var(--sw-ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.sw-icon-btn {
  width: 42px;
  height: 42px;
  justify-content: center;
  position: relative;
  font-size: 16px;
  color: var(--sw-brand-deep);
}

.sw-profile-btn {
  padding: 6px 12px 6px 6px;
  min-height: 42px;
}

.sw-icon-btn:hover,
.sw-profile-btn:hover,
.sw-dropdown.is-open .sw-icon-btn,
.sw-dropdown.is-open .sw-profile-btn {
  border-color: rgba(3, 144, 243, 0.45);
  box-shadow: 0 6px 16px rgba(3, 144, 243, 0.12);
}

.sw-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.sw-profile-meta {
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
  text-align: left;
}

.sw-profile-name { font-weight: 700; font-size: 13px; }
.sw-profile-role { font-size: 11px; color: var(--sw-muted); font-weight: 600; }
.sw-caret { font-size: 11px; color: var(--sw-muted); }

.sw-dropdown-panel {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(360px, calc(100vw - 24px));
  background: #fff;
  border: 1px solid var(--sw-line);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(2, 112, 201, 0.14);
  overflow: hidden;
  z-index: 50;
}

.sw-dropdown.is-open .sw-dropdown-panel { display: block; }

.sw-dropdown-head,
.sw-dropdown-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: var(--sw-sky);
  border-bottom: 1px solid var(--sw-line);
  font-size: 13px;
}

.sw-dropdown-footer {
  border-bottom: 0;
  border-top: 1px solid var(--sw-line);
  justify-content: center;
  font-weight: 700;
  color: var(--sw-brand-deep);
  text-decoration: none;
}

.sw-link-btn {
  border: 0;
  background: transparent;
  color: var(--sw-brand-deep);
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  padding: 0;
}

.sw-notif-list { max-height: 320px; overflow: auto; }

.sw-notif-item {
  padding: 12px 14px;
  border-bottom: 1px solid var(--sw-line);
}

.sw-notif-item.is-unread { background: rgba(3, 144, 243, 0.06); }
.sw-notif-title { font-weight: 700; font-size: 13px; color: var(--sw-ink); }
.sw-notif-body { font-size: 12px; color: var(--sw-muted); font-weight: 600; margin-top: 4px; line-height: 1.4; }
.sw-notif-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  font-size: 11px;
  color: #94a3b8;
  font-weight: 600;
}
.sw-notif-actions { display: inline-flex; gap: 10px; align-items: center; }
.sw-notif-actions a { color: var(--sw-brand-deep); font-weight: 700; }
.sw-notif-empty { padding: 28px 16px; text-align: center; color: var(--sw-muted); font-weight: 600; font-size: 13px; }

.sw-profile-panel { width: min(280px, calc(100vw - 24px)); }
.sw-profile-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-bottom: 1px solid var(--sw-line);
  background: linear-gradient(135deg, #fff, var(--sw-sky));
}
.sw-profile-card strong { display: block; font-size: 14px; }

.sw-dropdown-link {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 0;
  background: transparent;
  color: var(--sw-ink);
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  text-align: left;
  cursor: pointer;
}
.sw-dropdown-link i { color: var(--sw-brand); width: 16px; text-align: center; }
.sw-dropdown-link:hover { background: var(--sw-sky); color: var(--sw-brand-deep); }
.sw-dropdown-link.is-danger { color: #b91c1c; border-top: 1px solid var(--sw-line); }
.sw-dropdown-link.is-danger i { color: #ef4444; }

.sw-portal-top .sw-topbar-widgets { margin-left: auto; }

/* —— Avatars (photo or user icon) —— */
.sw-avatar-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--sw-sky), #dbeafe);
  border: 1px solid var(--sw-line);
  color: var(--sw-brand-deep);
}
.sw-avatar-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.sw-avatar-wrap .sw-avatar-fallback {
  width: 100%;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e0f2fe, #bae6fd);
  color: var(--sw-brand-deep);
}
.sw-avatar-wrap .sw-avatar-fallback i {
  font-size: 0.72em;
  line-height: 1;
  color: inherit;
}
.sw-answer-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--sw-ink, #0b1f3a);
}
.sw-answer-title span {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sw-brand, #0390f3);
}
.sw-answer-heading {
  margin: 22px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--sw-line, #e4ebf3);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sw-ink, #0b1f3a);
}
.sw-answer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 18px;
}
.sw-answer {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--sw-line, #e4ebf3);
  border-radius: 12px;
  background: #f8fbfe;
}
.sw-answer-label {
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #5b6b80;
}
.sw-answer-value {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--sw-ink, #0b1f3a);
  overflow-wrap: anywhere;
}
@media (max-width: 720px) {
  .sw-answer-grid { grid-template-columns: 1fr; }
}
.sw-avatar-xs { width: 28px; height: 28px; border-radius: 50%; font-size: 12px; }
.sw-avatar-sm { width: 36px; height: 36px; border-radius: 50%; font-size: 14px; }
.sw-avatar-md { width: 44px; height: 44px; border-radius: 50%; font-size: 18px; }
.sw-avatar-lg { width: 72px; height: 72px; border-radius: 50%; font-size: 28px; }
.sw-avatar-xl { width: 88px; height: 88px; border-radius: 50%; font-size: 34px; }

/* Avatar uploader + circular crop */
.sw-avatar-uploader__row {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.sw-avatar-uploader__preview {
  box-shadow: 0 0 0 3px #fff, 0 0 0 4px var(--sw-line);
}
.sw-avatar-uploader__preview .sw-avatar-fallback {
  border-radius: 50%;
}
.sw-avatar-uploader__actions .btn { margin-right: 6px; margin-bottom: 4px; }

.sw-avatar-modal {
  position: fixed;
  inset: 0;
  z-index: 11000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.55);
}
.sw-avatar-modal.is-open { display: flex; }
body.sw-avatar-modal-open { overflow: hidden; }
.sw-avatar-modal__dialog {
  width: min(560px, 100%);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
  overflow: hidden;
}
.sw-avatar-modal__head,
.sw-avatar-modal__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--sw-line);
}
.sw-avatar-modal__foot {
  border-bottom: 0;
  border-top: 1px solid var(--sw-line);
  justify-content: flex-end;
}
.sw-avatar-modal__body { padding: 16px 18px; }
.sw-avatar-modal__stage {
  width: 100%;
  max-height: 360px;
  background: #0f172a;
  border-radius: 12px;
  overflow: hidden;
}
.sw-avatar-modal__stage img {
  display: block;
  max-width: 100%;
}
/* Circular crop mask overlay */
.sw-avatar-modal .cropper-view-box,
.sw-avatar-modal .cropper-face {
  border-radius: 50%;
}
.sw-avatar-modal .cropper-view-box {
  outline: 0;
  box-shadow: 0 0 0 1px #39f;
}
.sw-avatar-modal .cropper-face {
  background-color: inherit !important;
}

/* legacy class aliases */
.sw-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sw-profile-btn .sw-avatar-wrap { margin-right: 0; }
.sw-chat-avatar .sw-avatar-wrap,
.sw-chat-msg-avatar .sw-avatar-wrap { width: 100%; height: 100%; border-radius: 50%; }
.sw-chat-avatar { border: 0; background: transparent; }
.sw-chat-msg-avatar { background: transparent; }

.sw-portal-shell { padding-top: 16px; padding-bottom: 32px; }
.sw-empty { padding: 28px 16px; }
.sw-empty i { font-size: 26px; }

/* —— WhatsApp-style messenger —— */
body.sw-app:has(.sw-chat-page) .content {
  padding-top: 8px !important;
  padding-bottom: 8px !important;
}
body.sw-app:has(.sw-chat-page) .content > .container-fluid {
  max-width: none;
  padding-left: 12px;
  padding-right: 12px;
}

.sw-chat-page {
  margin: 0;
}

.sw-chat-page.is-portal {
  margin-top: 0;
}

.sw-chat {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  height: calc(100vh - 96px);
  max-height: calc(100vh - 96px);
  min-height: 420px;
  background: #fff;
  border: 1px solid var(--sw-line-strong);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--sw-shadow);
  align-items: stretch;
}

.sw-chat-page.is-portal .sw-chat {
  height: calc(100vh - 200px);
  max-height: calc(100vh - 200px);
}

.sw-chat-sidebar,
.sw-chat-panel {
  min-width: 0;
  min-height: 0;
  max-height: 100%;
  height: 100%;
  overflow: hidden;
}

.sw-chat-sidebar {
  border-right: 1px solid var(--sw-line-strong);
  background: #ffffff;
  display: flex;
  flex-direction: column;
}

.sw-chat-sidebar-head {
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--sw-line);
}

.sw-chat-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--sw-ink);
  margin-bottom: 10px;
}
.sw-chat-title i,
.sw-chat-title i::before {
  color: #0369a1 !important;
  font-size: 18px !important;
  opacity: 1 !important;
}

.sw-chat-search {
  position: relative;
}
.sw-chat-search i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 13px;
}
.sw-chat-search input {
  width: 100%;
  border: 1px solid var(--sw-line);
  background: #fff;
  border-radius: 999px;
  padding: 10px 12px 10px 34px;
  font: inherit;
  font-weight: 600;
  font-size: 13px;
}
.sw-chat-search input:focus {
  outline: none;
  border-color: var(--sw-brand);
  box-shadow: 0 0 0 3px rgba(3, 144, 243, 0.12);
}

.sw-chat-thread-list {
  overflow-y: auto;
  flex: 1;
}

.sw-chat-thread {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid rgba(2, 112, 201, 0.06);
  transition: background 0.12s ease;
}
.sw-chat-thread:hover { background: rgba(3, 144, 243, 0.06); }
.sw-chat-thread.is-active {
  background: rgba(3, 144, 243, 0.12);
  border-left: 3px solid var(--sw-brand);
}

.sw-chat-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: #e0f2fe;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(2, 112, 201, 0.12);
}
.sw-chat-type-icon {
  width: 100%;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e0f2fe, #bae6fd);
  color: #0369a1;
  font-size: 18px;
}
.sw-chat-type-icon i,
.sw-chat-type-icon i::before {
  color: inherit !important;
  font-size: inherit !important;
}
.sw-chat-avatar.is-type-support .sw-chat-type-icon {
  background: linear-gradient(135deg, #dbeafe, #93c5fd);
}
.sw-chat-avatar.is-type-project_internal .sw-chat-type-icon,
.sw-chat-avatar.is-type-project_client .sw-chat-type-icon {
  background: linear-gradient(135deg, #e0f2fe, #7dd3fc);
}
.sw-chat-avatar img,
.sw-chat-msg-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sw-chat-avatar .sw-avatar-fallback {
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.sw-chat-thread-body { min-width: 0; flex: 1; }
.sw-chat-thread-top,
.sw-chat-thread-bottom {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}
.sw-chat-thread-top strong {
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sw-chat-thread-top small { color: #94a3b8; font-weight: 600; font-size: 11px; flex-shrink: 0; }
.sw-chat-preview {
  color: var(--sw-muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 70%;
}
.sw-chat-type {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--sw-brand-deep);
  background: var(--sw-sky);
  border-radius: 999px;
  padding: 2px 7px;
  flex-shrink: 0;
}

.sw-chat-empty-side,
.sw-chat-empty-thread,
.sw-chat-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--sw-muted);
  padding: 32px 20px;
  gap: 8px;
  height: 100%;
}
.sw-chat-empty-side i,
.sw-chat-empty-thread i,
.sw-chat-placeholder-card i,
.sw-chat-empty-side i::before,
.sw-chat-empty-thread i::before,
.sw-chat-placeholder-card i::before {
  font-size: 30px !important;
  color: #0369a1 !important;
  margin-bottom: 6px;
  opacity: 1 !important;
}
.sw-chat-placeholder-card {
  max-width: 320px;
}
.sw-chat-placeholder-card h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--sw-ink);
  margin: 0 0 8px;
}
.sw-chat-placeholder-card p {
  margin: 0;
  font-weight: 600;
  line-height: 1.5;
}

.sw-chat-panel {
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.1)),
    radial-gradient(circle at 12px 12px, rgba(3, 144, 243, 0.07) 1.2px, transparent 1.4px) 0 0 / 18px 18px,
    var(--sw-chat-wall);
}

.sw-chat-panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #ffffff;
  border-bottom: 1px solid var(--sw-line-strong);
  flex: 0 0 auto;
  z-index: 2;
}
.sw-chat-panel-meta { min-width: 0; flex: 1; }
.sw-chat-panel-meta strong {
  display: block;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sw-chat-panel-meta small {
  color: var(--sw-muted);
  font-weight: 600;
  font-size: 12px;
}
.sw-chat-project-link {
  font-weight: 700;
  font-size: 12px;
  color: var(--sw-brand-deep);
  text-decoration: none;
  background: var(--sw-sky);
  border: 1px solid var(--sw-line);
  border-radius: 999px;
  padding: 6px 12px;
}
.sw-chat-back {
  border: 0;
  background: var(--sw-sky);
  width: 36px;
  height: 36px;
  border-radius: 12px;
  color: var(--sw-brand-deep);
  cursor: pointer;
}

.sw-chat-messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overscroll-behavior: contain;
}

.sw-chat-row {
  display: flex;
  gap: 8px;
  max-width: min(82%, 560px);
  align-items: flex-end;
  flex: 0 0 auto;
}
.sw-chat-row.is-mine {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.sw-chat-row.is-theirs { align-self: flex-start; }

.sw-chat-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.sw-chat-bubble {
  border-radius: 16px;
  padding: 10px 12px 8px;
  box-shadow: 0 4px 12px rgba(2, 112, 201, 0.08);
  position: relative;
}
.sw-chat-row.is-mine .sw-chat-bubble {
  background: linear-gradient(135deg, #0390f3, #0270c9);
  color: #fff;
  border-bottom-right-radius: 6px;
}
.sw-chat-row.is-theirs .sw-chat-bubble {
  background: #fff;
  color: var(--sw-ink);
  border: 1px solid var(--sw-line);
  border-bottom-left-radius: 6px;
}
.sw-chat-bubble-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--sw-brand-deep);
  margin-bottom: 4px;
}
.sw-chat-bubble-text {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  word-break: break-word;
}
.sw-chat-bubble-time {
  margin-top: 6px;
  font-size: 10px;
  font-weight: 600;
  opacity: 0.75;
  text-align: right;
}

.sw-chat-composer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
  padding: 12px 14px;
  background: #ffffff;
  border-top: 1px solid var(--sw-line-strong);
  flex: 0 0 auto;
  z-index: 2;
}
.sw-chat-composer textarea {
  flex: 1;
  resize: none;
  min-height: 44px;
  max-height: 140px;
  border: 1px solid var(--sw-line);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  font-weight: 600;
  background: #fbfdff;
}
.sw-chat-composer textarea:focus {
  outline: none;
  border-color: var(--sw-brand);
  box-shadow: 0 0 0 3px rgba(3, 144, 243, 0.12);
  background: #fff;
}
.sw-avatar-initials {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #0390f3);
  color: #fff !important;
  font-weight: 800;
  font-size: 0.72em;
  letter-spacing: 0.02em;
}
/* [hidden] must win over .sw-avatar-initials { display: inline-flex !important } */
.sw-avatar-fallback[hidden],
.sw-avatar-wrap img + .sw-avatar-fallback[hidden] {
  display: none !important;
}
.sw-chat-thread.has-unread .sw-chat-preview { font-weight: 800; color: var(--sw-ink); }
.sw-chat-unread {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #25d366;
  flex-shrink: 0;
  margin-left: 4px;
}
.sw-chat-attach-image {
  display: block;
  margin: 0 0 8px;
  border-radius: 12px;
  overflow: hidden;
  max-width: 260px;
}
.sw-chat-attach-image img {
  display: block;
  width: 100%;
  max-height: 240px;
  object-fit: cover;
}
.sw-chat-attach-file {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.16);
  color: inherit;
  text-decoration: none;
  max-width: 280px;
}
.sw-chat-row.is-theirs .sw-chat-attach-file {
  background: #f1f5f9;
  border: 1px solid var(--sw-line);
}
.sw-chat-attach-file strong { display: block; font-size: 13px; }
.sw-chat-attach-file small { opacity: 0.75; font-size: 11px; }
.sw-chat-ticks { margin-left: 4px; letter-spacing: -1px; }
.sw-chat-ticks.is-read { color: #67e8f9; }
.sw-chat-composer-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  width: 100%;
}
.sw-chat-attach-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eef6ff;
  color: var(--sw-brand-deep);
  cursor: pointer;
  flex: 0 0 auto;
  border: 1px solid var(--sw-line);
}
.sw-chat-attach-btn:hover { background: #dff0ff; }
.sw-chat-attach-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  margin-bottom: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: #eef6ff;
  font-size: 12px;
  font-weight: 700;
}
.sw-chat-attach-preview button {
  border: 0;
  background: transparent;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  color: #64748b;
}
.sw-chat-composer-error {
  width: 100%;
  margin-top: 6px;
  color: #b91c1c;
  font-size: 12px;
  font-weight: 700;
}
.sw-chat-composer {
  flex-wrap: wrap;
}
.sw-chat-composer.is-locked {
  display: block;
  background: #fff7ed;
  color: #9a3412;
  font-weight: 700;
}
.sw-chat-composer .sw-chat-composer-row textarea { flex: 1; }
.sw-chat-add-btn {
  margin-left: auto;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sw-brand), var(--sw-brand-deep));
  color: #fff;
  font-size: 22px;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
}
.sw-chat-title { width: 100%; display: flex; align-items: center; gap: 8px; }
.sw-chat-filters { display: grid; gap: 8px; }
.sw-chat-filter-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.sw-chat-filter-row select {
  border: 1px solid var(--sw-line);
  border-radius: 10px;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 700;
  background: #fff;
}
.sw-chat-unread-filter {
  grid-column: 1 / -1;
  font-size: 12px;
  font-weight: 700;
  color: var(--sw-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.sw-chat-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.sw-chat-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 800;
  background: #e2e8f0;
  color: #334155;
}
.sw-chat-badge.is-priority-urgent,
.sw-chat-badge.is-priority-high { background: #fee2e2; color: #b91c1c; }
.sw-chat-badge.is-priority-normal { background: #dbeafe; color: #1d4ed8; }
.sw-chat-badge.is-priority-low { background: #ecfccb; color: #3f6212; }
.sw-chat-badge.is-label { background: #ede9fe; color: #6d28d9; }
.sw-chat-badge.is-status-open { background: #dcfce7; color: #166534; }
.sw-chat-badge.is-status-pending { background: #ffedd5; color: #c2410c; }
.sw-chat-badge.is-status-closed,
.sw-chat-badge.is-status-resolved { background: #f1f5f9; color: #64748b; }
.sw-chat-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-left: auto;
}
.sw-chat-ticket-manage {
  padding: 12px 16px;
  border-bottom: 1px solid var(--sw-line);
  background: #f8fbff;
}
.sw-chat-ticket-form label {
  font-size: 11px;
  font-weight: 800;
  color: var(--sw-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.sw-chat-send {
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sw-brand), var(--sw-brand-deep));
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(3, 144, 243, 0.28);
  flex-shrink: 0;
}
.sw-chat-send:hover { filter: brightness(1.05); }

@media (max-width: 1199.98px) {
  .sw-chat {
    grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  }
}

@media (max-width: 991.98px) {
  body.sw-app:has(.sw-chat-page) .content > .container-fluid {
    padding-left: 8px;
    padding-right: 8px;
  }
  .sw-chat {
    grid-template-columns: minmax(0, 1fr);
    height: calc(100vh - 88px);
    max-height: calc(100vh - 88px);
    border-radius: 14px;
  }
  .sw-chat.has-active .sw-chat-sidebar { display: none; }
  .sw-chat:not(.has-active) .sw-chat-panel { display: none; }
  .sw-chat-page.is-portal .sw-chat {
    height: calc(100vh - 180px);
    max-height: calc(100vh - 180px);
  }
  .sw-chat-row { max-width: 92%; }
}

@media (max-width: 575.98px) {
  .sw-chat {
    height: calc(100vh - 72px);
    max-height: calc(100vh - 72px);
    border-radius: 12px;
  }
  .sw-chat-panel-head { padding: 10px 12px; }
  .sw-chat-composer { padding: 10px; }
  .sw-chat-messages { padding: 12px 10px; }
}

/* Server-side DataTables */
body.sw-app .dataTables_wrapper,
body.sw-portal .dataTables_wrapper {
  position: relative;
}
body.sw-app .sw-dt-top,
body.sw-portal .sw-dt-top,
body.sw-app .sw-dt-bottom,
body.sw-portal .sw-dt-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0.35rem 0 0.85rem;
}
body.sw-app .sw-dt-bottom,
body.sw-portal .sw-dt-bottom {
  margin-top: 0.85rem;
  margin-bottom: 0.25rem;
}
body.sw-app .dataTables_wrapper .dataTables_length,
body.sw-app .dataTables_wrapper .dataTables_filter,
body.sw-app .dataTables_wrapper .dataTables_info,
body.sw-app .dataTables_wrapper .dataTables_paginate,
body.sw-portal .dataTables_wrapper .dataTables_length,
body.sw-portal .dataTables_wrapper .dataTables_filter,
body.sw-portal .dataTables_wrapper .dataTables_info,
body.sw-portal .dataTables_wrapper .dataTables_paginate {
  color: var(--sw-ink, #0f2744);
  font-weight: 600;
  float: none !important;
  text-align: left !important;
  margin: 0 !important;
}
body.sw-app .dataTables_wrapper .dataTables_filter,
body.sw-portal .dataTables_wrapper .dataTables_filter {
  margin-left: auto !important;
}
body.sw-app .dataTables_wrapper .dataTables_filter input,
body.sw-app .dataTables_wrapper .dataTables_length select,
body.sw-portal .dataTables_wrapper .dataTables_filter input,
body.sw-portal .dataTables_wrapper .dataTables_length select {
  border: 1px solid var(--sw-line, #d7e5f5);
  border-radius: 10px;
  padding: 0.35rem 0.65rem;
  background: #fff;
  margin-left: 0.35rem;
}
body.sw-app .dataTables_wrapper .dataTables_paginate .paginate_button,
body.sw-portal .dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: 8px !important;
  border: 1px solid transparent !important;
  font-weight: 700 !important;
}
body.sw-app .dataTables_wrapper .dataTables_paginate .paginate_button.current,
body.sw-portal .dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: linear-gradient(135deg, var(--sw-brand, #0390f3), var(--sw-brand-deep, #0270c9)) !important;
  color: #fff !important;
  border-color: transparent !important;
}
body.sw-app table.dataTable,
body.sw-portal table.dataTable {
  width: 100% !important;
  margin: 0 !important;
}
body.sw-app .dataTables_processing,
body.sw-portal .dataTables_processing {
  background: rgba(255, 255, 255, 0.96) !important;
  border: 1px solid var(--sw-line, #d7e5f5) !important;
  border-radius: 12px !important;
  box-shadow: 0 10px 30px rgba(15, 39, 68, 0.08);
  color: var(--sw-ink, #0f2744) !important;
  font-weight: 700;
  z-index: 5;
  top: 58% !important;
}
@media (max-width: 767.98px) {
  body.sw-app .sw-dt-top,
  body.sw-portal .sw-dt-top,
  body.sw-app .sw-dt-bottom,
  body.sw-portal .sw-dt-bottom {
    flex-direction: column;
    align-items: stretch;
  }
  body.sw-app .dataTables_wrapper .dataTables_filter,
  body.sw-portal .dataTables_wrapper .dataTables_filter {
    margin-left: 0 !important;
  }
}

/* Ticket staff multi-assign picker */
.sw-staff-picker {
  border: 1px solid #cfe4f8;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}
.sw-staff-picker-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid #e8f2fb;
  background: #f8fbff;
}
.sw-staff-picker-action {
  border: 0;
  background: transparent;
  color: var(--sw-brand);
  font-size: 12px;
  font-weight: 800;
  padding: 0;
  cursor: pointer;
}
.sw-staff-picker-action:hover { text-decoration: underline; }
.sw-staff-picker-count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 800;
  color: var(--sw-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.sw-staff-picker-list {
  max-height: 220px;
  overflow: auto;
  display: grid;
  gap: 0;
}
.sw-staff-picker.is-compact .sw-staff-picker-list { max-height: 180px; }
.sw-staff-picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin: 0;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
  transition: background .15s ease;
}
.sw-staff-picker-item:last-child { border-bottom: 0; }
.sw-staff-picker-item:hover { background: #f8fbff; }
.sw-staff-picker-item.is-checked { background: #eef7ff; }
.sw-staff-picker-item input {
  width: 16px;
  height: 16px;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--sw-brand);
}
.sw-staff-picker-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}
.sw-staff-picker-meta {
  min-width: 0;
  display: grid;
  gap: 1px;
}
.sw-staff-picker-meta strong {
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sw-staff-picker-meta small {
  font-size: 11px;
  color: var(--sw-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sw-staff-picker-empty {
  padding: 16px;
  text-align: center;
  color: var(--sw-muted);
  font-weight: 700;
  font-size: 13px;
}
.sw-staff-picker-hint {
  display: block;
  padding: 8px 12px 10px;
  border-top: 1px solid #e8f2fb;
  color: var(--sw-muted);
  font-size: 11px;
  font-weight: 600;
}

/* Tom Select — dropdowns are body-mounted; z-index must beat Bootstrap modal (1050) */
.ts-wrapper.sw-ts,
.ts-wrapper.single.sw-ts {
  width: 100%;
}
.ts-wrapper.sw-ts .ts-control {
  border: 1px solid #cfe4f8 !important;
  border-radius: 12px !important;
  background: #fff !important;
  min-height: 42px;
  padding: 8px 12px;
  font-weight: 700;
  box-shadow: none !important;
}
.ts-wrapper.sw-ts.focus .ts-control {
  border-color: var(--sw-brand) !important;
  box-shadow: 0 0 0 3px rgba(3, 144, 243, 0.14) !important;
}
.ts-dropdown.sw-ts-dropdown,
body > .ts-dropdown {
  border: 1px solid #cfe4f8 !important;
  border-radius: 12px !important;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12) !important;
  z-index: 2100 !important;
  overflow: hidden;
}
.ts-dropdown.sw-ts-dropdown .option,
body > .ts-dropdown .option {
  font-weight: 600;
  padding: 8px 12px;
}
.ts-dropdown.sw-ts-dropdown .option.active,
body > .ts-dropdown .option.active {
  background: #eef7ff;
  color: var(--sw-brand-deep);
}
.sw-chat-filter-row .ts-wrapper {
  min-width: 0;
}
.sw-chat-filter-row .ts-wrapper .ts-control {
  min-height: 34px;
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 10px !important;
}

/* Multi-file attach + previews */
.sw-file-attach { display: grid; gap: 8px; }
.sw-file-attach-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 12px;
  border: 1px dashed #93c5fd;
  border-radius: 12px;
  background: #f8fbff;
  color: var(--sw-brand-deep);
  cursor: pointer;
  margin: 0;
}
.sw-file-attach-btn i { color: var(--sw-brand); }
.sw-file-attach-btn span { font-size: 13px; font-weight: 800; }
.sw-file-attach-btn small { font-size: 11px; color: var(--sw-muted); font-weight: 600; }
.sw-file-attach-btn:hover { background: #eef7ff; border-color: var(--sw-brand); }
.sw-file-attach-previews {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}
.sw-file-attach-previews[hidden] { display: none !important; }
.sw-file-chip {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  background: #fff;
  min-width: 0;
}
.sw-file-chip.is-image img {
  width: 100%;
  height: 88px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  background: #e2e8f0;
}
.sw-file-chip-icon {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #eff6ff;
  color: var(--sw-brand);
  font-size: 18px;
}
.sw-file-chip-meta {
  display: grid;
  gap: 1px;
  min-width: 0;
}
.sw-file-chip-meta strong,
.sw-file-chip-meta small {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sw-file-chip-meta strong { font-size: 11px; font-weight: 800; color: #0f172a; }
.sw-file-chip-meta small { font-size: 10px; color: var(--sw-muted); font-weight: 700; }
.sw-file-chip-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.75);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}
.sw-chat-composer .sw-file-attach { margin-bottom: 8px; }
.sw-chat-composer .sw-file-attach-btn {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
}
.sw-chat-composer .sw-file-attach-btn small { display: none; }
.sw-chat-composer .sw-file-attach-previews {
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
}
.sw-chat-composer .sw-file-chip.is-image img { height: 72px; }

.sw-msg-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 8px;
}
.sw-msg-attach-image {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #dbeafe;
  max-width: min(260px, 100%);
  background: #0f172a0d;
}
.sw-msg-attach-image img {
  display: block;
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  background: #e2e8f0;
}
.sw-chat-row.is-mine .sw-msg-attach-image {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
}
.sw-msg-attach-file {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: #f8fbff;
  border: 1px solid #dbeafe;
  color: inherit;
  text-decoration: none;
  max-width: 100%;
}
.sw-chat-row.is-mine .sw-msg-attach-file {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
}
.sw-msg-attach-file strong,
.sw-msg-attach-file small { display: block; }
.sw-msg-attach-file strong {
  font-size: 12px;
  font-weight: 800;
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sw-msg-attach-file small { font-size: 10px; color: var(--sw-muted); font-weight: 700; }
.sw-chat-row.is-mine .sw-msg-attach-file small { color: rgba(255, 255, 255, 0.8); }

/* Metronic sets .swal2-popup .swal2-icon { margin: 2rem 0 0 0 }, which pins the icon left. */
.swal2-popup .swal2-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1.5rem auto 0.75rem;
}
.swal2-popup .swal2-icon .swal2-icon-content {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.swal2-popup .swal2-title,
.swal2-popup .swal2-html-container {
  text-align: center;
}
.swal2-popup.sw-swal {
  border-radius: 16px;
  padding: 1.25rem 1.25rem 1.1rem;
}
.sw-ai-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}
.sw-ai-bar button[aria-busy="true"]:not(.sw-ai-voice) {
  pointer-events: none;
  opacity: 0.75;
}
.sw-ai-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.sw-ai-btn .sw-ai-ico {
  width: 14px;
  height: 14px;
  font-size: 13px;
  line-height: 1;
  flex: 0 0 auto;
}
.sw-ai-btn .icon-robot-solid,
.sw-ai-btn .icon-envelope-solid {
  font-size: 13px;
  line-height: 1;
}
.sw-ai-btn .sw-ai-label {
  line-height: 1.2;
}
.sw-ai-voice.is-listening {
  color: #b42318;
  border-color: #f5c2c0;
  background: #fff5f5;
}
.sw-ai-ask-hint {
  text-align: left;
}
.sw-chat-composer > .sw-ai-bar {
  margin: 0 0 8px;
}
.sw-mail-preview {
  width: 100%;
  height: 520px;
  border: 0;
  background: #f8fafc;
  display: block;
}
.sw-campaign-editor .ql-toolbar {
  border-radius: 12px 12px 0 0;
  border-color: #dbe4ee;
  background: #f8fbff;
}
.sw-campaign-editor .ql-container {
  border-radius: 0 0 12px 12px;
  border-color: #dbe4ee;
  min-height: 240px;
  font-size: 15px;
  background: #fff;
}
.sw-designed-mail {
  min-height: 280px;
  border: 1px solid #dbe4ee;
  border-radius: 12px;
  background: #fff;
  padding: 8px;
  overflow: auto;
}
#campaign-design[aria-busy="true"] { pointer-events: none; opacity: 0.85; }
