/* Modern dark theme — sidebar & top bar (AlignUI-inspired) */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --th-bg-main: #121212;
  --th-bg-sidebar: #1a1a1a;
  --th-bg-sidebar-hover: #252525;
  --th-bg-topbar: #121212;
  --th-bg-input: #252525;
  --th-bg-active: #2a2a2a;
  --th-bg-panel: #1a1a1a;
  --th-border: #2e2e2e;
  --th-border-subtle: #333333;
  --th-text-primary: #f5f5f5;
  --th-text-secondary: #a3a3a3;
  --th-text-muted: #737373;
  --th-accent: #335cff;
  --th-accent-soft: rgba(51, 92, 255, 0.15);
  --th-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  --th-sidebar-width: 260px;
  --th-sidebar-collapsed: 72px;
  --th-radius: 10px;
  --th-radius-sm: 8px;
  --th-table-head-bg: #252525;
  --th-table-head-text: #f5f5f5;
  --th-table-row-bg: #1a1a1a;
  --th-table-row-alt-bg: #202020;
  --th-table-row-hover: #2a2a2a;
  --th-table-row-selected: rgba(51, 92, 255, 0.18);
  --th-table-cell-text: #d4d4d4;
  --th-table-link: #6b9bff;
}

html.light-mode {
  --th-bg-main: #edf0f4;
  --th-bg-sidebar: #ffffff;
  --th-bg-sidebar-hover: #edf0f4;
  --th-bg-topbar: #ffffff;
  --th-bg-input: #ffffff;
  --th-bg-active: #e2e8ef;
  --th-bg-panel: #ffffff;
  --th-bg-section-header: #eef6f9;
  --th-border: #d8e0e8;
  --th-border-subtle: #c8d4de;
  --th-text-primary: #18181b;
  --th-text-secondary: #52525b;
  --th-text-muted: #71717a;
  --th-accent: #335cff;
  --th-accent-soft: rgba(51, 92, 255, 0.1);
  --th-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
  --th-table-head-bg: #e8edf2;
  --th-table-head-text: #18181b;
  --th-table-row-bg: #ffffff;
  --th-table-row-alt-bg: #f4f7fa;
  --th-table-row-hover: #eef2f6;
  --th-table-row-selected: rgba(51, 92, 255, 0.12);
  --th-table-cell-text: #3f3f46;
  --th-table-link: #335cff;
}

html.light-mode .modern-theme,
html.light-mode .modern-theme body,
html.light-mode .modern-theme .container.body,
html.light-mode .modern-theme .main_container {
  background: var(--th-bg-main) !important;
}

.modern-theme {
  font-family: 'Inter', "Helvetica Neue", Roboto, Arial, sans-serif;
}

.modern-theme,
.modern-theme body {
  background: var(--th-bg-main) !important;
  color: var(--th-text-secondary);
}

/* ── Sidebar shell ── */

.modern-theme .left_col,
.modern-theme .nav_title,
.modern-theme .sidebar-footer {
  background: var(--th-bg-sidebar) !important;
}

.modern-theme .left_col {
  border-right: 1px solid var(--th-border);
}

.modern-theme .container.body .col-md-3.left_col {
  position: fixed !important;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 1040 !important;
}

.modern-theme.nav-md .container.body .col-md-3.left_col,
.modern-theme .nav_title,
.modern-theme .sidebar-footer {
  width: var(--th-sidebar-width) !important;
}

.modern-theme.nav-md .container.body .right_col,
.modern-theme .main_container .top_nav {
  margin-left: var(--th-sidebar-width) !important;
}

.modern-theme .main_container .top_nav {
  position: relative;
  z-index: 1030 !important;
}

.modern-theme .container.body .right_col {
  position: relative;
  /* z-index intentionally omitted — a low value traps Bootstrap modals below .modal-backdrop */
}

.modern-theme.nav-sm .container.body .col-md-3.left_col {
  width: var(--th-sidebar-collapsed) !important;
}

.modern-theme.nav-sm .main_container .top_nav {
  margin-left: var(--th-sidebar-collapsed) !important;
}

.modern-theme.nav-sm .container.body .right_col {
  margin-left: var(--th-sidebar-collapsed) !important;
}

.modern-theme .left_col.scroll-view {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-bottom: 88px;
}

/* ── Brand header ── */

.modern-theme a.th-brand-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--th-border);
  margin-bottom: 8px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.modern-theme a.th-brand-header:hover,
.modern-theme a.th-brand-header:focus {
  text-decoration: none;
  color: inherit;
}

.modern-theme .th-brand-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--th-radius-sm);
  background: linear-gradient(135deg, #335cff 0%, #1a44cc 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.modern-theme .th-brand-icon img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  margin: 0 !important;
}

.modern-theme .th-brand-text {
  flex: 1;
  min-width: 0;
}

.modern-theme .th-brand-name {
  display: block;
  color: var(--th-text-primary);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modern-theme .th-brand-subtitle {
  display: block;
  color: var(--th-text-muted);
  font-size: 12px;
  line-height: 1.3;
  margin-top: 2px;
}

.modern-theme .navbar.nav_title {
  height: auto !important;
  float: none !important;
  border: 0 !important;
  background: transparent !important;
}

.modern-theme .navbar.nav_title .site_title {
  display: none;
}

.modern-theme.nav-sm .th-brand-text,
.modern-theme.nav-sm .th-menu-heading,
.modern-theme.nav-sm .th-sidebar-user-info,
.modern-theme.nav-sm .nav.side-menu > li > a .fa-chevron-down,
.modern-theme.nav-sm .main_menu span.fa.fa-chevron-down {
  display: none !important;
}

.modern-theme.nav-sm .th-brand-header {
  justify-content: center;
  padding: 14px 0;
  margin-bottom: 4px;
}

.modern-theme.nav-sm .th-brand-icon {
  width: 32px;
  height: 32px;
}

.modern-theme.nav-sm .th-brand-icon img {
  width: 18px;
  height: 18px;
}

.modern-theme.nav-sm .navbar.nav_title {
  width: var(--th-sidebar-collapsed) !important;
  overflow: visible;
}

.modern-theme.nav-sm .container.body .col-md-3.left_col {
  width: var(--th-sidebar-collapsed) !important;
  z-index: 1040 !important;
  overflow: visible !important;
}

.modern-theme.nav-sm .left_col {
  overflow: visible !important;
}

.modern-theme.nav-sm .left_col.scroll-view {
  overflow: visible !important;
}

.modern-theme.nav-sm #sidebar-menu.main_menu {
  overflow: visible !important;
}

.modern-theme.nav-sm .left_col .mCSB_scrollTools {
  display: none !important;
}

.modern-theme.nav-sm #sidebar-menu.main_menu {
  padding: 0 6px;
}

.modern-theme.nav-sm .nav.side-menu > li > a {
  font-size: 0 !important;
  text-align: center !important;
  justify-content: center;
  padding: 10px 6px !important;
  overflow: visible;
  white-space: nowrap;
}

.modern-theme.nav-sm .nav.side-menu > li > a i:first-child {
  font-size: 18px !important;
  margin: 0 !important;
  width: auto !important;
}

.modern-theme.nav-sm .nav.side-menu > li.active-sm > a,
.modern-theme.nav-sm .nav.side-menu > li.active > a {
  color: var(--th-text-primary) !important;
  background: var(--th-bg-active) !important;
}

.modern-theme.nav-sm .nav.side-menu li.active-sm,
.modern-theme.nav-sm .nav.child_menu li.active {
  border-right: none !important;
}

.modern-theme.nav-sm ul.nav.child_menu {
  left: 100%;
  width: 220px;
  padding: 6px;
  z-index: 1070 !important;
  position: absolute !important;
}

.modern-theme.nav-sm .nav.side-menu > li {
  position: relative;
}

.modern-theme.nav-sm ul.nav.child_menu li {
  padding: 0;
}

.modern-theme.nav-sm ul.nav.child_menu li a {
  font-size: 12px !important;
  text-align: left !important;
  padding: 8px 12px !important;
}

.modern-theme.nav-sm .nav.side-menu > li > a[data-th-tooltip],
.modern-theme.nav-sm .th-brand-header[data-th-tooltip],
.modern-theme.nav-sm .th-sidebar-user[data-th-tooltip] {
  position: relative;
}

.modern-theme.nav-sm .nav.side-menu > li > a[data-th-tooltip]::after,
.modern-theme.nav-sm .th-brand-header[data-th-tooltip]::after,
.modern-theme.nav-sm .th-sidebar-user[data-th-tooltip]::after {
  content: attr(data-th-tooltip);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  padding: 6px 12px;
  background: var(--th-bg-panel);
  color: var(--th-text-primary);
  border: 1px solid var(--th-border);
  border-radius: var(--th-radius-sm);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 1060;
  box-shadow: var(--th-shadow);
  transition: opacity 0.15s ease, visibility 0.15s ease;
}

.modern-theme.nav-sm .nav.side-menu > li > a[data-th-tooltip]:hover::after,
.modern-theme.nav-sm .th-brand-header[data-th-tooltip]:hover::after,
.modern-theme.nav-sm .th-sidebar-user[data-th-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
}

