/**
 * Sendium — Modern Light theme
 * Visual overlay only. Login + shell + dashboard first.
 * Palette: navy sidebar #101D32, primary blue #2563EB, white/gray surfaces.
 */
:root,
body.theme-modern-light {
  --sd-font: "Inter", "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --sd-bg: #f4f6f9;
  --sd-surface: #ffffff;
  --sd-sidebar: #101d32;
  --sd-sidebar-text: #94a3b8;
  --sd-sidebar-active-bg: rgba(37, 99, 235, 0.16);
  --sd-sidebar-active-text: #ffffff;
  --sd-sidebar-bar: #2563eb;
  --sd-border: #e5eaf0;
  --sd-text: #0f172a;
  --sd-muted: #64748b;
  --sd-primary: #2563eb;
  --sd-primary-hover: #1d4ed8;
  --sd-primary-soft: rgba(37, 99, 235, 0.1);
  --sd-topbar: #ffffff;
  --sd-ok: #059669;
  --sd-warn: #d97706;
  --sd-err: #dc2626;
  --sd-radius: 12px;
  --sd-radius-sm: 8px;
  --sd-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
  --sd-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
}

body.theme-modern-light {
  font-family: var(--sd-font) !important;
  background: var(--sd-bg) !important;
  color: var(--sd-text) !important;
  -webkit-font-smoothing: antialiased;
}

body.theme-modern-light.page-content-white,
body.theme-modern-light .page-wrapper {
  background: var(--sd-bg) !important;
}

/* ---- Header / top bar ----
   Stay compatible with Metronic floats + closed-sidebar hide-logo.
   Do NOT force display:block on logo or sidebar-toggler. */
body.theme-modern-light .page-header.navbar {
  background: var(--sd-topbar) !important;
  border-bottom: 1px solid var(--sd-border) !important;
  box-shadow: none !important;
  height: 50px;
  min-height: 50px;
}

body.theme-modern-light .page-header.navbar .page-logo {
  background: var(--sd-sidebar) !important;
  height: 50px !important;
  padding: 0 0 0 12px !important;
  box-sizing: border-box !important;
  overflow: hidden;
}

body.theme-modern-light .page-header.navbar .page-logo > a {
  display: inline-flex !important;
  align-items: center !important;
  float: left;
  height: 50px !important;
  max-width: calc(100% - 50px);
  padding: 0 !important;
  margin: 0 !important;
}

body.theme-modern-light .page-header.navbar .page-logo .logo-default {
  width: auto !important;
  height: 26px !important;
  max-width: 165px !important;
  margin: 0 !important;
  padding: 0 !important;
  object-fit: contain;
  object-position: left center;
  vertical-align: middle;
}

body.theme-modern-light .page-header.navbar .page-logo .menu-toggler.sidebar-toggler {
  /* keep Metronic float + show/hide; only nudge color/opacity */
  margin-top: 14px !important;
  opacity: 0.85;
}

body.theme-modern-light .page-header.navbar .top-menu .navbar-nav > li.dropdown-user > .dropdown-toggle {
  color: var(--sd-text) !important;
  font-weight: 500 !important;
  font-size: 13px !important;
  padding: 10px 14px !important;
}

body.theme-modern-light .page-header.navbar .top-menu .navbar-nav > li.dropdown-user .img-circle {
  width: 30px;
  height: 30px;
  border: 2px solid var(--sd-border);
}

body.theme-modern-light .page-header.navbar .top-menu .navbar-nav > li.dropdown .dropdown-toggle > i,
body.theme-modern-light .page-header.navbar .menu-toggler > span,
body.theme-modern-light .page-header.navbar .menu-toggler > span:before,
body.theme-modern-light .page-header.navbar .menu-toggler > span:after {
  background: var(--sd-muted) !important;
  color: var(--sd-muted) !important;
}

/* ---- Sidebar ---- */
body.theme-modern-light .page-sidebar,
body.theme-modern-light .page-sidebar-closed.page-sidebar-fixed .page-sidebar:hover,
body.theme-modern-light .page-sidebar .page-sidebar-menu,
body.theme-modern-light .page-sidebar-closed.page-sidebar-fixed .page-sidebar:hover .page-sidebar-menu,
body.theme-modern-light .page-sidebar-wrapper,
body.theme-modern-light .page-sidebar.navbar-collapse {
  background: var(--sd-sidebar) !important;
}

body.theme-modern-light .page-sidebar .page-sidebar-menu > li > a,
body.theme-modern-light .page-sidebar-closed.page-sidebar-fixed .page-sidebar:hover .page-sidebar-menu > li > a,
body.theme-modern-light .page-sidebar .page-sidebar-menu .sub-menu > li > a,
body.theme-modern-light .page-sidebar-closed.page-sidebar-fixed .page-sidebar:hover .page-sidebar-menu .sub-menu > li > a {
  color: var(--sd-sidebar-text) !important;
  border-top-color: rgba(255, 255, 255, 0.05) !important;
  background: transparent !important;
  font-weight: 500 !important;
}

body.theme-modern-light .page-sidebar .page-sidebar-menu > li > a > .title,
body.theme-modern-light .page-sidebar .page-sidebar-menu .sub-menu > li > a > .title,
body.theme-modern-light .page-sidebar-closed.page-sidebar-fixed .page-sidebar:hover .page-sidebar-menu > li > a > .title,
body.theme-modern-light .page-sidebar-closed.page-sidebar-fixed .page-sidebar:hover .page-sidebar-menu .sub-menu > li > a > .title {
  color: inherit !important;
}

body.theme-modern-light .page-sidebar .page-sidebar-menu > li > a > i,
body.theme-modern-light .page-sidebar .page-sidebar-menu .sub-menu > li > a > i,
body.theme-modern-light .page-sidebar-closed.page-sidebar-fixed .page-sidebar:hover .page-sidebar-menu > li > a > i,
body.theme-modern-light .page-sidebar-closed.page-sidebar-fixed .page-sidebar:hover .page-sidebar-menu .sub-menu > li > a > i {
  color: var(--sd-sidebar-text) !important;
}

body.theme-modern-light .page-sidebar .page-sidebar-menu > li.open > a,
body.theme-modern-light .page-sidebar .page-sidebar-menu > li:hover > a,
body.theme-modern-light .page-sidebar-closed.page-sidebar-fixed .page-sidebar:hover .page-sidebar-menu > li.open > a,
body.theme-modern-light .page-sidebar-closed.page-sidebar-fixed .page-sidebar:hover .page-sidebar-menu > li:hover > a,
body.theme-modern-light .page-sidebar .page-sidebar-menu > li.active > a,
body.theme-modern-light .page-sidebar .page-sidebar-menu > li.active.open > a,
body.theme-modern-light .page-sidebar-closed.page-sidebar-fixed .page-sidebar:hover .page-sidebar-menu > li.active > a,
body.theme-modern-light .page-sidebar-closed.page-sidebar-fixed .page-sidebar:hover .page-sidebar-menu > li.active.open > a {
  background: var(--sd-sidebar-active-bg) !important;
  color: var(--sd-sidebar-active-text) !important;
}

body.theme-modern-light .page-sidebar .page-sidebar-menu > li.open > a > i,
body.theme-modern-light .page-sidebar .page-sidebar-menu > li:hover > a > i,
body.theme-modern-light .page-sidebar .page-sidebar-menu > li.active > a > i,
body.theme-modern-light .page-sidebar-closed.page-sidebar-fixed .page-sidebar:hover .page-sidebar-menu > li.open > a > i,
body.theme-modern-light .page-sidebar-closed.page-sidebar-fixed .page-sidebar:hover .page-sidebar-menu > li:hover > a > i,
body.theme-modern-light .page-sidebar-closed.page-sidebar-fixed .page-sidebar:hover .page-sidebar-menu > li.active > a > i {
  color: var(--sd-sidebar-active-text) !important;
}

body.theme-modern-light .page-sidebar .page-sidebar-menu .sub-menu,
body.theme-modern-light .page-sidebar-closed .page-sidebar .page-sidebar-menu .sub-menu,
body.theme-modern-light .page-sidebar-closed .page-sidebar .page-sidebar-menu:hover .sub-menu,
body.theme-modern-light .page-sidebar-closed.page-sidebar-fixed .page-sidebar:hover .page-sidebar-menu .sub-menu,
body.theme-modern-light .page-sidebar-closed .page-sidebar .page-sidebar-menu.page-sidebar-menu-closed > li:hover > .sub-menu {
  background: var(--sd-sidebar) !important;
}