/* Keep flyout submenu visible above tooltips when a section is open */
.modern-theme.nav-sm .nav.side-menu > li.active > a[data-th-tooltip]::after,
.modern-theme.nav-sm .nav.side-menu > li.active-sm > a[data-th-tooltip]::after,
.modern-theme.nav-sm .nav.side-menu > li.active > a[data-th-tooltip]:hover::after,
.modern-theme.nav-sm .nav.side-menu > li.active-sm > a[data-th-tooltip]:hover::after {
  opacity: 0 !important;
  visibility: hidden !important;
}

.modern-theme.nav-sm .th-brand-header[data-th-tooltip]::after,
.modern-theme.nav-sm .th-sidebar-user[data-th-tooltip]::after {
  left: calc(100% + 6px);
}

/* ── Sidebar menu ── */

.modern-theme #sidebar-menu.main_menu {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 10px;
}

.modern-theme .menu_section {
  margin-bottom: 20px;
}

.modern-theme .th-menu-heading {
  display: block;
  padding: 8px 12px 6px;
  color: var(--th-text-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.modern-theme .nav.side-menu > li > a {
  color: var(--th-text-secondary) !important;
  font-size: 13px;
  font-weight: 500;
  padding: 10px 12px !important;
  margin-bottom: 2px;
  border-radius: var(--th-radius-sm);
  transition: background 0.15s ease, color 0.15s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modern-theme .nav.side-menu > li > a i:first-child {
  width: 18px;
  text-align: center;
  font-size: 15px !important;
  color: var(--th-text-muted);
  flex-shrink: 0;
}

.modern-theme .nav.side-menu > li > a:hover {
  background: var(--th-bg-sidebar-hover) !important;
  color: var(--th-text-primary) !important;
}

.modern-theme .nav.side-menu > li > a:hover i:first-child {
  color: var(--th-text-secondary);
}

.modern-theme .nav.side-menu > li.active > a,
.modern-theme .nav.side-menu > li.current-page > a {
  background: var(--th-bg-active) !important;
  color: var(--th-text-primary) !important;
  box-shadow: none !important;
  text-shadow: none !important;
  border-right: none !important;
}

.modern-theme .nav.side-menu > li.active,
.modern-theme .nav.side-menu > li.current-page {
  border-right: none !important;
}

.modern-theme .nav.side-menu > li.active > a i:first-child,
.modern-theme .nav.side-menu > li.current-page > a i:first-child {
  color: var(--th-text-primary);
}

.modern-theme .main_menu span.fa.fa-chevron-down {
  margin-left: auto;
  margin-top: 0;
  font-size: 10px;
  color: var(--th-text-muted);
  float: none;
  min-width: auto;
}

.modern-theme .nav.child_menu {
  background: transparent !important;
  padding: 4px 0;
}

.modern-theme.nav-md .nav.side-menu > li.active > ul.child_menu,
.modern-theme.nav-md .nav.side-menu > li.current-page > ul.child_menu {
  display: block;
}

.modern-theme .nav.child_menu > li > a {
  color: var(--th-text-muted) !important;
  font-size: 12px;
  padding: 8px 12px 8px 20px !important;
  border-radius: var(--th-radius-sm);
}

.modern-theme .nav.child_menu > li > a:hover,
.modern-theme .nav.child_menu > li.active > a {
  color: var(--th-text-primary) !important;
  background: var(--th-bg-sidebar-hover) !important;
}

/* Remove legacy Gentelella tree lines/dots on submenu items */
.modern-theme ul.nav.child_menu li:before,
.modern-theme ul.nav.child_menu li:after,
.modern-theme.nav-md ul.nav.child_menu li:before,
.modern-theme.nav-md ul.nav.child_menu li:after {
  display: none !important;
  content: none !important;
}

.modern-theme .nav.child_menu li {
  padding-left: 0;
  position: static !important;
}

.modern-theme .nav.side-menu > li.active,
.modern-theme .nav.side-menu > li.current-page,
.modern-theme .nav.side-menu > li.active-sm {
  border-right: none !important;
}

.modern-theme.nav-sm ul.nav.child_menu {
  background: var(--th-bg-sidebar) !important;
  border: 1px solid var(--th-border);
  border-radius: var(--th-radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* ── Sidebar user card ── */

.modern-theme .sidebar-footer {
  display: none !important;
}

.modern-theme .th-sidebar-user {
  position: fixed;
  bottom: 0;
  left: 0;
  width: var(--th-sidebar-width);
  padding: 12px 14px 16px;
  background: var(--th-bg-sidebar);
  border-top: 1px solid var(--th-border);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 1040 !important;
}

.modern-theme.nav-sm .th-sidebar-user {
  width: var(--th-sidebar-collapsed);
  justify-content: center;
  padding: 12px 8px;
}

.modern-theme .th-sidebar-user img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--th-border-subtle);
}

.modern-theme .th-sidebar-user-info {
  min-width: 0;
  flex: 1;
}

.modern-theme .th-sidebar-user-name {
  display: block;
  color: var(--th-text-primary);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modern-theme .th-sidebar-user-email {
  display: block;
  color: var(--th-text-muted);
  font-size: 11px;
  line-height: 1.3;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Top navigation ── */

.modern-theme .top_nav .nav_menu,
.modern-theme .th-nav-menu {
  background: var(--th-bg-topbar) !important;
  border-bottom: 1px solid var(--th-border) !important;
  margin-bottom: 0 !important;
  padding: 0 24px;
  min-height: 64px;
}

.modern-theme .th-top-nav-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-height: 64px;
}

.modern-theme .top_nav .toggle {
  width: auto;
  padding-top: 0;
  flex-shrink: 0;
}

.modern-theme .top_nav .toggle a {
  padding: 8px;
  color: var(--th-text-secondary) !important;
  border-radius: var(--th-radius-sm);
  transition: background 0.15s ease;
}

.modern-theme .top_nav .toggle a:hover {
  background: var(--th-bg-input);
}

.modern-theme .top_nav .toggle a i {
  font-size: 18px;
  color: var(--th-text-secondary);
}

/* Breadcrumbs */

.modern-theme .th-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  min-width: 0;
}

.modern-theme .th-breadcrumb-parent {
  color: var(--th-text-muted);
  font-size: 13px;
  font-weight: 500;
}

.modern-theme .th-breadcrumb-sep {
  color: var(--th-text-muted);
  font-size: 10px;
  opacity: 0.6;
}

.modern-theme .th-breadcrumb-current {
  color: var(--th-text-primary);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Top nav actions */

.modern-theme .th-top-nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  flex: 1;
  justify-content: flex-end;
  min-width: 0;
  width: 100%;
}

.modern-theme .th-search-wrap {
  flex: 1;
  max-width: 420px;
  min-width: 180px;
}

.modern-theme .th-search-wrap > div[id*="Panel"] {
  width: 100%;
}

.modern-theme .th-search-field {
  position: relative;
  display: block;
  width: 100%;
  height: 40px;
}

.modern-theme .th-search-field input.form-control,
.modern-theme #txt_searchbox,
.modern-theme .th-search-input {
  display: block !important;
  width: 100% !important;
  height: 40px !important;
  padding: 0 48px 0 40px !important;
  margin: 0 !important;
  float: none !important;
  background-color: var(--th-bg-input) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23737373' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.242 1.1a5.5 5.5 0 1 1 0-11 5.5 5.5 0 0 1 0 11z'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: 14px center !important;
  background-size: 14px 14px !important;
  border: 1px solid var(--th-border) !important;
  border-radius: var(--th-radius) !important;
  color: var(--th-text-primary) !important;
  font-size: 13px !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
  transition: border-color 0.15s ease;
}

html.light-mode .modern-theme .th-search-field input.form-control,
html.light-mode .modern-theme #txt_searchbox,
html.light-mode .modern-theme .th-search-input {
  background-color: #f4f7fa !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2371717a' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.242 1.1a5.5 5.5 0 1 1 0-11 5.5 5.5 0 0 1 0 11z'/%3E%3C/svg%3E") !important;
}

.modern-theme.nav-sm .container.body .right_col,
.modern-theme.nav-sm .main_container .top_nav {
  margin-left: var(--th-sidebar-collapsed) !important;
}

.modern-theme.nav-sm .nav.side-menu > li.active-sm > a {
  color: var(--th-text-primary) !important;
}

.modern-theme .th-search-field input.form-control:focus,
.modern-theme #txt_searchbox:focus,
.modern-theme .th-search-input:focus {
  border-color: var(--th-accent);
  outline: none;
  background-color: var(--th-bg-input);
}

.modern-theme .th-search-field input::placeholder {
  color: var(--th-text-muted);
}

.modern-theme .th-search-submit {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: var(--th-accent);
  color: #ffffff;
  font-size: 13px;
  cursor: pointer;
  z-index: 3;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.modern-theme .th-search-submit:hover {
  background: #2a4de6;
}

.modern-theme .th-search-submit:active {
  transform: translateY(-50%) scale(0.96);
}

.modern-theme .th-search-wrap #btnSubmit2 {
  display: none !important;
}

.modern-theme .th-search-clear {
  position: absolute;
  right: 44px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: var(--th-text-muted);
  cursor: pointer;
  z-index: 3;
  line-height: 1;
}

.modern-theme .th-search-field .dropdown-content {
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  width: 100% !important;
  min-width: 100% !important;
  z-index: 10000;
}

.modern-theme .th-icon-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.modern-theme .th-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--th-radius-sm);
  color: var(--th-text-secondary) !important;
  background: transparent;
  border: none;
  transition: background 0.15s ease, color 0.15s ease;
  text-decoration: none !important;
}

.modern-theme .th-icon-btn:hover {
  background: var(--th-bg-input);
  color: var(--th-text-primary) !important;
}

.modern-theme .th-icon-btn i {
  font-size: 16px;
}

.modern-theme .top_nav .navbar-right {
  width: auto !important;
  float: none !important;
  margin: 0 !important;
  display: flex;
  align-items: center;
}

.modern-theme .top_nav .navbar-right > li {
  float: none !important;
  display: flex;
  align-items: center;
}

.modern-theme a.user-profile {
  display: flex !important;
  align-items: center;
  padding: 4px !important;
  border-radius: 50%;
  color: transparent !important;
  background: transparent !important;
}

.modern-theme a.user-profile:hover,
.modern-theme a.user-profile:focus {
  background: var(--th-bg-input) !important;
}

.modern-theme a.user-profile img {
  width: 32px !important;
  height: 32px !important;
  margin-right: 0 !important;
  border: 2px solid var(--th-border-subtle);
}

.modern-theme a.user-profile .label-control,
.modern-theme a.user-profile .fa-angle-down {
  display: none !important;
}

.modern-theme .top_nav .nav > li > a:focus,
.modern-theme .top_nav .nav > li > a:hover,
.modern-theme .top_nav .nav .open > a,
.modern-theme .top_nav .nav .open > a:focus,
.modern-theme .top_nav .nav .open > a:hover {
  background: transparent !important;
}

.modern-theme .dropdown-usermenu {
  background: var(--th-bg-sidebar) !important;
  border: 1px solid var(--th-border) !important;
  border-radius: var(--th-radius) !important;
  box-shadow: var(--th-shadow) !important;
  margin-top: 8px !important;
  padding: 6px !important;
  min-width: 180px;
}

.modern-theme .dropdown-usermenu li a,
.modern-theme .dropdown-usermenu li .aspNetDisabled {
  color: var(--th-text-secondary) !important;
  border-radius: var(--th-radius-sm);
  padding: 10px 14px !important;
  font-size: 13px;
}

.modern-theme .dropdown-usermenu li a:hover {
  background: var(--th-bg-input) !important;
  color: var(--th-text-primary) !important;
}

.modern-theme .dropdown-usermenu .th-dropdown-divider {
  height: 1px;
  margin: 6px 8px;
  background: var(--th-border);
  padding: 0 !important;
}

.modern-theme .dropdown-usermenu .th-theme-toggle-item {
  padding: 0 !important;
}

.modern-theme .th-theme-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  cursor: default;
}

.modern-theme .th-theme-toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--th-text-secondary);
  font-size: 13px;
  font-weight: 500;
  user-select: none;
}

.modern-theme .th-theme-toggle-label i {
  width: 16px;
  text-align: center;
  color: var(--th-text-muted);
  font-size: 14px;
}

.modern-theme .th-theme-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  margin: 0;
  flex-shrink: 0;
  cursor: pointer;
}

.modern-theme .th-theme-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.modern-theme .th-theme-slider {
  position: absolute;
  inset: 0;
  background: var(--th-border-subtle);
  border-radius: 22px;
  transition: background 0.2s ease;
}

.modern-theme .th-theme-slider:before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  bottom: 3px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.modern-theme .th-theme-switch input:checked + .th-theme-slider {
  background: var(--th-accent);
}

.modern-theme .th-theme-switch input:checked + .th-theme-slider:before {
  transform: translateX(18px);
}

html.light-mode .modern-theme .th-theme-switch input:not(:checked) + .th-theme-slider {
  background: var(--th-border-subtle);
}

/* ── Main content area ── */

.modern-theme .container.body .right_col {
  background: var(--th-bg-main) !important;
  padding: 12px 24px 0 !important;
}

.modern-theme footer {
  background: var(--th-bg-main) !important;
  border-top: 1px solid var(--th-border);
  color: var(--th-text-muted) !important;
  padding: 16px 24px;
}

.modern-theme footer a {
  color: var(--th-accent) !important;
}

@media (min-width: 992px) {
  .modern-theme footer {
    margin-left: var(--th-sidebar-width) !important;
  }

  .modern-theme.nav-sm footer {
    margin-left: var(--th-sidebar-collapsed) !important;
  }
}

/* ── Responsive ── */

@media (max-width: 991px) {
  .modern-theme .th-breadcrumbs {
    display: none;
  }

  .modern-theme .th-search-wrap {
    max-width: none;
  }

  .modern-theme .th-sidebar-user {
    display: none;
  }
}

@media (max-width: 768px) {
  .modern-theme .th-top-nav-actions {
    gap: 8px;
  }

  .modern-theme .th-icon-actions .th-icon-btn:not(:last-child) {
    display: none;
  }
}

/* Search dropdown (global search results) */

.modern-theme .dropdown-content {
  background-color: var(--th-bg-sidebar) !important;
  border: 1px solid var(--th-border) !important;
  border-radius: var(--th-radius) !important;
  box-shadow: var(--th-shadow) !important;
  margin-top: 6px;
}

.modern-theme .dropdown-content a {
  color: var(--th-text-secondary) !important;
}

.modern-theme .dropdown-content a:hover {
  background-color: var(--th-bg-input) !important;
  color: var(--th-text-primary) !important;
}

/* Content area helpers */

.modern-theme .x_title {
  border-bottom-color: var(--th-border) !important;
}

html.light-mode .modern-theme .x_title {
  background: var(--th-bg-section-header);
  border-bottom-color: #d4e8ee !important;
}

html.light-mode .modern-theme .x_panel {
  box-shadow: var(--th-shadow);
}

html.light-mode .modern-theme .th-dash-panel__head {
  background: var(--th-bg-section-header);
  border-bottom-color: #d4e8ee;
}

.modern-theme .x_title h2,
.modern-theme .x_title h3,
.modern-theme h1, .modern-theme h2, .modern-theme h3, .modern-theme h4 {
  color: var(--th-text-primary);
}

.modern-theme .x_panel {
  background: var(--th-bg-panel) !important;
  border-color: var(--th-border) !important;
  border-radius: var(--th-radius);
}

.modern-theme .tile {
  background: var(--th-bg-panel) !important;
  border: 1px solid var(--th-border);
  border-radius: var(--th-radius);
}

.modern-theme .tile a,
.modern-theme .tile span,
.modern-theme .tile h2 {
  color: var(--th-text-primary) !important;
}

.modern-theme .tile span {
  color: var(--th-text-muted) !important;
}

.modern-theme .tile:hover {
  background: var(--th-bg-input) !important;
}

.modern-theme .table > thead > tr > th,
.modern-theme .table > tbody > tr > td {
  border-color: var(--th-border) !important;
}

.modern-theme .table-striped > tbody > tr:nth-of-type(odd) {
  background-color: var(--th-table-row-alt-bg);
}

.modern-theme .form-control,
.modern-theme textarea,
.modern-theme input.form-control,
.modern-theme textarea.form-control,
.modern-theme select.form-control {
  background-color: var(--th-bg-input) !important;
  border: 1px solid var(--th-border) !important;
  color: var(--th-text-primary) !important;
  border-radius: var(--th-radius-sm);
  box-shadow: none !important;
}

.modern-theme .form-control:focus,
.modern-theme textarea:focus,
.modern-theme textarea.form-control:focus {
  border-color: var(--th-accent) !important;
  outline: none;
  box-shadow: none !important;
}

.modern-theme textarea::placeholder,
.modern-theme .form-control::placeholder {
  color: var(--th-text-muted);
  opacity: 1;
}

.modern-theme textarea:disabled,
.modern-theme textarea[readonly],
.modern-theme .form-control:disabled,
.modern-theme .form-control[readonly] {
  background-color: var(--th-bg-panel) !important;
  color: var(--th-text-secondary) !important;
  opacity: 0.92;
}

/* ── DataTables & GridView tables ── */

.modern-theme .x_content {
  color: var(--th-text-secondary);
}

.modern-theme .page-title {
  height: auto !important;
  min-height: 0 !important;
  padding: 0 0 8px !important;
  margin-bottom: 0 !important;
}

.modern-theme .page-title .breadcrums p,
.modern-theme .page-title .breadcrums a {
  color: var(--th-text-secondary) !important;
}

.modern-theme .page-title .breadcrums a:hover {
  color: var(--th-accent) !important;
}

.modern-theme .x_title h2 a {
  color: var(--th-text-primary) !important;
}

.modern-theme div.dataTables_wrapper {
  color: var(--th-text-secondary);
}

.modern-theme div.dataTables_wrapper div.dataTables_length label,
.modern-theme div.dataTables_wrapper div.dataTables_filter label,
.modern-theme div.dataTables_wrapper div.dataTables_info {
  color: var(--th-text-secondary) !important;
}