body.theme-modern-light .page-sidebar .page-sidebar-menu .sub-menu > li.active > a,
body.theme-modern-light .page-sidebar .page-sidebar-menu .sub-menu > li.open > a,
body.theme-modern-light .page-sidebar .page-sidebar-menu .sub-menu > li:hover > a,
body.theme-modern-light .page-sidebar-closed.page-sidebar-fixed .page-sidebar:hover .page-sidebar-menu .sub-menu > li.active > a,
body.theme-modern-light .page-sidebar-closed.page-sidebar-fixed .page-sidebar:hover .page-sidebar-menu .sub-menu > li.open > a,
body.theme-modern-light .page-sidebar-closed.page-sidebar-fixed .page-sidebar:hover .page-sidebar-menu .sub-menu > li:hover > a {
  background: var(--sd-sidebar-active-bg) !important;
  color: var(--sd-sidebar-active-text) !important;
}

body.theme-modern-light .page-sidebar .page-sidebar-menu li > a > .arrow:before,
body.theme-modern-light .page-sidebar .page-sidebar-menu li > a > .arrow.open:before,
body.theme-modern-light .page-sidebar-closed.page-sidebar-fixed .page-sidebar:hover .page-sidebar-menu li > a > .arrow:before,
body.theme-modern-light .page-sidebar-closed.page-sidebar-fixed .page-sidebar:hover .page-sidebar-menu li > a > .arrow.open:before {
  color: var(--sd-sidebar-text) !important;
}

body.theme-modern-light .page-sidebar .page-sidebar-menu li.active > a > .arrow:before,
body.theme-modern-light .page-sidebar .page-sidebar-menu li.active > a > .arrow.open:before,
body.theme-modern-light .page-sidebar .page-sidebar-menu li.open > a > .arrow:before,
body.theme-modern-light .page-sidebar .page-sidebar-menu li.open > a > .arrow.open:before {
  color: var(--sd-sidebar-active-text) !important;
}

body.theme-modern-light .page-sidebar h1,
body.theme-modern-light .page-sidebar h2,
body.theme-modern-light .page-sidebar h3,
body.theme-modern-light .page-sidebar h4 {
  color: var(--sd-sidebar-text) !important;
}

@media (min-width: 992px) {
  body.theme-modern-light:not(.page-sidebar-closed) .page-sidebar,
  body.theme-modern-light:not(.page-sidebar-closed) .page-sidebar .page-sidebar-menu {
    width: 248px !important;
  }

  body.theme-modern-light:not(.page-sidebar-closed) .page-header.navbar .page-logo {
    width: 248px !important;
    height: 50px !important;
  }

  /* Collapsed sidebar: logo strip must match 45px rail */
  body.theme-modern-light.page-sidebar-closed.page-sidebar-closed-hide-logo .page-header.navbar .page-logo {
    width: 45px !important;
    padding: 0 !important;
  }

  body.theme-modern-light.page-sidebar-closed.page-sidebar-closed-hide-logo .page-header.navbar .page-logo .logo-default {
    display: none !important;
  }

  body.theme-modern-light.page-sidebar-closed.page-sidebar-closed-hide-logo .page-header.navbar .page-logo .menu-toggler.sidebar-toggler {
    margin: 14px 12px 0 12px !important;
  }

  body.theme-modern-light:not(.page-sidebar-closed) .page-content-wrapper .page-content {
    margin-left: 248px !important;
    padding: 20px 24px 32px !important;
  }

  body.theme-modern-light.page-sidebar-closed .page-content-wrapper .page-content {
    padding: 20px 24px 32px !important;
  }

  body.theme-modern-light:not(.page-sidebar-closed) .page-sidebar .page-sidebar-menu {
    padding: 10px 0 28px !important;
  }

  body.theme-modern-light:not(.page-sidebar-closed) .page-sidebar .page-sidebar-menu > li > a {
    margin: 2px 10px !important;
    padding: 10px 28px 10px 14px !important;
    border-radius: var(--sd-radius-sm) !important;
    border-top: 0 !important;
    font-size: 13px !important;
    line-height: 1.3 !important;
    transition: background 0.15s ease, color 0.15s ease;
  }

  body.theme-modern-light:not(.page-sidebar-closed) .page-sidebar .page-sidebar-menu > li.active > a,
  body.theme-modern-light:not(.page-sidebar-closed) .page-sidebar .page-sidebar-menu > li.active.open > a {
    border-left: 0 !important;
    box-shadow: inset 3px 0 0 var(--sd-sidebar-bar);
  }

  body.theme-modern-light:not(.page-sidebar-closed) .page-sidebar .page-sidebar-menu > li > a > i {
    margin-right: 10px !important;
    font-size: 14px !important;
  }

  body.theme-modern-light:not(.page-sidebar-closed) .page-sidebar .page-sidebar-menu > li > a > .title {
    font-size: 13px !important;
    white-space: nowrap;
  }

  body.theme-modern-light:not(.page-sidebar-closed) .page-sidebar .page-sidebar-menu > li > a > .arrow {
    right: 10px !important;
    opacity: 0.5;
  }

  body.theme-modern-light:not(.page-sidebar-closed) .page-sidebar .page-sidebar-menu .sub-menu {
    margin: 0 10px 6px !important;
    padding: 4px 0 !important;
  }

  body.theme-modern-light:not(.page-sidebar-closed) .page-sidebar .page-sidebar-menu .sub-menu > li > a {
    margin: 1px 0 !important;
    padding: 8px 12px 8px 36px !important;
    border-radius: 6px !important;
    font-size: 12.5px !important;
    border-top: 0 !important;
  }
}

/* ---- Content ---- */
body.theme-modern-light .page-content {
  background: var(--sd-bg) !important;
}

body.theme-modern-light .page-bar {
  background: transparent !important;
  border: none !important;
  margin: 0 0 14px !important;
  padding: 0 !important;
  box-shadow: none !important;
}

body.theme-modern-light .page-title,
body.theme-modern-light .caption-subject,
body.theme-modern-light h1,
body.theme-modern-light h2,
body.theme-modern-light h3,
body.theme-modern-light h4,
body.theme-modern-light label.control-label {
  color: var(--sd-text) !important;
  font-family: var(--sd-font) !important;
}

body.theme-modern-light .page-bar .page-breadcrumb > li > a,
body.theme-modern-light .page-bar .page-breadcrumb > li > span {
  color: var(--sd-muted) !important;
  font-size: 12px !important;
  font-weight: 500 !important;
}

/* ---- Portlets ---- */
body.theme-modern-light .portlet.light,
body.theme-modern-light .portlet {
  background: var(--sd-surface) !important;
  border: 1px solid var(--sd-border) !important;
  border-radius: var(--sd-radius) !important;
  box-shadow: var(--sd-shadow-sm) !important;
  margin-bottom: 16px !important;
  overflow: hidden;
}

body.theme-modern-light .portlet.light > .portlet-title {
  border-bottom: 1px solid var(--sd-border) !important;
  min-height: 48px;
  padding: 12px 16px 10px !important;
}

body.theme-modern-light .portlet.light > .portlet-title > .caption > .caption-subject,
body.theme-modern-light .portlet.light > .portlet-title > .caption > i {
  color: var(--sd-text) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
}

body.theme-modern-light .portlet.light > .portlet-title > .caption > i {
  color: var(--sd-primary) !important;
}

body.theme-modern-light .portlet > .portlet-body {
  color: var(--sd-text);
  padding: 12px 14px 16px !important;
}

body.theme-modern-light .portlet.light > .portlet-title > .tools > a {
  opacity: 0.4 !important;
}

/* ---- Dashboard layout: KPIs then charts ---- */
body.theme-modern-light .sd-dashboard {
  max-width: 100%;
  overflow-x: hidden;
}

body.theme-modern-light .sd-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 16px;
  width: 100%;
}

body.theme-modern-light .sd-charts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  width: 100%;
  margin: 0;
}