.modern-theme div.dataTables_wrapper div.dataTables_length select,
.modern-theme div.dataTables_wrapper div.dataTables_filter input {
  background: var(--th-bg-input) !important;
  border: 1px solid var(--th-border) !important;
  color: var(--th-text-primary) !important;
  border-radius: var(--th-radius-sm);
  padding: 6px 10px;
  height: auto;
  box-shadow: none !important;
}

.modern-theme div.dataTables_wrapper div.dataTables_filter input {
  min-width: 180px;
  margin-left: 8px;
}

.modern-theme div.dataTables_wrapper div.dataTables_filter input:focus,
.modern-theme div.dataTables_wrapper div.dataTables_length select:focus {
  border-color: var(--th-accent) !important;
  outline: none;
}

.modern-theme .dataTables_processing {
  background-color: var(--th-bg-panel) !important;
  border-color: var(--th-border) !important;
  color: var(--th-text-secondary) !important;
}

.modern-theme table.dataTable,
.modern-theme table.jambo_table,
.modern-theme table.grid-table {
  background: var(--th-table-row-bg) !important;
  border-color: var(--th-border) !important;
  color: var(--th-table-cell-text) !important;
}

.modern-theme table.jambo_table thead,
.modern-theme table.dataTable thead th,
.modern-theme table.dataTable thead td,
.modern-theme table.table > thead > tr > th {
  background: var(--th-table-head-bg) !important;
  color: var(--th-table-head-text) !important;
  border-color: var(--th-border) !important;
}

.modern-theme table.dataTable.fixedHeader-floating,
.modern-theme table.dataTable.fixedHeader-locked {
  background-color: var(--th-table-head-bg) !important;
  z-index: 1025 !important;
  pointer-events: none;
}

.modern-theme table.dataTable.fixedHeader-floating thead,
.modern-theme table.dataTable.fixedHeader-locked thead,
.modern-theme table.dataTable.fixedHeader-floating th,
.modern-theme table.dataTable.fixedHeader-locked th {
  pointer-events: auto;
}

.modern-theme table.dataTable.fixedHeader-floating thead th,
.modern-theme table.dataTable.fixedHeader-locked thead th {
  background: var(--th-table-head-bg) !important;
  color: var(--th-table-head-text) !important;
}

.modern-theme table.dataTable tbody tr,
.modern-theme table.jambo_table tbody tr,
.modern-theme table.table > tbody > tr {
  background-color: var(--th-table-row-bg) !important;
}

.modern-theme table.table-striped > tbody > tr:nth-of-type(odd),
.modern-theme table.dataTable.stripe tbody tr.odd,
.modern-theme table.dataTable.display tbody tr.odd {
  background-color: var(--th-table-row-alt-bg) !important;
}

.modern-theme table.table-striped > tbody > tr:nth-of-type(even),
.modern-theme table.dataTable.stripe tbody tr.even,
.modern-theme table.dataTable.display tbody tr.even {
  background-color: var(--th-table-row-bg) !important;
}

.modern-theme table.dataTable tbody td,
.modern-theme table.dataTable tbody th,
.modern-theme table.jambo_table tbody td,
.modern-theme table.jambo_table tbody th,
.modern-theme table.table > tbody > tr > td,
.modern-theme table.table > tbody > tr > th {
  color: var(--th-table-cell-text) !important;
  border-color: var(--th-border) !important;
  background-color: transparent !important;
}

.modern-theme table.jambo_table tbody tr:hover td,
.modern-theme table.dataTable tbody tr:hover td,
.modern-theme table.table-hover > tbody > tr:hover > td {
  background: var(--th-table-row-hover) !important;
  border-color: var(--th-border) !important;
}

.modern-theme table.jambo_table tbody tr.selected,
.modern-theme table.jambo_table tbody tr.selected td,
.modern-theme table.dataTable tbody tr.selected td {
  background: var(--th-table-row-selected) !important;
}

.modern-theme table.dataTable tbody a:not(.btn),
.modern-theme table.jambo_table tbody a:not(.btn),
.modern-theme table.table tbody a:not(.btn) {
  color: var(--th-table-link) !important;
}

.modern-theme table.dataTable tbody a:not(.btn):hover,
.modern-theme table.jambo_table tbody a:not(.btn):hover,
.modern-theme table.table tbody a:not(.btn):hover {
  color: var(--th-accent) !important;
}

.modern-theme table.dataTable tbody label,
.modern-theme table.jambo_table tbody label,
.modern-theme table.table tbody label,
.modern-theme table.dataTable tbody span,
.modern-theme table.jambo_table tbody span {
  color: inherit !important;
}

.modern-theme table.dataTable .dataTables_empty {
  color: var(--th-text-muted) !important;
}

.modern-theme table.dataTable thead .sorting:after,
.modern-theme table.dataTable thead .sorting_asc:after,
.modern-theme table.dataTable thead .sorting_desc:after,
.modern-theme table.dataTable thead .sorting_asc_disabled:after,
.modern-theme table.dataTable thead .sorting_desc_disabled:after {
  color: var(--th-table-head-text) !important;
  opacity: 0.45;
}

.modern-theme table.dataTable thead .sorting_asc:after,
.modern-theme table.dataTable thead .sorting_desc:after {
  opacity: 0.85;
}

.modern-theme table.dataTable th.focus,
.modern-theme table.dataTable td.focus {
  outline: 2px solid var(--th-accent) !important;
}

.modern-theme .dataTables_wrapper .pagination > li > a,
.modern-theme .dataTables_wrapper .pagination > li > span {
  background: var(--th-bg-input) !important;
  border-color: var(--th-border) !important;
  color: var(--th-text-secondary) !important;
}

.modern-theme .dataTables_wrapper .pagination > li > a:hover,
.modern-theme .dataTables_wrapper .pagination > li > span:hover {
  background: var(--th-bg-sidebar-hover) !important;
  color: var(--th-text-primary) !important;
}

.modern-theme .dataTables_wrapper .pagination > .active > a,
.modern-theme .dataTables_wrapper .pagination > .active > a:focus,
.modern-theme .dataTables_wrapper .pagination > .active > a:hover,
.modern-theme .dataTables_wrapper .pagination > .active > span,
.modern-theme .dataTables_wrapper .pagination > .active > span:focus,
.modern-theme .dataTables_wrapper .pagination > .active > span:hover {
  background: var(--th-accent) !important;
  border-color: var(--th-accent) !important;
  color: #ffffff !important;
}

.modern-theme .dataTables_wrapper .pagination > .disabled > a,
.modern-theme .dataTables_wrapper .pagination > .disabled > a:focus,
.modern-theme .dataTables_wrapper .pagination > .disabled > a:hover,
.modern-theme .dataTables_wrapper .pagination > .disabled > span {
  background: var(--th-bg-panel) !important;
  border-color: var(--th-border) !important;
  color: var(--th-text-muted) !important;
}

.modern-theme .table-responsive {
  border-color: var(--th-border);
}

.modern-theme div.dataTables_scrollBody {
  background: var(--th-table-row-bg) !important;
}

.modern-theme div.dataTables_scrollHead,
.modern-theme div.dataTables_scrollFoot {
  background: var(--th-table-head-bg) !important;
}

.modern-theme table.table-bordered,
.modern-theme table.table-bordered > thead > tr > th,
.modern-theme table.table-bordered > tbody > tr > td {
  border-color: var(--th-border) !important;
}

.modern-theme .x_panel .dropdown-menu {
  background: var(--th-bg-sidebar) !important;
  border: 1px solid var(--th-border) !important;
  border-radius: var(--th-radius) !important;
  box-shadow: var(--th-shadow) !important;
}

.modern-theme .x_panel .dropdown-menu > li > a,
.modern-theme .x_panel .dropdown-item {
  color: var(--th-text-secondary) !important;
}

.modern-theme .x_panel .dropdown-menu > li > a:hover,
.modern-theme .x_panel .dropdown-item:hover {
  background: var(--th-bg-input) !important;
  color: var(--th-text-primary) !important;
}

.modern-theme .text-danger {
  color: #f87171 !important;
}

html.light-mode .modern-theme .text-danger {
  color: #dc2626 !important;
}

html.light-mode .modern-theme .left_col,
html.light-mode .modern-theme .left_col {
  box-shadow: 1px 0 0 var(--th-border);
}

html.light-mode .modern-theme.nav-sm ul.nav.child_menu {
  box-shadow: var(--th-shadow);
}

/* ── Tab navigation (bar_tabs / nav-tabs) ── */

.modern-theme .ln_solid {
  border-top: 1px solid var(--th-border) !important;
  background-color: transparent !important;
  color: transparent !important;
}

.modern-theme ul.bar_tabs,
.modern-theme ul.nav-tabs.bar_tabs {
  overflow: visible;
  background: transparent !important;
  border-bottom: 1px solid var(--th-border) !important;
  height: auto !important;
  min-height: 44px;
  margin: 16px 0 0 !important;
  padding: 0 0 0 4px !important;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 4px;
}

.modern-theme ul.bar_tabs > li,
.modern-theme ul.nav-tabs.bar_tabs > li {
  float: none !important;
  background: var(--th-bg-input) !important;
  border: 1px solid var(--th-border) !important;
  border-bottom: none !important;
  color: var(--th-text-secondary) !important;
  margin: 0 !important;
  border-radius: var(--th-radius-sm) var(--th-radius-sm) 0 0 !important;
  position: relative;
}