body.theme-modern-light .sd-dashboard .dashboard-stat2,
body.theme-modern-light .sd-dashboard .sd-kpi {
  background: var(--sd-surface) !important;
  border: 1px solid var(--sd-border) !important;
  border-radius: var(--sd-radius) !important;
  box-shadow: var(--sd-shadow-sm) !important;
  padding: 14px 14px 12px !important;
  margin: 0 !important;
  min-height: 0;
  height: 100%;
  position: relative;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

body.theme-modern-light .sd-dashboard .dashboard-stat2:hover,
body.theme-modern-light .sd-dashboard .sd-kpi:hover {
  border-color: #c7d2fe !important;
  box-shadow: var(--sd-shadow) !important;
  transform: translateY(-1px);
}

body.theme-modern-light .sd-dashboard .dashboard-stat2 .display,
body.theme-modern-light .sd-dashboard .sd-kpi .display {
  margin-bottom: 0 !important;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

body.theme-modern-light .sd-dashboard .dashboard-stat2 .display .number,
body.theme-modern-light .sd-dashboard .sd-kpi .display .number {
  float: none !important;
  min-width: 0;
  flex: 1;
}

body.theme-modern-light .sd-dashboard .dashboard-stat2 .display .icon,
body.theme-modern-light .sd-dashboard .sd-kpi .display .icon {
  float: none !important;
  padding: 0 !important;
  flex-shrink: 0;
}

body.theme-modern-light .sd-dashboard .dashboard-stat2 .display .number h3,
body.theme-modern-light .sd-dashboard .dashboard-stat2 .display .number h3 > span,
body.theme-modern-light .sd-dashboard .sd-kpi .display .number h3,
body.theme-modern-light .sd-dashboard .sd-kpi .display .number h3 > span {
  font-size: 22px !important;
  font-weight: 700 !important;
  letter-spacing: -0.03em !important;
  line-height: 1.1 !important;
  color: var(--sd-text) !important;
  font-family: var(--sd-font) !important;
  margin: 0 !important;
}

body.theme-modern-light .sd-dashboard .dashboard-stat2 .display .number small,
body.theme-modern-light .sd-dashboard .sd-kpi .display .number small {
  display: block;
  margin-top: 4px !important;
  font-size: 10px !important;
  font-weight: 500 !important;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--sd-muted) !important;
  max-width: none;
  line-height: 1.25;
}

body.theme-modern-light .sd-dashboard .dashboard-stat2 .display .icon > i,
body.theme-modern-light .sd-dashboard .sd-kpi .display .icon > i {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  background: var(--sd-primary-soft) !important;
  color: var(--sd-primary) !important;
  font-size: 14px !important;
  opacity: 1 !important;
}

body.theme-modern-light .sd-dashboard .dashboard-stat2 .progress-info {
  display: none !important;
}

body.theme-modern-light .sd-dashboard .sd-chart-card {
  margin-bottom: 0 !important;
  width: 100%;
  max-width: 100%;
  background: #fff !important;
  border: 1px solid var(--sd-border) !important;
  border-radius: var(--sd-radius) !important;
  box-shadow: var(--sd-shadow-sm) !important;
  overflow: hidden;
}

body.theme-modern-light .sd-dashboard .sd-chart-card > .portlet-body {
  background: #fff !important;
}

body.theme-modern-light .sd-dashboard .sd-chart-card .portlet-title .caption-subject {
  white-space: normal;
  line-height: 1.3;
}

body.theme-modern-light .sd-dashboard .sd-chart {
  width: 100% !important;
  max-width: 100%;
  background: #fff;
}

/* Compact empty chart state */
body.theme-modern-light .sd-dashboard .sd-chart-card.is-empty > .portlet-body {
  padding: 18px 16px 22px !important;
}

body.theme-modern-light .sd-dashboard .sd-chart-card.is-empty .sd-chart {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
}

body.theme-modern-light .sd-chart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 120px;
  padding: 8px 12px 4px;
}

body.theme-modern-light .sd-chart-empty-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(37, 99, 235, 0.08);
  color: #2563eb;
  margin-bottom: 12px;
}

body.theme-modern-light .sd-chart-empty-title {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
  color: #101d32;
  letter-spacing: -0.01em;
}

body.theme-modern-light .sd-chart-empty-text {
  margin: 0;
  max-width: 280px;
  font-size: 12.5px;
  line-height: 1.45;
  color: #64748b;
  font-weight: 500;
}

@media (min-width: 768px) {
  body.theme-modern-light .sd-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
  }

  body.theme-modern-light .sd-dashboard .dashboard-stat2,
  body.theme-modern-light .sd-dashboard .sd-kpi {
    padding: 14px 16px !important;
  }

  body.theme-modern-light .sd-dashboard .dashboard-stat2 .display .number h3,
  body.theme-modern-light .sd-dashboard .dashboard-stat2 .display .number h3 > span,
  body.theme-modern-light .sd-dashboard .sd-kpi .display .number h3,
  body.theme-modern-light .sd-dashboard .sd-kpi .display .number h3 > span {
    font-size: 24px !important;
  }

  body.theme-modern-light .sd-dashboard .dashboard-stat2 .display .number small,
  body.theme-modern-light .sd-dashboard .sd-kpi .display .number small {
    font-size: 11px !important;
  }
}

@media (min-width: 1200px) {
  body.theme-modern-light .sd-kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
  }

  body.theme-modern-light .sd-charts-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  body.theme-modern-light .sd-dashboard .dashboard-stat2 .display .icon > i,
  body.theme-modern-light .sd-dashboard .sd-kpi .display .icon > i {
    width: 36px;
    height: 36px;
    font-size: 15px !important;
  }
}

@media (max-width: 767px) {
  body.theme-modern-light .sd-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
  }

  body.theme-modern-light .sd-dashboard .dashboard-stat2,
  body.theme-modern-light .sd-dashboard .sd-kpi {
    padding: 8px 9px 7px !important;
    border-radius: 10px !important;
  }

  body.theme-modern-light .sd-dashboard .dashboard-stat2 .display,
  body.theme-modern-light .sd-dashboard .sd-kpi .display {
    gap: 6px;
  }

  body.theme-modern-light .sd-dashboard .dashboard-stat2 .display .number h3,
  body.theme-modern-light .sd-dashboard .dashboard-stat2 .display .number h3 > span,
  body.theme-modern-light .sd-dashboard .sd-kpi .display .number h3,
  body.theme-modern-light .sd-dashboard .sd-kpi .display .number h3 > span {
    font-size: 17px !important;
  }

  body.theme-modern-light .sd-dashboard .dashboard-stat2 .display .number small,
  body.theme-modern-light .sd-dashboard .sd-kpi .display .number small {
    margin-top: 2px !important;
    font-size: 9px !important;
    line-height: 1.2;
  }

  body.theme-modern-light .sd-dashboard .dashboard-stat2 .display .icon > i,
  body.theme-modern-light .sd-dashboard .sd-kpi .display .icon > i {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    font-size: 11px !important;
  }

  body.theme-modern-light .sd-charts-grid {
    gap: 12px;
  }

  body.theme-modern-light .sd-dashboard .sd-chart-card > .portlet-title {
    padding: 10px 12px 8px !important;
    min-height: 0 !important;
  }

  body.theme-modern-light .sd-dashboard .sd-chart-card > .portlet-body {
    padding: 8px 10px 12px !important;
  }

  body.theme-modern-light .sd-dashboard .sd-chart {
    height: 220px !important;
  }

  body.theme-modern-light .sd-dashboard .sd-chart-card.is-empty .sd-chart {
    height: 0 !important;
  }

  body.theme-modern-light .sd-chart-empty {
    min-height: 100px;
    padding: 4px 8px;
  }

  body.theme-modern-light .sd-chart-empty-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    margin-bottom: 10px;
  }

  body.theme-modern-light .sd-chart-empty-title {
    font-size: 13px;
  }

  body.theme-modern-light .sd-chart-empty-text {
    font-size: 12px;
  }
}

body.theme-modern-light .font-blue-chambray,
body.theme-modern-light .font-blue-ebonyclay,
body.theme-modern-light .font-blue-madison,
body.theme-modern-light .font-blue,
body.theme-modern-light .font-purple-studio,
body.theme-modern-light .font-purple-intense,
body.theme-modern-light .font-purple,
body.theme-modern-light .font-green-sharp,
body.theme-modern-light .font-green-steel,
body.theme-modern-light .font-green-dark,
body.theme-modern-light .font-green,
body.theme-modern-light .font-dark {
  color: var(--sd-text) !important;
}

body.theme-modern-light .font-red,
body.theme-modern-light .font-red-mint {
  color: var(--sd-err) !important;
}

body.theme-modern-light .sd-chart-card {
  border: 1px solid var(--sd-border) !important;
}

/* ---- Forms / controls (shell; other screens inherit lightly) ---- */
body.theme-modern-light .form-control,
body.theme-modern-light .bootstrap-select > .dropdown-toggle {
  background: var(--sd-surface) !important;
  border-color: var(--sd-border) !important;
  color: var(--sd-text) !important;
  border-radius: var(--sd-radius-sm) !important;
  box-shadow: none !important;
  min-height: 38px;
  font-size: 13px !important;
}

body.theme-modern-light .form-control:focus,
body.theme-modern-light .bootstrap-select.open > .dropdown-toggle {
  border-color: var(--sd-primary) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
}

body.theme-modern-light .input-group-addon {
  background: var(--sd-bg) !important;
  border-color: var(--sd-border) !important;
  color: var(--sd-muted) !important;
}

/* ---- Buttons ---- */
body.theme-modern-light .btn {
  border-radius: var(--sd-radius-sm) !important;
  font-family: var(--sd-font) !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

body.theme-modern-light .btn.blue,
body.theme-modern-light .btn.blue-madison,
body.theme-modern-light .btn.blue-steel,
body.theme-modern-light .btn.blue-soft,
body.theme-modern-light .btn.green-haze,
body.theme-modern-light .btn.btn-primary,
body.theme-modern-light .btn.green {
  background: var(--sd-primary) !important;
  border-color: var(--sd-primary) !important;
  color: #fff !important;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.25);
}

body.theme-modern-light .btn.blue:hover,
body.theme-modern-light .btn.blue-madison:hover,
body.theme-modern-light .btn.green:hover,
body.theme-modern-light .btn.btn-primary:hover,
body.theme-modern-light .btn.green-haze:hover {
  background: var(--sd-primary-hover) !important;
  border-color: var(--sd-primary-hover) !important;
}

body.theme-modern-light .btn.default,
body.theme-modern-light .btn.btn-default,
body.theme-modern-light .btn.grey-mint,
body.theme-modern-light .btn.white {
  background: var(--sd-surface) !important;
  border-color: var(--sd-border) !important;
  color: var(--sd-text) !important;
}

body.theme-modern-light .btn.red,
body.theme-modern-light .btn.btn-danger,
body.theme-modern-light .btn.red-mint {
  background: var(--sd-err) !important;
  border-color: var(--sd-err) !important;
  color: #fff !important;
}

body.theme-modern-light .btn.yellow,
body.theme-modern-light .btn.btn-warning {
  background: var(--sd-warn) !important;
  border-color: var(--sd-warn) !important;
  color: #fff !important;
}

/* Outline buttons — kill Metronic gold #C49F47 and align to Modern Light */
body.theme-modern-light .btn.btn-outline.yellow,
body.theme-modern-light .btn.yellow.btn-outline,
body.theme-modern-light .btn-outline.yellow,
body.theme-modern-light a.btn.btn-outline.yellow {
  background: transparent !important;
  background-image: none !important;
  border-color: var(--sd-warn) !important;
  color: var(--sd-warn) !important;
  box-shadow: none !important;
}

body.theme-modern-light .btn.btn-outline.yellow:hover,
body.theme-modern-light .btn.btn-outline.yellow:focus,
body.theme-modern-light .btn.btn-outline.yellow:active,
body.theme-modern-light .btn.yellow.btn-outline:hover,
body.theme-modern-light .btn-outline.yellow:hover {
  background: var(--sd-warn) !important;
  border-color: var(--sd-warn) !important;
  color: #fff !important;
}

body.theme-modern-light .btn.btn-outline.green,
body.theme-modern-light .btn.green.btn-outline,
body.theme-modern-light .btn-outline.green {
  background: transparent !important;
  border-color: var(--sd-ok) !important;
  color: var(--sd-ok) !important;
  box-shadow: none !important;
}

body.theme-modern-light .btn.btn-outline.green:hover,
body.theme-modern-light .btn.btn-outline.green:focus,
body.theme-modern-light .btn.btn-outline.green:active,
body.theme-modern-light .btn.green.btn-outline:hover {
  background: var(--sd-ok) !important;
  border-color: var(--sd-ok) !important;
  color: #fff !important;
}

body.theme-modern-light .btn.btn-outline.red,
body.theme-modern-light .btn.red.btn-outline,
body.theme-modern-light .btn-outline.red {
  background: transparent !important;
  border-color: var(--sd-err) !important;
  color: var(--sd-err) !important;
  box-shadow: none !important;
}

body.theme-modern-light .btn.btn-outline.red:hover,
body.theme-modern-light .btn.btn-outline.red:focus,
body.theme-modern-light .btn.btn-outline.red:active,
body.theme-modern-light .btn.red.btn-outline:hover {
  background: var(--sd-err) !important;
  border-color: var(--sd-err) !important;
  color: #fff !important;
}

body.theme-modern-light .btn.btn-outline.blue,
body.theme-modern-light .btn.blue.btn-outline,
body.theme-modern-light .btn-outline.blue,
body.theme-modern-light .btn.btn-outline.blue-madison,
body.theme-modern-light .btn.btn-outline.blue-steel {
  background: transparent !important;
  border-color: var(--sd-primary) !important;
  color: var(--sd-primary) !important;
  box-shadow: none !important;
}

body.theme-modern-light .btn.btn-outline.blue:hover,
body.theme-modern-light .btn.btn-outline.blue:focus,
body.theme-modern-light .btn.btn-outline.blue:active,
body.theme-modern-light .btn.blue.btn-outline:hover,
body.theme-modern-light .btn.btn-outline.blue-madison:hover,
body.theme-modern-light .btn.btn-outline.blue-steel:hover {
  background: var(--sd-primary) !important;
  border-color: var(--sd-primary) !important;
  color: #fff !important;
}

body.theme-modern-light .btn.btn-outline.dark,
body.theme-modern-light .btn.dark.btn-outline,
body.theme-modern-light .btn-outline.dark,
body.theme-modern-light .btn.btn-outline.grey-mint,
body.theme-modern-light .btn.btn-outline.default {
  background: transparent !important;
  border-color: var(--sd-border) !important;
  color: var(--sd-text) !important;
  box-shadow: none !important;
}

body.theme-modern-light .btn.btn-outline.dark:hover,
body.theme-modern-light .btn.btn-outline.default:hover,
body.theme-modern-light .btn.btn-outline.grey-mint:hover {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: var(--sd-text) !important;
}

/* Legacy Metronic yellow-gold / yellow-crusta if ever used */
body.theme-modern-light .btn.yellow-gold,
body.theme-modern-light .btn.yellow-crusta,
body.theme-modern-light .btn.yellow-saffron {
  background: var(--sd-warn) !important;
  border-color: var(--sd-warn) !important;
  color: #fff !important;
}

/* Bootstrap switch: replace legacy brown primary with Sendium blue */
body.theme-modern-light .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-primary,
body.theme-modern-light .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-primary {
  background: var(--sd-primary) !important;
  color: #fff !important;
}

body.theme-modern-light .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-default,
body.theme-modern-light .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-default {
  background: #e8eef5 !important;
  color: var(--sd-text) !important;
}

body.theme-modern-light .quick-nav .quick-nav-bg {
  background: var(--sd-primary) !important;
}

/* ---- Tables ---- */
body.theme-modern-light .table > thead > tr > th,
body.theme-modern-light table.dataTable thead th {
  background: #f8fafc !important;
  color: var(--sd-muted) !important;
  border-bottom: 1px solid var(--sd-border) !important;
  font-weight: 600 !important;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 11px !important;
}

body.theme-modern-light .table > tbody > tr > td,
body.theme-modern-light table.dataTable tbody td {
  border-color: var(--sd-border) !important;
  color: var(--sd-text) !important;
  background: var(--sd-surface) !important;
  font-size: 13px !important;
}

body.theme-modern-light .table-hover > tbody > tr:hover > td,
body.theme-modern-light table.dataTable.hover tbody tr:hover td,
body.theme-modern-light table.dataTable.display tbody tr:hover td {
  background: #f8fafc !important;
}

body.theme-modern-light .table-scrollable {
  border: 1px solid var(--sd-border) !important;
  border-radius: var(--sd-radius) !important;
  overflow: hidden;
}

/* ---- Dropdowns ---- */
body.theme-modern-light .dropdown-menu {
  background: var(--sd-surface) !important;
  border: 1px solid var(--sd-border) !important;
  border-radius: 10px !important;
  box-shadow: var(--sd-shadow) !important;
  padding: 6px !important;
}

body.theme-modern-light .dropdown-menu > li > a {
  color: var(--sd-text) !important;
  border-radius: 6px !important;
  font-size: 13px !important;
}

body.theme-modern-light .dropdown-menu > li > a:hover,
body.theme-modern-light .dropdown-menu > li.active > a {
  background: var(--sd-primary-soft) !important;
  color: var(--sd-primary-hover) !important;
}

/* ---- Footer / misc ---- */
body.theme-modern-light .page-footer {
  background: var(--sd-bg) !important;
  color: var(--sd-muted) !important;
  border-top: 1px solid var(--sd-border) !important;
  padding: 14px 24px !important;
  font-size: 12px !important;
}

body.theme-modern-light .modal-content {
  background: var(--sd-surface) !important;
  border-radius: var(--sd-radius) !important;
  border: 1px solid var(--sd-border) !important;
  box-shadow: var(--sd-shadow) !important;
}

body.theme-modern-light .modal-header {
  background: var(--sd-surface) !important;
  border-bottom: 1px solid var(--sd-border) !important;
  padding: 14px 18px !important;
}

body.theme-modern-light .modal-header .modal-title,
body.theme-modern-light .modal-header h4 {
  color: var(--sd-text) !important;
  font-family: var(--sd-font) !important;
  font-weight: 600 !important;
  font-size: 15px !important;
  letter-spacing: -0.01em;
}

body.theme-modern-light .modal-header .close {
  color: var(--sd-muted) !important;
  opacity: 1 !important;
  text-shadow: none !important;
  font-weight: 400 !important;
}

body.theme-modern-light .modal-header .close:hover {
  color: var(--sd-text) !important;
}

body.theme-modern-light .modal-body {
  padding: 16px 18px !important;
  color: var(--sd-text) !important;
}

body.theme-modern-light .modal-footer {
  background: #f8fafc !important;
  border-top: 1px solid var(--sd-border) !important;
  padding: 12px 18px !important;
}

/* Responsive modal sizes (replace inline % widths) */
body.theme-modern-light .modal-dialog.sd-modal-sm {
  width: auto !important;
  max-width: 420px;
  margin: 30px auto;
}

body.theme-modern-light .modal-dialog.sd-modal-md {
  width: auto !important;
  max-width: 560px;
  margin: 30px auto;
}

body.theme-modern-light .modal-dialog.sd-modal-lg {
  width: auto !important;
  max-width: 720px;
  margin: 30px auto;
}

body.theme-modern-light .modal-dialog.sd-modal-xl {
  width: auto !important;
  max-width: 960px;
  margin: 30px auto;
}

body.theme-modern-light .modal-dialog.sd-modal-full {
  width: auto !important;
  max-width: 1100px;
  margin: 30px auto;
}

@media (max-width: 991px) {
  body.theme-modern-light .modal-dialog.sd-modal-sm,
  body.theme-modern-light .modal-dialog.sd-modal-md,
  body.theme-modern-light .modal-dialog.sd-modal-lg,
  body.theme-modern-light .modal-dialog.sd-modal-xl,
  body.theme-modern-light .modal-dialog.sd-modal-full {
    max-width: calc(100% - 32px);
    margin: 16px auto;
  }
}

@media (max-width: 767px) {
  body.theme-modern-light .modal-dialog.sd-modal-sm,
  body.theme-modern-light .modal-dialog.sd-modal-md,
  body.theme-modern-light .modal-dialog.sd-modal-lg,
  body.theme-modern-light .modal-dialog.sd-modal-xl,
  body.theme-modern-light .modal-dialog.sd-modal-full {
    width: auto !important;
    max-width: calc(100% - 20px);
    margin: 10px auto;
  }

  body.theme-modern-light .modal-header,
  body.theme-modern-light .modal-body,
  body.theme-modern-light .modal-footer {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }
}

body.theme-modern-light .nav-tabs > li.active > a,
body.theme-modern-light .nav-tabs > li.active > a:hover,
body.theme-modern-light .nav-tabs > li.active > a:focus {
  color: var(--sd-primary) !important;
  border-bottom-color: var(--sd-primary) !important;
}

body.theme-modern-light .pagination > li > a,
body.theme-modern-light .pagination > li > span {
  color: var(--sd-muted) !important;
  background: var(--sd-surface) !important;
  border-color: var(--sd-border) !important;
  border-radius: 6px !important;
  margin: 0 2px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  min-width: 34px;
  text-align: center;
}

body.theme-modern-light .pagination > li > a:hover,
body.theme-modern-light .pagination > li > span:hover {
  color: var(--sd-primary) !important;
  background: var(--sd-primary-soft) !important;
  border-color: #c7d2fe !important;
}

body.theme-modern-light .pagination > .active > a,
body.theme-modern-light .pagination > .active > span,
body.theme-modern-light .pagination > .active > a:hover,
body.theme-modern-light .pagination > .active > span:hover,
body.theme-modern-light .pagination > .active > a:focus,
body.theme-modern-light .pagination > .active > span:focus {
  background: var(--sd-primary) !important;
  border-color: var(--sd-primary) !important;
  color: #fff !important;
}

body.theme-modern-light .pagination > .disabled > a,
body.theme-modern-light .pagination > .disabled > span,
body.theme-modern-light .pagination > .disabled > a:hover,
body.theme-modern-light .pagination > .disabled > span:hover {
  color: #94a3b8 !important;
  background: #f8fafc !important;
  border-color: var(--sd-border) !important;
  cursor: not-allowed;
}

body.theme-modern-light section.wrapper .spinner i {
  background: var(--sd-primary) !important;
}

body.theme-modern-light a {
  color: var(--sd-primary);
}

body.theme-modern-light a:hover {
  color: var(--sd-primary-hover);
}

body.theme-modern-light #brand-name {
  color: var(--sd-text) !important;
  font-family: var(--sd-font) !important;
}