.modern-theme ul.bar_tabs > li.active,
.modern-theme ul.nav-tabs.bar_tabs > li.active {
  background: var(--th-bg-panel) !important;
  border-color: var(--th-border) !important;
  border-right: 1px solid var(--th-border) !important;
  margin-top: 0 !important;
  z-index: 2;
}

.modern-theme ul.bar_tabs > li.active::before,
.modern-theme ul.nav-tabs.bar_tabs > li.active::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--th-accent);
  border-radius: var(--th-radius-sm) var(--th-radius-sm) 0 0;
}

.modern-theme ul.bar_tabs > li > a,
.modern-theme ul.bar_tabs > li a,
.modern-theme ul.nav-tabs.bar_tabs > li > a {
  background: transparent !important;
  color: var(--th-text-secondary) !important;
  padding: 10px 16px !important;
  margin: 0 !important;
  border: none !important;
  border-radius: var(--th-radius-sm) var(--th-radius-sm) 0 0 !important;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1.3;
  white-space: nowrap;
}

.modern-theme ul.bar_tabs > li > a:hover,
.modern-theme ul.bar_tabs > li a:hover,
.modern-theme ul.nav-tabs.bar_tabs > li > a:hover {
  background: var(--th-bg-sidebar-hover) !important;
  color: var(--th-text-primary) !important;
  border: none !important;
}

.modern-theme ul.bar_tabs > li.active > a,
.modern-theme ul.bar_tabs > li.active a,
.modern-theme ul.nav-tabs.bar_tabs > li.active > a,
.modern-theme ul.nav-tabs.bar_tabs > li.active > a:hover,
.modern-theme ul.nav-tabs.bar_tabs > li.active > a:focus {
  background: transparent !important;
  color: var(--th-text-primary) !important;
  font-weight: 600;
  border: none !important;
  border-bottom: none !important;
}

.modern-theme ul.bar_tabs > li a i,
.modern-theme ul.bar_tabs > li a span.glyphicon,
.modern-theme ul.nav-tabs.bar_tabs > li a i {
  color: inherit !important;
  opacity: 0.85;
}

.modern-theme ul.bar_tabs > li.active a i,
.modern-theme ul.nav-tabs.bar_tabs > li.active a i {
  opacity: 1;
}

.modern-theme .nav-tabs {
  border-bottom-color: var(--th-border) !important;
}

.modern-theme .nav-tabs > li > a {
  color: var(--th-text-secondary) !important;
  background: var(--th-bg-input) !important;
  border-color: var(--th-border) !important;
}

.modern-theme .nav-tabs > li > a:hover {
  background: var(--th-bg-sidebar-hover) !important;
  color: var(--th-text-primary) !important;
  border-color: var(--th-border) !important;
}

.modern-theme .nav-tabs > li.active > a,
.modern-theme .nav-tabs > li.active > a:hover,
.modern-theme .nav-tabs > li.active > a:focus {
  color: var(--th-text-primary) !important;
  background: var(--th-bg-panel) !important;
  border-color: var(--th-border) !important;
  border-bottom-color: var(--th-bg-panel) !important;
}

.modern-theme .tab-content {
  background: transparent;
  color: var(--th-text-secondary);
  padding-top: 16px;
}

.modern-theme .tab-pane {
  color: var(--th-text-secondary);
}

.modern-theme .NavigationButton {
  cursor: pointer;
  border-radius: var(--th-radius-sm);
  transition: background 0.15s ease;
}

.modern-theme .NavigationButton:hover {
  background: var(--th-bg-input) !important;
}

.modern-theme .NavigationButton .SpanNavigation,
.modern-theme .NavigationButton .SpanNavigation i {
  color: var(--th-text-secondary) !important;
}

.modern-theme .NavigationButton:hover .SpanNavigation,
.modern-theme .NavigationButton:hover .SpanNavigation i {
  color: var(--th-text-primary) !important;
}

.modern-theme [id*="lbl_Ppartnumber"],
.modern-theme [id*="lbl_producttitle"] {
  color: var(--th-text-primary) !important;
}

.modern-theme .fas.fa-info-circle {
  color: var(--th-text-muted);
  cursor: pointer;
}

.modern-theme .fas.fa-info-circle:hover {
  color: var(--th-accent);
}

/* ── Purchase Payments — summary dashboard ── */

.modern-theme .po-payment-summary {
  background: var(--th-bg-panel);
  border: 1px solid var(--th-border);
  border-radius: var(--th-radius);
  padding: 20px 18px 8px;
  margin-top: 10px;
}

.modern-theme .po-payment-summary__header {
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--th-border);
}

.modern-theme .po-payment-summary__header h4 {
  margin: 0 0 4px;
  font-weight: 600;
  color: var(--th-text-primary);
}

.modern-theme .po-payment-summary__header p {
  margin: 0;
  font-size: 12px;
  color: var(--th-text-muted);
}

.modern-theme .po-summary-group {
  margin-bottom: 20px;
}

.modern-theme .po-summary-group__title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--th-text-muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modern-theme .po-currency-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.modern-theme .po-currency-badge--rmb {
  background: rgba(192, 57, 43, 0.15);
  color: #e57373;
}

.modern-theme .po-currency-badge--nzd {
  background: rgba(30, 132, 73, 0.15);
  color: #6fcf97;
}

.modern-theme .po-currency-badge--usd {
  background: rgba(36, 113, 163, 0.15);
  color: #6eb5e8;
}

.modern-theme .po-currency-badge--audit {
  background: rgba(183, 149, 11, 0.15);
  color: #f2c94c;
}

html.light-mode .modern-theme .po-currency-badge--rmb {
  background: #fdecea;
  color: #c0392b;
}

html.light-mode .modern-theme .po-currency-badge--nzd {
  background: #eafaf1;
  color: #1e8449;
}

html.light-mode .modern-theme .po-currency-badge--usd {
  background: #ebf5fb;
  color: #2471a3;
}

html.light-mode .modern-theme .po-currency-badge--audit {
  background: #fef9e7;
  color: #b7950b;
}

.modern-theme .po-summary-group > .row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 12px;
  margin-left: 0;
  margin-right: 0;
}

.modern-theme .po-summary-group > .row > [class*="col-"] {
  width: 100%;
  max-width: 100%;
  padding: 0;
  float: none;
}

.modern-theme .po-summary-stat {
  background: var(--th-bg-input);
  border: 1px solid var(--th-border);
  border-radius: var(--th-radius-sm);
  padding: 10px 12px 8px;
  margin-bottom: 0;
  min-height: 72px;
  height: 100%;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.modern-theme .po-summary-stat:hover {
  box-shadow: var(--th-shadow);
  border-color: var(--th-border-subtle);
}

.modern-theme .po-summary-stat--primary {
  border-left: 3px solid var(--th-accent);
}

.modern-theme .po-summary-stat--balance {
  border-left: 3px solid #e74c3c;
  background: rgba(231, 76, 60, 0.06);
}

.modern-theme .po-summary-stat--audit-check {
  border-left: 3px solid #f39c12;
  background: rgba(243, 156, 18, 0.06);
}

.modern-theme .po-summary-stat--audit-result {
  border-left: 3px solid #1abb9c;
  background: rgba(26, 187, 156, 0.06);
}

.modern-theme .po-summary-stat--other-expense {
  border-left: 3px solid #8e44ad;
  background: rgba(142, 68, 173, 0.06);
}

.modern-theme .po-summary-stat__label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--th-text-muted);
  line-height: 1.3;
  margin-bottom: 6px;
}

.modern-theme .po-payment-summary .po-summary-stat__value,
.modern-theme .po-payment-summary .po-summary-stat input.po-summary-stat__value {
  display: block;
  width: 100%;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--th-text-primary) !important;
  height: auto;
  cursor: default;
}

.modern-theme .po-payment-summary .po-summary-stat__value:focus {
  outline: none;
}

.modern-theme .po-payment-summary .po-summary-stat__value:disabled,
.modern-theme .po-payment-summary .po-summary-stat__value[readonly] {
  -webkit-text-fill-color: var(--th-text-primary);
  opacity: 1;
  color: var(--th-text-primary) !important;
}

.modern-theme .po-payment-summary .po-balance--overpaid,
.modern-theme .po-payment-summary .po-balance--overpaid:disabled {
  -webkit-text-fill-color: #1abb9c;
  color: #1abb9c !important;
}

.modern-theme .po-payment-summary .po-balance--due,
.modern-theme .po-payment-summary .po-balance--due:disabled {
  -webkit-text-fill-color: #e74c3c;
  color: #e74c3c !important;
}

.modern-theme .po-balance--settled {
  color: var(--th-text-primary) !important;
}

.modern-theme .po-summary-stat--rates .po-summary-stat__value {
  font-size: 15px;
}

.modern-theme .po-summary-hint {
  font-size: 10px;
  color: var(--th-text-muted);
  margin-top: 4px;
  line-height: 1.2;
}

.modern-theme .po-payment-date-wrap {
  position: relative;
}