body.theme-modern-light .page-sidebar::-webkit-scrollbar {
  width: 6px;
}
body.theme-modern-light .page-sidebar::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: 6px;
}

/* =========================================================
   LOGIN — Sendium Modern Light
   ========================================================= */
body.theme-modern-light.login {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 100vh !important;
  margin: 0 !important;
  padding: 24px !important;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(37, 99, 235, 0.12), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(16, 29, 50, 0.08), transparent 50%),
    linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%) !important;
  font-family: var(--sd-font) !important;
  font-size: 16px !important;
  position: relative;
}

body.theme-modern-light.login:before {
  display: none !important;
  content: none !important;
  background: none !important;
}

body.theme-modern-light.login .sd-login-shell {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

body.theme-modern-light.login .sd-login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 20px;
}

body.theme-modern-light.login .sd-login-brand img {
  width: auto !important;
  max-width: 200px !important;
  height: 40px !important;
  object-fit: contain !important;
  margin: 0 auto 10px !important;
}

body.theme-modern-light.login .sd-login-brand .sd-login-tagline {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--sd-muted);
  letter-spacing: 0.01em;
}

body.theme-modern-light.login .login-form,
body.theme-modern-light.login .sd-login-card {
  width: 100% !important;
  max-width: 420px !important;
  margin: 0 auto !important;
  padding: 28px 28px 24px !important;
  background: var(--sd-surface) !important;
  border: 1px solid var(--sd-border) !important;
  border-radius: 16px !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 18px 40px rgba(15, 23, 42, 0.08) !important;
  position: relative !important;
}

body.theme-modern-light.login .login-form:before {
  display: none !important;
  content: none !important;
}

body.theme-modern-light.login .form-title {
  display: none !important;
}

body.theme-modern-light.login .sd-login-card-title {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--sd-text);
  text-align: left;
}

body.theme-modern-light.login .sd-login-card-sub {
  margin: 0 0 22px;
  font-size: 13px;
  color: var(--sd-muted);
  font-weight: 500;
}

body.theme-modern-light.login .flex-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px !important;
  position: relative;
}