@media (max-width: 767px) {
  .modern-theme .po-payment-summary .po-summary-stat__value {
    font-size: 16px;
  }

  .modern-theme .po-summary-group > .row {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }
}

/* ── Select2 dropdowns ── */

.modern-theme .select2-container {
  width: 100% !important;
}

.modern-theme .select2-container--default .select2-selection--single,
.modern-theme .select2-container--default .select2-selection--multiple {
  background-color: var(--th-bg-input) !important;
  border: 1px solid var(--th-border) !important;
  border-radius: var(--th-radius-sm) !important;
  min-height: 38px;
}

.modern-theme .select2-container--default .select2-selection--single .select2-selection__rendered,
.modern-theme .select2-container--default .select2-selection--multiple .select2-selection__rendered {
  color: var(--th-text-primary) !important;
}

.modern-theme .select2-container--default .select2-selection--single .select2-selection__rendered {
  padding-top: 5px;
}

.modern-theme .select2-container--default .select2-selection--multiple .select2-selection__rendered {
  padding-top: 3px;
}

.modern-theme .select2-container--default .select2-selection--single .select2-selection__placeholder {
  color: var(--th-text-muted) !important;
}

.modern-theme .select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 36px;
}

.modern-theme .select2-container--default .select2-selection--single .select2-selection__arrow b {
  border-color: var(--th-text-muted) transparent transparent transparent !important;
}

.modern-theme .select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
  border-color: transparent transparent var(--th-text-muted) transparent !important;
}

.modern-theme .select2-container--default.select2-container--focus .select2-selection--single,
.modern-theme .select2-container--default.select2-container--focus .select2-selection--multiple,
.modern-theme .select2-container--default.select2-container--open .select2-selection--single,
.modern-theme .select2-container--default.select2-container--open .select2-selection--multiple {
  border-color: var(--th-accent) !important;
}

.modern-theme .select2-container--default.select2-container--disabled .select2-selection--single,
.modern-theme .select2-container--default.select2-container--disabled .select2-selection--multiple {
  background-color: var(--th-bg-panel) !important;
  opacity: 0.85;
}

.modern-theme .select2-container--default .select2-selection--multiple .select2-selection__choice {
  background-color: var(--th-bg-active) !important;
  border: 1px solid var(--th-border) !important;
  color: var(--th-text-primary) !important;
  border-radius: 4px;
}

.modern-theme .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
  color: var(--th-text-muted) !important;
}

.modern-theme .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
  color: var(--th-text-primary) !important;
}

.modern-theme .select2-container--default .select2-search--inline .select2-search__field {
  color: var(--th-text-primary) !important;
  background: transparent !important;
}

.modern-theme .select2-dropdown {
  background-color: var(--th-bg-sidebar) !important;
  border: 1px solid var(--th-border) !important;
  border-radius: var(--th-radius-sm) !important;
  box-shadow: var(--th-shadow) !important;
  z-index: 1110 !important;
}

.modern-theme .select2-container--default .select2-results__option {
  color: var(--th-text-secondary);
}

.modern-theme .select2-container--default .select2-results__option[aria-selected=true] {
  background-color: var(--th-bg-active) !important;
  color: var(--th-text-primary) !important;
}

.modern-theme .select2-container--default .select2-results__option--highlighted[aria-selected] {
  background-color: var(--th-accent) !important;
  color: #ffffff !important;
}

.modern-theme .select2-container--default .select2-results__option[aria-disabled=true] {
  color: var(--th-text-muted) !important;
}

.modern-theme .select2-search--dropdown {
  padding: 8px;
}

.modern-theme .select2-search--dropdown .select2-search__field {
  background: var(--th-bg-input) !important;
  border: 1px solid var(--th-border) !important;
  color: var(--th-text-primary) !important;
  border-radius: var(--th-radius-sm);
}

.modern-theme .select2-results__group {
  color: var(--th-text-muted) !important;
}

/* ── Tags input (bootstrap-tagsinput) ── */

.modern-theme .bootstrap-tagsinput {
  background-color: var(--th-bg-input) !important;
  border: 1px solid var(--th-border) !important;
  color: var(--th-text-primary) !important;
  border-radius: var(--th-radius-sm) !important;
  box-shadow: none !important;
  width: 100% !important;
  display: block !important;
  min-height: 38px;
  padding: 6px 8px !important;
}

.modern-theme .bootstrap-tagsinput:focus-within {
  border-color: var(--th-accent) !important;
}

.modern-theme .bootstrap-tagsinput input {
  color: var(--th-text-primary) !important;
  background: transparent !important;
}

.modern-theme .bootstrap-tagsinput input::placeholder {
  color: var(--th-text-muted);
}

.modern-theme .bootstrap-tagsinput .tag,
.modern-theme .bootstrap-tagsinput .tag.label,
.modern-theme .bootstrap-tagsinput .tag.label-info {
  background: var(--th-accent) !important;
  color: #ffffff !important;
  border-radius: 4px;
  padding: 4px 8px;
  margin: 2px 4px 2px 0;
}

.modern-theme .bootstrap-tagsinput .tag [data-role="remove"],
.modern-theme .bootstrap-tagsinput .tag a {
  color: rgba(255, 255, 255, 0.9) !important;
}

.modern-theme .tagsinput {
  background: var(--th-bg-input) !important;
  border-color: var(--th-border) !important;
  color: var(--th-text-primary) !important;
}

.modern-theme .tagsinput input {
  color: var(--th-text-primary) !important;
}

.modern-theme span.tag {
  background: var(--th-accent) !important;
  color: #ffffff !important;
}

/* ── Native select elements ── */

.modern-theme select.form-control {
  background-color: var(--th-bg-input) !important;
  color: var(--th-text-primary) !important;
  border-color: var(--th-border) !important;
  height: 38px;
}

.modern-theme select.form-control:focus {
  border-color: var(--th-accent) !important;
  outline: none;
}

html.light-mode .modern-theme select.form-control option {
  background: #ffffff;
  color: #18181b;
}

html:not(.light-mode) .modern-theme select.form-control option {
  background: var(--th-bg-panel);
  color: var(--th-text-primary);
}

/* ── Bootstrap modals ── */

.modern-theme .modal-backdrop {
  z-index: 1090 !important;
}

.modern-theme .modal {
  z-index: 1100 !important;
}

.modern-theme .modal.in {
  display: block !important;
}

.modern-theme .modal-dialog {
  position: relative;
  z-index: 1;
  pointer-events: auto;
}

.modern-theme .modal-content {
  background-color: var(--th-bg-panel);
  border: 1px solid var(--th-border);
  color: var(--th-text-primary);
  box-shadow: var(--th-shadow);
}

.modern-theme .modal-header {
  border-bottom-color: var(--th-border);
}

.modern-theme .modal-footer {
  border-top-color: var(--th-border);
}

.modern-theme .modal-title {
  color: var(--th-text-primary);
}

/* ── Buttons (Bootstrap 3 defaults) ── */

.modern-theme .btn-default {
  background-color: var(--th-bg-input) !important;
  border-color: var(--th-border) !important;
  color: var(--th-text-primary) !important;
  text-shadow: none;
  box-shadow: none;
}

.modern-theme .btn-default:hover,
.modern-theme .btn-default:focus,
.modern-theme .btn-default:active,
.modern-theme .btn-default.active {
  background-color: var(--th-bg-active) !important;
  border-color: var(--th-accent) !important;
  color: var(--th-text-primary) !important;
}

.modern-theme .input-group-btn .btn-default {
  height: 38px;
}

.modern-theme .btn-secondary {
  background-color: var(--th-bg-input) !important;
  border: 1px solid var(--th-border) !important;
  color: var(--th-text-primary) !important;
}

.modern-theme .btn-secondary:hover,
.modern-theme .btn-secondary:focus {
  background-color: var(--th-bg-active) !important;
  border-color: var(--th-border) !important;
  color: var(--th-text-primary) !important;
}

.modern-theme .btn-primary {
  background-color: var(--th-accent) !important;
  border-color: var(--th-accent) !important;
  color: #ffffff !important;
}

.modern-theme .btn-primary:hover,
.modern-theme .btn-primary:focus {
  background-color: #2a4de6 !important;
  border-color: #2a4de6 !important;
  color: #ffffff !important;
}

.modern-theme .btn-success {
  background-color: #1a9e6a !important;
  border-color: #1a9e6a !important;
  color: #ffffff !important;
}

.modern-theme .btn-success:hover,
.modern-theme .btn-success:focus {
  background-color: #158a5c !important;
  border-color: #158a5c !important;
  color: #ffffff !important;
}

.modern-theme .btn-danger {
  background-color: #dc3545 !important;
  border-color: #dc3545 !important;
  color: #ffffff !important;
}

.modern-theme .btn-danger:hover,
.modern-theme .btn-danger:focus {
  background-color: #c82333 !important;
  border-color: #bd2130 !important;
  color: #ffffff !important;
}

/* ── Form labels & checkboxes ── */

.modern-theme label,
.modern-theme .control-label {
  color: var(--th-text-secondary);
}

.modern-theme .alert label {
  color: inherit;
}

.modern-theme .btn label {
  color: inherit;
}

.modern-theme input[type="checkbox"] {
  accent-color: var(--th-accent);
}

.modern-theme span > input[type="checkbox"] + label {
  color: var(--th-text-secondary);
  font-weight: normal;
  margin-left: 4px;
}

/* ── Product Analysis page ── */

.modern-theme .pa-analysis-block {
  border: solid 4px;
  padding: 15px;
  margin-bottom: 10px;
  border-radius: 10px;
  color: var(--th-text-primary);
  background-color: var(--th-bg-main);
}

.modern-theme .pa-analysis-block span {
  color: var(--th-text-primary);
}

.modern-theme .pa-field-counter {
  color: var(--th-text-muted) !important;
}

.modern-theme .pa-block-action-btn {
  width: 100%;
  border: 1px solid var(--th-border) !important;
  color: var(--th-text-primary) !important;
  background-color: var(--th-bg-input) !important;
  text-shadow: none;
  box-shadow: none;
}

.modern-theme .pa-block-action-btn:hover,
.modern-theme .pa-block-action-btn:focus {
  background-color: var(--th-bg-active) !important;
  border-color: var(--th-accent) !important;
  color: var(--th-text-primary) !important;
}

.modern-theme #ShippingTemplate {
  border-collapse: collapse;
  width: 100%;
  color: var(--th-text-primary);
}

.modern-theme #ShippingTemplate td,
.modern-theme #ShippingTemplate th {
  border: 1px solid var(--th-border);
  padding: 8px;
}

.modern-theme #ShippingTemplate tr:nth-child(even) {
  background-color: var(--th-bg-input);
}

.modern-theme #ShippingTemplate tr:hover {
  background-color: var(--th-bg-active);
}

.modern-theme #ShippingTemplate th {
  padding-top: 12px;
  padding-bottom: 12px;
  text-align: left;
  background-color: var(--th-accent);
  color: #ffffff;
}

/* ── Dashboard (Default.aspx) ── */

.modern-theme .th-dashboard {
  padding-bottom: 20px;
}

/* Page header */

.modern-theme .th-dash-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
  padding-bottom: 0;
  border-bottom: none;
}

.modern-theme .th-dash-page-header__text h2 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--th-text-primary);
}

.modern-theme .th-dash-page-header__text p {
  display: block;
  margin: 0;
  font-size: 12px;
  color: var(--th-text-muted);
}

.modern-theme .th-dash-page-header__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: #4ade80;
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.22);
  white-space: nowrap;
}

.modern-theme .th-dash-page-header__badge i {
  font-size: 7px;
  animation: th-dash-pulse 2s ease-in-out infinite;
}

@keyframes th-dash-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* Layout */

.modern-theme .th-dash-split {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.4fr);
  gap: 14px;
  margin-bottom: 14px;
}

/* Panels */

.modern-theme .th-dash-panel {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035) 0%, transparent 42%),
    var(--th-bg-panel);
  border: 1px solid var(--th-border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 14px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 8px 28px rgba(0, 0, 0, 0.22);
}

.modern-theme .th-dash-split .th-dash-panel {
  margin-bottom: 0;
}

.modern-theme .th-dash-panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--th-border);
}

.modern-theme .th-dash-panel__head--sub {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--th-border);
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 10px;
}

.modern-theme .th-dash-panel__title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.modern-theme .th-dash-panel__title h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--th-text-primary);
}

.modern-theme .th-dash-panel__icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  border: 1px solid transparent;
}

.modern-theme .th-dash-panel__icon--sm {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 12px;
}

.modern-theme .th-dash-panel__icon--blue {
  color: #6b9bff;
  background: rgba(51, 92, 255, 0.14);
  border-color: rgba(51, 92, 255, 0.22);
}

.modern-theme .th-dash-panel__icon--amber {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.22);
}

.modern-theme .th-dash-panel__icon--teal {
  color: #2dd4bf;
  background: rgba(45, 212, 191, 0.12);
  border-color: rgba(45, 212, 191, 0.22);
}

.modern-theme .th-dash-panel__icon--rose {
  color: #fb7185;
  background: rgba(251, 113, 133, 0.12);
  border-color: rgba(251, 113, 133, 0.22);
}

.modern-theme .th-dash-panel__icon--green {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.12);
  border-color: rgba(74, 222, 128, 0.22);
}

.modern-theme .th-dash-panel__tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--th-text-muted);
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--th-bg-input);
  border: 1px solid var(--th-border);
}

/* Stat grids */

.modern-theme .th-dash-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.modern-theme .th-dash-stat-grid--dense {
  grid-template-columns: repeat(auto-fill, minmax(122px, 1fr));
  gap: 10px;
}

.modern-theme .th-dash-stat-grid--pair {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.modern-theme .th-dash-stat-grid--alerts {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.modern-theme .th-dash-stat-grid--alerts:has(.th-dash-stat-card:nth-child(2):last-child) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.modern-theme .th-dash-stat-grid--alerts .th-dash-stat-card:nth-child(3n+1) { --card-accent: #f43f5e; }
.modern-theme .th-dash-stat-grid--alerts .th-dash-stat-card:nth-child(3n+2) { --card-accent: #f97316; }
.modern-theme .th-dash-stat-grid--alerts .th-dash-stat-card:nth-child(3n+3) { --card-accent: #ef4444; }

/* Stat cards */

.modern-theme .th-dash-stat-card {
  --card-accent: var(--th-accent);
  position: relative;
  display: block;
  overflow: hidden;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.04) 0%, transparent 55%),
    var(--th-bg-main);
  border: 1px solid var(--th-border);
  border-radius: 10px;
  padding: 11px 12px 10px;
  min-height: 0;
  text-decoration: none !important;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease;
}

.modern-theme .th-dash-stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--card-accent), transparent);
  opacity: 0.9;
}

.modern-theme .th-dash-stat-card::after {
  content: "";
  position: absolute;
  top: -20px;
  right: -20px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--card-accent);
  opacity: 0.06;
  pointer-events: none;
}

.modern-theme a.th-dash-stat-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--card-accent) 45%, var(--th-border));
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.28),
    0 0 0 1px color-mix(in srgb, var(--card-accent) 25%, transparent);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.06) 0%, transparent 55%),
    var(--th-bg-input);
}

.modern-theme .th-dash-stat-card--static {
  cursor: default;
}

.modern-theme .th-dash-stat-card--static:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--th-border);
}

.modern-theme a.th-dash-stat-card:hover .th-dash-stat-card__label {
  color: var(--th-text-secondary);
}