body.theme-modern-light.login .lf--label {
  position: absolute !important;
  left: 12px;
  bottom: 12px;
  width: 20px !important;
  height: 20px !important;
  background: transparent !important;
  z-index: 2;
  pointer-events: none;
}

body.theme-modern-light.login .lf--label svg {
  width: 14px;
  height: 14px;
}

body.theme-modern-light.login .lf--label svg path,
body.theme-modern-light.login .lf--label svg g path {
  fill: #94a3b8 !important;
}

body.theme-modern-light.login .sd-field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--sd-text);
  letter-spacing: 0.01em;
}

body.theme-modern-light.login .lf--input {
  width: 100% !important;
  height: 44px !important;
  flex: none !important;
  padding: 0 14px 0 40px !important;
  border: 1px solid var(--sd-border) !important;
  border-radius: 10px !important;
  background: #fff !important;
  color: var(--sd-text) !important;
  font-size: 14px !important;
  font-family: var(--sd-font) !important;
  transform: none !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

body.theme-modern-light.login .lf--input:focus {
  outline: none !important;
  transform: none !important;
  border-color: var(--sd-primary) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
}

body.theme-modern-light.login .lf--input::placeholder {
  color: #94a3b8 !important;
}

body.theme-modern-light.login .form-actions {
  margin-top: 8px;
}

body.theme-modern-light.login .lf--submit {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100% !important;
  height: 44px !important;
  padding: 0 16px !important;
  background: var(--sd-primary) !important;
  border: 0 !important;
  border-radius: 10px !important;
  color: #fff !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  font-family: var(--sd-font) !important;
  text-shadow: none !important;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.3), 0 8px 20px rgba(37, 99, 235, 0.2);
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

body.theme-modern-light.login .lf--submit:hover {
  background: var(--sd-primary-hover) !important;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.35), 0 10px 24px rgba(37, 99, 235, 0.28);
}

body.theme-modern-light.login .lf--submit:focus {
  outline: none !important;
  transform: none !important;
}

body.theme-modern-light.login .copyright {
  display: block !important;
  margin-top: 20px !important;
  text-align: center;
  color: var(--sd-muted) !important;
  font-size: 12px !important;
  font-weight: 500;
}

body.theme-modern-light.login img {
  width: auto;
  height: auto;
}

@media (max-width: 480px) {
  body.theme-modern-light.login {
    padding: 16px !important;
    align-items: flex-start !important;
    padding-top: 48px !important;
  }

  body.theme-modern-light.login .login-form,
  body.theme-modern-light.login .sd-login-card {
    padding: 22px 18px 20px !important;
    border-radius: 14px !important;
  }

  body.theme-modern-light.login .sd-login-brand img {
    max-width: 160px !important;
    height: 34px !important;
  }
}

/* =========================================================
   Header + profile dropdown (mobile + desktop)
   Fixes Metronic ≤480px stacking that puts avatar on a 2nd row
   ========================================================= */

/* Desktop profile */
body.theme-modern-light .page-header.navbar .top-menu .navbar-nav > li.dropdown-user {
  position: relative;
}

body.theme-modern-light .page-header.navbar .top-menu .navbar-nav > li.dropdown-user > .dropdown-toggle {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  background: transparent !important;
  border-radius: 999px;
  padding: 6px 10px 6px 6px !important;
  line-height: 1 !important;
}

body.theme-modern-light .page-header.navbar .top-menu .navbar-nav > li.dropdown-user > .dropdown-toggle:hover,
body.theme-modern-light .page-header.navbar .top-menu .navbar-nav > li.dropdown-user.open > .dropdown-toggle {
  background: #f1f5f9 !important;
}

body.theme-modern-light .page-header.navbar .top-menu .navbar-nav > li.dropdown-user .img-circle {
  width: 32px !important;
  height: 32px !important;
  border-radius: 50% !important;
  border: 2px solid var(--sd-border) !important;
  object-fit: cover;
  display: block;
  margin: 0 !important;
  float: none !important;
}

body.theme-modern-light .page-header.navbar .top-menu .navbar-nav > li.dropdown-user > .dropdown-toggle > .fa-angle-down {
  background: transparent !important;
  color: var(--sd-muted) !important;
  font-size: 12px;
  margin: 0 !important;
}

body.theme-modern-light .page-header.navbar .top-menu .navbar-nav > li.dropdown-user > .dropdown-menu {
  position: absolute !important;
  right: 0 !important;
  left: auto !important;
  top: calc(100% + 6px) !important;
  min-width: 240px;
  max-width: min(280px, calc(100vw - 24px));
  z-index: 10050 !important;
  margin: 0 !important;
  padding: 8px !important;
  border: 1px solid var(--sd-border) !important;
  border-radius: 12px !important;
  background: #fff !important;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12) !important;
  overflow: visible !important;
}

body.theme-modern-light .page-header.navbar .top-menu .navbar-nav > li.dropdown-user > .dropdown-menu > li > a {
  display: block;
  padding: 10px 12px !important;
  border-radius: 8px !important;
  white-space: normal;
  line-height: 1.35;
  font-size: 13px !important;
  color: var(--sd-text) !important;
  border: 0 !important;
}

body.theme-modern-light .page-header.navbar .top-menu .navbar-nav > li.dropdown-user > .dropdown-menu > li > a:hover {
  background: var(--sd-primary-soft) !important;
  color: var(--sd-primary-hover) !important;
}

body.theme-modern-light .page-header.navbar,
body.theme-modern-light .page-header.navbar .page-header-inner,
body.theme-modern-light .page-header.navbar .top-menu {
  overflow: visible !important;
}

/* Tablet / mobile: one header row — menu | logo | avatar (no dual hamburgers) */
@media (max-width: 991px) {
  body.theme-modern-light.page-header-fixed .page-container,
  body.theme-modern-light.page-header-fixed.page-header-fixed-mobile .page-container {
    margin-top: 50px !important;
  }

  body.theme-modern-light .page-header.navbar,
  body.theme-modern-light.page-header-fixed.page-header-fixed-mobile .page-header.navbar {
    height: 50px !important;
    min-height: 50px !important;
    padding: 0 10px !important;
    background: var(--sd-topbar) !important;
    border-bottom: 1px solid var(--sd-border) !important;
  }

  body.theme-modern-light .page-header.navbar .page-header-inner {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    width: 100%;
    height: 50px !important;
    float: none !important;
    clear: none !important;
  }

  body.theme-modern-light .page-header.navbar .menu-toggler.responsive-toggler {
    display: block !important;
    float: none !important;
    order: 0;
    flex: 0 0 auto;
    margin: 0 8px 0 0 !important;
  }

  /* Hide desktop sidebar toggler on mobile — Metronic does this; reinforce against our styles */
  body.theme-modern-light .page-header.navbar .menu-toggler.sidebar-toggler,
  body.theme-modern-light .page-header.navbar .page-logo .menu-toggler.sidebar-toggler {
    display: none !important;
  }

  body.theme-modern-light .page-header.navbar .page-logo {
    float: none !important;
    order: 1;
    display: inline-flex !important;
    align-items: center !important;
    width: auto !important;
    max-width: calc(100% - 100px);
    height: 36px !important;
    margin: 0 auto 0 0 !important;
    padding: 0 10px !important;
    background: var(--sd-sidebar) !important;
    border-radius: 8px !important;
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
  }

  body.theme-modern-light .page-header.navbar .page-logo > a {
    float: none !important;
    height: 36px !important;
    max-width: 100%;
    display: inline-flex !important;
    align-items: center !important;
  }

  body.theme-modern-light .page-header.navbar .page-logo .logo-default {
    display: block !important;
    height: 22px !important;
    max-width: 130px !important;
    margin: 0 !important;
  }

  body.theme-modern-light .page-header.navbar .top-menu {
    order: 2;
    float: none !important;
    clear: none !important;
    display: flex !important;
    align-items: center !important;
    height: 50px !important;
    margin: 0 0 0 auto !important;
    padding: 0 !important;
    background: transparent !important;
    position: relative;
    z-index: 10040;
  }

  body.theme-modern-light .page-header.navbar .top-menu .navbar-nav {
    display: flex !important;
    align-items: center;
    margin: 0 !important;
    float: none !important;
  }

  body.theme-modern-light .page-header.navbar .top-menu .navbar-nav > li.dropdown-user {
    float: none !important;
  }

  body.theme-modern-light .page-header.navbar .top-menu .navbar-nav > li.dropdown-user > .dropdown-toggle {
    padding: 4px !important;
    gap: 0;
    background: transparent !important;
  }

  body.theme-modern-light .page-header.navbar .top-menu .navbar-nav > li.dropdown-user > .dropdown-toggle:hover,
  body.theme-modern-light .page-header.navbar .top-menu .navbar-nav > li.dropdown-user.open > .dropdown-toggle {
    background: #f1f5f9 !important;
  }

  body.theme-modern-light .page-header.navbar .top-menu .navbar-nav > li.dropdown-user .img-circle {
    width: 32px !important;
    height: 32px !important;
  }

  body.theme-modern-light .page-header.navbar .top-menu .navbar-nav > li.dropdown-user > .dropdown-toggle > .fa-angle-down,
  body.theme-modern-light .page-header.navbar .top-menu .navbar-nav > li.dropdown-user .username {
    display: none !important;
  }

  body.theme-modern-light .page-content {
    padding: 12px 12px 24px !important;
  }

  body.theme-modern-light .page-bar {
    margin-bottom: 8px !important;
  }
}

@media (max-width: 480px) {
  body.theme-modern-light.page-header-fixed .page-container,
  body.theme-modern-light.page-header-fixed.page-header-fixed-mobile .page-container {
    margin-top: 50px !important;
  }

  body.theme-modern-light .page-header.navbar,
  body.theme-modern-light.page-header-fixed.page-header-fixed-mobile .page-header.navbar {
    height: 50px !important;
    min-height: 50px !important;
  }

  body.theme-modern-light .page-header.navbar .top-menu {
    display: flex !important;
    clear: none !important;
    float: none !important;
    background: transparent !important;
  }

  body.theme-modern-light .page-header.navbar .page-logo .logo-default {
    max-width: 110px !important;
    height: 20px !important;
  }

  body.theme-modern-light .page-header.navbar .top-menu .navbar-nav > li.dropdown-user > .dropdown-menu {
    right: 0 !important;
    left: auto !important;
    width: min(260px, calc(100vw - 20px));
  }
}

/* Prevent page horizontal scroll */
body.theme-modern-light,
body.theme-modern-light .page-wrapper,
body.theme-modern-light .page-container,
body.theme-modern-light .page-content-wrapper,
body.theme-modern-light .page-content {
  max-width: 100%;
  overflow-x: hidden;
}

body.theme-modern-light .page-header.navbar {
  z-index: 9995;
}

/* =========================================================
   PHASE A — Shared chrome (P3/P4/P7/P14/P17)
   Buttons/modals partially above; DT, filters, forms, alerts here.
   ========================================================= */

/* ---- P17: Striped tables ---- */
body.theme-modern-light .table-striped > tbody > tr:nth-of-type(odd) > td,
body.theme-modern-light .table-striped > tbody > tr:nth-of-type(odd) > th,
body.theme-modern-light table.dataTable.stripe tbody tr.odd > td,
body.theme-modern-light table.dataTable.display tbody tr.odd > td {
  background: #f8fafc !important;
}

body.theme-modern-light .table-striped > tbody > tr:nth-of-type(even) > td,
body.theme-modern-light table.dataTable.stripe tbody tr.even > td,
body.theme-modern-light table.dataTable.display tbody tr.even > td {
  background: var(--sd-surface) !important;
}

/* ---- P4: DataTables chrome ---- */
body.theme-modern-light .dataTables_wrapper {
  color: var(--sd-text);
  font-family: var(--sd-font);
}

body.theme-modern-light .dataTables_wrapper .dataTables_length,
body.theme-modern-light .dataTables_wrapper .dataTables_filter,
body.theme-modern-light .dataTables_wrapper .dataTables_info,
body.theme-modern-light .dataTables_wrapper .dataTables_paginate {
  color: var(--sd-muted) !important;
  font-size: 13px !important;
}

body.theme-modern-light .dataTables_wrapper .dataTables_length label,
body.theme-modern-light .dataTables_wrapper .dataTables_filter label {
  font-weight: 500 !important;
  color: var(--sd-muted) !important;
}

body.theme-modern-light .dataTables_wrapper .dataTables_length select,
body.theme-modern-light .dataTables_wrapper .dataTables_filter input {
  border: 1px solid var(--sd-border) !important;
  border-radius: var(--sd-radius-sm) !important;
  background: var(--sd-surface) !important;
  color: var(--sd-text) !important;
  box-shadow: none !important;
  height: 32px;
  padding: 4px 10px !important;
  font-size: 13px !important;
}

body.theme-modern-light .dataTables_wrapper .dataTables_filter input:focus,
body.theme-modern-light .dataTables_wrapper .dataTables_length select:focus {
  border-color: var(--sd-primary) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12) !important;
  outline: none !important;
}

body.theme-modern-light .dataTables_wrapper .dataTables_paginate .paginate_button {
  border: 1px solid var(--sd-border) !important;
  background: var(--sd-surface) !important;
  color: var(--sd-muted) !important;
  border-radius: 6px !important;
  margin: 0 2px !important;
  padding: 4px 10px !important;
  box-shadow: none !important;
}

body.theme-modern-light .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: var(--sd-primary-soft) !important;
  border-color: #c7d2fe !important;
  color: var(--sd-primary) !important;
}

body.theme-modern-light .dataTables_wrapper .dataTables_paginate .paginate_button.current,
body.theme-modern-light .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: var(--sd-primary) !important;
  border-color: var(--sd-primary) !important;
  color: #fff !important;
}

body.theme-modern-light .dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
body.theme-modern-light .dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
  background: #f8fafc !important;
  border-color: var(--sd-border) !important;
  color: #94a3b8 !important;
  cursor: not-allowed !important;
}

body.theme-modern-light .dataTables_wrapper .dataTables_processing {
  background: var(--sd-surface) !important;
  border: 1px solid var(--sd-border) !important;
  border-radius: var(--sd-radius-sm) !important;
  color: var(--sd-text) !important;
  box-shadow: var(--sd-shadow-sm) !important;
}

/* Bulk actions: Metronic copies .table-actions-wrapper into .table-group-actions then removes it.
   Do NOT force-show .table-actions-wrapper (would duplicate buttons). */
body.theme-modern-light .dataTables_wrapper .table-group-actions,
body.theme-modern-light .table-group-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
}

body.theme-modern-light .table-group-actions .btn,
body.theme-modern-light .table-actions-wrapper .btn {
  margin: 0 !important;
  white-space: nowrap;
}

body.theme-modern-light .table-container .table-scrollable,
body.theme-modern-light .dataTables_wrapper .table-responsive,
body.theme-modern-light .dataTables_scroll {
  border: 1px solid var(--sd-border) !important;
  border-radius: var(--sd-radius) !important;
  background: var(--sd-surface);
}

body.theme-modern-light .dataTables_scrollHead {
  border-bottom-color: var(--sd-border) !important;
}

body.theme-modern-light .dataTables_scrollBody {
  border-bottom-color: var(--sd-border) !important;
}

/* Filter row inputs inside DataTables */
body.theme-modern-light table.dataTable thead .form-filter,
body.theme-modern-light table.dataTable thead input.form-control,
body.theme-modern-light table.dataTable thead select.form-control,
body.theme-modern-light .table thead .form-filter {
  border-radius: 6px !important;
  border-color: var(--sd-border) !important;
  font-size: 12px !important;
  height: 30px;
  padding: 4px 8px !important;
}

body.theme-modern-light .portlet > .portlet-title > .actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  float: none !important;
  margin: 0;
}

body.theme-modern-light .portlet.light > .portlet-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