/* Order card accent rotation */
.modern-theme .th-dash-panel--orders .th-dash-stat-card:nth-child(8n+1) { --card-accent: #335cff; }
.modern-theme .th-dash-panel--orders .th-dash-stat-card:nth-child(8n+2) { --card-accent: #8b5cf6; }
.modern-theme .th-dash-panel--orders .th-dash-stat-card:nth-child(8n+3) { --card-accent: #14b8a6; }
.modern-theme .th-dash-panel--orders .th-dash-stat-card:nth-child(8n+4) { --card-accent: #f59e0b; }
.modern-theme .th-dash-panel--orders .th-dash-stat-card:nth-child(8n+5) { --card-accent: #ec4899; }
.modern-theme .th-dash-panel--orders .th-dash-stat-card:nth-child(8n+6) { --card-accent: #22c55e; }
.modern-theme .th-dash-panel--orders .th-dash-stat-card:nth-child(8n+7) { --card-accent: #6366f1; }
.modern-theme .th-dash-panel--orders .th-dash-stat-card:nth-child(8n+8) { --card-accent: #0ea5e9; }

.modern-theme .th-dash-panel--products .th-dash-stat-card:nth-child(8n+1) { --card-accent: #22c55e; }
.modern-theme .th-dash-panel--products .th-dash-stat-card:nth-child(8n+2) { --card-accent: #4ade80; }
.modern-theme .th-dash-panel--products .th-dash-stat-card:nth-child(8n+3) { --card-accent: #335cff; }
.modern-theme .th-dash-panel--products .th-dash-stat-card:nth-child(8n+4) { --card-accent: #14b8a6; }
.modern-theme .th-dash-panel--products .th-dash-stat-card:nth-child(8n+5) { --card-accent: #f59e0b; }
.modern-theme .th-dash-panel--products .th-dash-stat-card:nth-child(8n+6) { --card-accent: #8b5cf6; }
.modern-theme .th-dash-panel--products .th-dash-stat-card:nth-child(8n+7) { --card-accent: #f97316; }
.modern-theme .th-dash-panel--products .th-dash-stat-card:nth-child(8n+8) { --card-accent: #ef4444; }

.modern-theme .th-dash-stat-card--alert { --card-accent: #f43f5e; }
.modern-theme .th-dash-stat-card--revenue { --card-accent: #22c55e; }

/* Sales Revenue — up to 6 wide cards per row */
.modern-theme .th-dash-stat-grid--revenue {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

/* 4 stats today: stretch evenly across the full row */
.modern-theme .th-dash-stat-grid--revenue:has(.th-dash-stat-card:nth-child(4):last-child) {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.modern-theme .th-dash-stat-grid--revenue .th-dash-stat-card {
  min-height: 92px;
  padding: 14px 16px 13px;
}

.modern-theme .th-dash-stat-grid--revenue .th-dash-stat-card__label {
  font-size: 11px;
  margin-bottom: 8px;
}

.modern-theme .th-dash-stat-grid--revenue .th-dash-stat-card__value {
  font-size: 26px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modern-theme .th-dash-stat-grid--revenue .th-dash-stat-card:nth-child(6n+1) { --card-accent: #22c55e; }
.modern-theme .th-dash-stat-grid--revenue .th-dash-stat-card:nth-child(6n+2) { --card-accent: #4ade80; }
.modern-theme .th-dash-stat-grid--revenue .th-dash-stat-card:nth-child(6n+3) { --card-accent: #14b8a6; }
.modern-theme .th-dash-stat-grid--revenue .th-dash-stat-card:nth-child(6n+4) { --card-accent: #335cff; }
.modern-theme .th-dash-stat-grid--revenue .th-dash-stat-card:nth-child(6n+5) { --card-accent: #8b5cf6; }
.modern-theme .th-dash-stat-grid--revenue .th-dash-stat-card:nth-child(6n+6) { --card-accent: #f59e0b; }

.modern-theme .th-dash-stat-card__label {
  display: block;
  position: relative;
  z-index: 1;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--th-text-muted);
  margin-bottom: 6px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.15s ease;
}

.modern-theme .th-dash-stat-card__value {
  display: block;
  position: relative;
  z-index: 1;
  font-size: 21px;
  font-weight: 700;
  color: var(--th-text-primary);
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.modern-theme .th-dash-stat-card__value--split {
  font-size: 19px;
}

.modern-theme .th-dash-stat-card__value--split a {
  color: var(--th-text-primary);
  text-decoration: none;
}

.modern-theme .th-dash-stat-card__value--split a:hover {
  color: var(--card-accent);
}

.modern-theme .th-dash-stat-card__meta {
  font-size: 16px;
  font-weight: 600;
  color: var(--th-text-secondary);
}

.modern-theme .th-dash-stat-card__meta a {
  color: var(--th-text-primary);
  text-decoration: none;
}

.modern-theme .th-dash-stat-card__meta a:hover {
  color: var(--card-accent);
}

/* Non-selling list panel */

.modern-theme .th-dash-list {
  border: 1px solid var(--th-border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--th-bg-main);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset;
}

.modern-theme .th-dash-list__header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 8px 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--th-text-muted);
  background: linear-gradient(180deg, var(--th-bg-input), var(--th-bg-main));
  border-bottom: 1px solid var(--th-border);
}

.modern-theme .th-dash-list__header--3 {
  grid-template-columns: 1fr 68px 68px;
}

.modern-theme .th-dash-list__header--3 span:not(:first-child) {
  text-align: right;
}

.modern-theme .th-dash-list__row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--th-border);
  text-decoration: none !important;
  transition: background-color 0.15s ease, padding-left 0.15s ease;
}

.modern-theme .th-dash-list__row:last-child {
  border-bottom: none;
}

.modern-theme a.th-dash-list__row {
  cursor: pointer;
}

.modern-theme a.th-dash-list__row:hover {
  background: rgba(51, 92, 255, 0.06);
}

.modern-theme .th-dash-list__row--3 {
  grid-template-columns: 1fr 68px 68px;
}

.modern-theme .th-dash-list__period {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--th-text-primary);
  min-width: 0;
  padding: 5px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.modern-theme .th-dash-list__accent {
  width: 3px;
  height: 18px;
  border-radius: 99px;
  background: var(--th-accent);
  flex-shrink: 0;
  box-shadow: 0 0 8px color-mix(in srgb, var(--th-accent) 50%, transparent);
}

.modern-theme .th-dash-list__accent--amber { background: #f59e0b; box-shadow: 0 0 8px rgba(245, 158, 11, 0.35); }
.modern-theme .th-dash-list__accent--purple { background: #8b5cf6; box-shadow: 0 0 8px rgba(139, 92, 246, 0.35); }
.modern-theme .th-dash-list__accent--teal { background: #14b8a6; box-shadow: 0 0 8px rgba(20, 184, 166, 0.35); }
.modern-theme .th-dash-list__accent--orange { background: #f97316; box-shadow: 0 0 8px rgba(249, 115, 22, 0.35); }
.modern-theme .th-dash-list__accent--rose { background: #f43f5e; box-shadow: 0 0 8px rgba(244, 63, 94, 0.35); }

.modern-theme .th-dash-list__value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--th-text-primary);
  text-align: center;
  text-decoration: none !important;
  font-variant-numeric: tabular-nums;
  background: var(--th-accent-soft);
  border: 1px solid rgba(51, 92, 255, 0.18);
  border-radius: 999px;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.modern-theme a.th-dash-list__value:hover {
  color: #fff;
  background: var(--th-accent);
  border-color: var(--th-accent);
}

.modern-theme .th-dash-hidden {
  display: none !important;
}

html.light-mode .modern-theme .th-dash-panel {
  background: #ffffff;
  box-shadow: var(--th-shadow);
}

html.light-mode .modern-theme .th-dash-stat-card {
  background: color-mix(in srgb, var(--card-accent) 10%, #ffffff);
  border-color: color-mix(in srgb, var(--card-accent) 14%, var(--th-border));
}

html.light-mode .modern-theme a.th-dash-stat-card:hover {
  background: color-mix(in srgb, var(--card-accent) 16%, #ffffff);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
}

html.light-mode .modern-theme .th-dash-list__period {
  background: #e8edf2;
  border-color: #d8e0e8;
}

@media (max-width: 991px) {
  .modern-theme .th-dash-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1200px) {
  .modern-theme .th-dash-stat-grid--revenue {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .modern-theme .th-dash-stat-grid--revenue:has(.th-dash-stat-card:nth-child(4):last-child) {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 768px) {
  .modern-theme .th-dash-page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .modern-theme .th-dash-stat-grid--dense {
    grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  }

  .modern-theme .th-dash-stat-card__value {
    font-size: 18px;
  }

  .modern-theme .th-dash-stat-grid--pair {
    grid-template-columns: 1fr;
  }

  .modern-theme .th-dash-stat-grid--alerts {
    grid-template-columns: 1fr !important;
  }

  .modern-theme .th-dash-stat-grid--revenue {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .modern-theme .th-dash-stat-grid--revenue .th-dash-stat-card__value {
    font-size: 20px;
  }
}

/* ── Login page ── */

.th-login-page {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(51, 92, 255, 0.18), transparent 34%),
    radial-gradient(circle at bottom right, rgba(51, 92, 255, 0.1), transparent 28%),
    var(--th-bg-main);
  color: var(--th-text-secondary);
}

html.light-mode .th-login-page {
  background:
    radial-gradient(circle at top left, rgba(51, 92, 255, 0.08), transparent 34%),
    radial-gradient(circle at bottom right, rgba(51, 92, 255, 0.05), transparent 28%),
    var(--th-bg-main);
}

.th-login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.th-login-card {
  width: 100%;
  max-width: 420px;
  background: var(--th-bg-panel);
  border: 1px solid var(--th-border);
  border-radius: 16px;
  box-shadow: var(--th-shadow);
  padding: 32px 28px 24px;
}

.th-login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--th-border);
}

.th-login-brand .th-brand-icon {
  width: 42px;
  height: 42px;
}

.th-login-brand .th-brand-icon img {
  width: 24px;
  height: 24px;
}

.th-login-title {
  margin: 0 0 8px;
  color: var(--th-text-primary);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
}

.th-login-lead {
  margin: 0 0 24px;
  color: var(--th-text-muted);
  font-size: 14px;
  line-height: 1.5;
}

.th-login-field {
  margin-bottom: 16px;
}

.th-login-field label {
  display: block;
  margin-bottom: 8px;
  color: var(--th-text-secondary);
  font-size: 13px;
  font-weight: 500;
}

.th-login-input-wrap {
  position: relative;
}

.th-login-input-wrap .fa {
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  color: var(--th-text-muted);
  font-size: 14px;
  pointer-events: none;
}

.th-login-input-wrap .form-control {
  height: 44px;
  padding-left: 40px;
}

.th-login-error-wrap {
  min-height: 0;
  margin-bottom: 16px;
}

.th-login-error-wrap:empty {
  display: none;
}

.th-login-error-wrap span,
.th-login-error-wrap .failureNotification {
  display: block;
  padding: 10px 12px;
  border-radius: var(--th-radius-sm);
  background: rgba(220, 53, 69, 0.12);
  border: 1px solid rgba(220, 53, 69, 0.28);
  color: #ff8f98;
  font-size: 13px;
  line-height: 1.45;
}

html.light-mode .th-login-error-wrap span,
html.light-mode .th-login-error-wrap .failureNotification {
  color: #b42318;
  background: rgba(220, 53, 69, 0.08);
}

.th-login-btn {
  width: 100%;
  height: 44px;
  margin-top: 4px;
  border-radius: var(--th-radius-sm) !important;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.th-login-footer {
  margin: 24px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--th-border);
  text-align: center;
  color: var(--th-text-muted);
  font-size: 12px;
}

@media (max-width: 480px) {
  .th-login-card {
    padding: 24px 18px 18px;
    border-radius: 14px;
  }

  .th-login-title {
    font-size: 22px;
  }
}