body.theme-modern-light .portlet.light > .portlet-title > .caption {
  float: none !important;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

body.theme-modern-light .portlet.light > .portlet-title > .actions {
  float: none !important;
}

@media (max-width: 767px) {
  body.theme-modern-light .dataTables_wrapper .dataTables_length,
  body.theme-modern-light .dataTables_wrapper .dataTables_filter,
  body.theme-modern-light .dataTables_wrapper .dataTables_info,
  body.theme-modern-light .dataTables_wrapper .dataTables_paginate {
    float: none !important;
    text-align: left !important;
    width: 100%;
    margin-bottom: 10px;
  }

  body.theme-modern-light .dataTables_wrapper .dataTables_filter input {
    width: 100% !important;
    margin-left: 0 !important;
    display: block;
    margin-top: 6px;
  }

  body.theme-modern-light .dataTables_wrapper .dataTables_length select {
    margin: 0 6px;
  }

  body.theme-modern-light .table-group-actions,
  body.theme-modern-light .table-actions-wrapper {
    width: 100%;
  }

  body.theme-modern-light .table-group-actions .btn,
  body.theme-modern-light .table-actions-wrapper .btn {
    flex: 1 1 auto;
    min-width: calc(50% - 8px);
    justify-content: center;
  }

  body.theme-modern-light .dataTables_wrapper .table-responsive,
  body.theme-modern-light .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  body.theme-modern-light .portlet.light > .portlet-title {
    flex-direction: column;
    align-items: flex-start;
  }

  body.theme-modern-light .portlet > .portlet-title > .actions {
    width: 100%;
  }
}

@media (min-width: 768px) and (max-width: 1365px) {
  body.theme-modern-light .table-group-actions .btn,
  body.theme-modern-light .table-actions-wrapper .btn {
    font-size: 12px !important;
    padding: 5px 10px !important;
  }
}

/* ---- P14: Metronic checkboxes / radios ---- */
body.theme-modern-light .mt-checkbox > span,
body.theme-modern-light .mt-radio > span {
  border-color: var(--sd-border) !important;
  background: var(--sd-surface) !important;
}

body.theme-modern-light .mt-checkbox:hover > span,
body.theme-modern-light .mt-radio:hover > span {
  border-color: #94a3b8 !important;
}

body.theme-modern-light .mt-checkbox > input:checked ~ span,
body.theme-modern-light .mt-radio > input:checked ~ span {
  border-color: var(--sd-primary) !important;
  background: var(--sd-primary) !important;
}

body.theme-modern-light .mt-checkbox > input:checked ~ span:after {
  border-color: #fff !important;
}

body.theme-modern-light .mt-radio > input:checked ~ span:after {
  background: #fff !important;
  border-color: #fff !important;
}

body.theme-modern-light .mt-checkbox > input:disabled ~ span,
body.theme-modern-light .mt-radio > input:disabled ~ span {
  opacity: 0.55;
  background: #f1f5f9 !important;
}

body.theme-modern-light .mt-checkbox-outline > span,
body.theme-modern-light .mt-radio-outline > span {
  border-color: var(--sd-border) !important;
}

body.theme-modern-light .mt-checkbox-outline > input:checked ~ span,
body.theme-modern-light .mt-radio-outline > input:checked ~ span {
  border-color: var(--sd-primary) !important;
  background: transparent !important;
}

body.theme-modern-light .mt-checkbox-outline > input:checked ~ span:after {
  border-color: var(--sd-primary) !important;
}

body.theme-modern-light .mt-radio-outline > input:checked ~ span:after {
  background: var(--sd-primary) !important;
}

/* Group checkable in tables */
body.theme-modern-light table.dataTable .mt-checkbox > span,
body.theme-modern-light .table .mt-checkbox > span {
  border-color: var(--sd-border) !important;
}

/* ---- P14: SweetAlert ---- */
body.theme-modern-light .sweet-alert {
  background: var(--sd-surface) !important;
  border-radius: var(--sd-radius) !important;
  border: 1px solid var(--sd-border) !important;
  box-shadow: var(--sd-shadow) !important;
  font-family: var(--sd-font) !important;
}

body.theme-modern-light .sweet-alert h2 {
  color: var(--sd-text) !important;
  font-family: var(--sd-font) !important;
  font-weight: 600 !important;
  font-size: 18px !important;
}

body.theme-modern-light .sweet-alert p {
  color: var(--sd-muted) !important;
  font-size: 14px !important;
}

body.theme-modern-light .sweet-alert button {
  border-radius: var(--sd-radius-sm) !important;
  font-family: var(--sd-font) !important;
  font-weight: 600 !important;
  box-shadow: none !important;
}

body.theme-modern-light .sweet-alert button.confirm {
  background: var(--sd-primary) !important;
  border-color: var(--sd-primary) !important;
}

body.theme-modern-light .sweet-alert button.cancel {
  background: #e2e8f0 !important;
  color: var(--sd-text) !important;
}

body.theme-modern-light .sweet-alert .sa-icon.sa-success .sa-placeholder {
  border-color: rgba(5, 150, 105, 0.35) !important;
}

body.theme-modern-light .sweet-alert .sa-icon.sa-success .sa-line {
  background-color: var(--sd-ok) !important;
}

body.theme-modern-light .sweet-alert .sa-icon.sa-error {
  border-color: rgba(220, 38, 38, 0.4) !important;
}

body.theme-modern-light .sweet-alert .sa-icon.sa-error .sa-line {
  background-color: var(--sd-err) !important;
}

body.theme-modern-light .sweet-alert .sa-icon.sa-warning {
  border-color: rgba(217, 119, 6, 0.45) !important;
}

body.theme-modern-light .sweet-alert .sa-icon.sa-warning .sa-body,
body.theme-modern-light .sweet-alert .sa-icon.sa-warning .sa-dot {
  background-color: var(--sd-warn) !important;
}

body.theme-modern-light .sweet-alert .sa-icon.sa-info {
  border-color: rgba(37, 99, 235, 0.4) !important;
}

body.theme-modern-light .sweet-alert .sa-icon.sa-info::before,
body.theme-modern-light .sweet-alert .sa-icon.sa-info::after {
  background-color: var(--sd-primary) !important;
}

/* ---- P14: Toastr ---- */
body.theme-modern-light #toast-container > div {
  border-radius: var(--sd-radius-sm) !important;
  box-shadow: var(--sd-shadow) !important;
  opacity: 1 !important;
  font-family: var(--sd-font) !important;
  font-size: 13px !important;
}

body.theme-modern-light #toast-container > .toast-success {
  background-color: var(--sd-ok) !important;
}

body.theme-modern-light #toast-container > .toast-error {
  background-color: var(--sd-err) !important;
}

body.theme-modern-light #toast-container > .toast-info {
  background-color: var(--sd-primary) !important;
}

body.theme-modern-light #toast-container > .toast-warning {
  background-color: var(--sd-warn) !important;
}

/* ---- Notes / alerts (shared install & list callouts) ---- */
body.theme-modern-light .note {
  border-radius: var(--sd-radius-sm) !important;
  border-left-width: 3px !important;
  box-shadow: none !important;
}

body.theme-modern-light .note.note-info {
  background: rgba(37, 99, 235, 0.06) !important;
  border-color: var(--sd-primary) !important;
  color: var(--sd-text) !important;
}

body.theme-modern-light .note.note-warning {
  background: rgba(217, 119, 6, 0.08) !important;
  border-color: var(--sd-warn) !important;
  color: var(--sd-text) !important;
}

body.theme-modern-light .note.note-danger {
  background: rgba(220, 38, 38, 0.06) !important;
  border-color: var(--sd-err) !important;
  color: var(--sd-text) !important;
}

body.theme-modern-light .note.note-success {
  background: rgba(5, 150, 105, 0.08) !important;
  border-color: var(--sd-ok) !important;
  color: var(--sd-text) !important;
}

body.theme-modern-light .alert {
  border-radius: var(--sd-radius-sm) !important;
  border-width: 1px !important;
  font-family: var(--sd-font) !important;
}

body.theme-modern-light .alert-info {
  background: rgba(37, 99, 235, 0.08) !important;
  border-color: #bfdbfe !important;
  color: #1e3a8a !important;
}

body.theme-modern-light .alert-warning {
  background: rgba(217, 119, 6, 0.1) !important;
  border-color: #fde68a !important;
  color: #92400e !important;
}

body.theme-modern-light .alert-danger {
  background: rgba(220, 38, 38, 0.08) !important;
  border-color: #fecaca !important;
  color: #991b1b !important;
}

body.theme-modern-light .alert-success {
  background: rgba(5, 150, 105, 0.1) !important;
  border-color: #a7f3d0 !important;
  color: #065f46 !important;
}

/* Safety: any leftover modal % widths at phone sizes */
@media (max-width: 767px) {
  body.theme-modern-light .modal-dialog[style*="width"] {
    width: auto !important;
    max-width: calc(100% - 20px) !important;
    margin: 10px auto !important;
  }
}
