body.theme-modern #content :is(
  .panel,
  .panel-soft,
  .panel-wrap,
  .hero,
  .filters-card,
  .filters-panel,
  .filter-card,
  .filter-panel,
  .toolbar,
  .table-wrapper,
  .table-wrap,
  .stats-grid,
  .stat-card,
  .kpi,
  .kpi-card,
  .card-metric,
  .metric-card,
  [class*="-panel"],
  [class*="-hero"],
  [class*="-wrap"],
  [class*="-section"],
  [class*="-toolbar"],
  [class*="-card"],
  [class*="-kpi"],
  [class*="-metric"],
  [class*="-summary"],
  [class*="-page"],
  [class*="-dashboard"],
  [class*="-report"],
  [class*="tms-"]
) {
  background: var(--theme-surface) !important;
  background-image: none !important;
  border-color: var(--theme-border) !important;
  color: var(--theme-text) !important;
}

body.theme-modern #content :is(
  .panel,
  .panel-soft,
  .panel-wrap,
  .hero,
  .filters-card,
  .filters-panel,
  .filter-card,
  .filter-panel,
  .toolbar,
  .table-wrapper,
  .table-wrap,
  .stat-card,
  .kpi,
  .kpi-card,
  .card-metric,
  .metric-card,
  [class*="-panel"],
  [class*="-hero"],
  [class*="-wrap"],
  [class*="-section"],
  [class*="-toolbar"],
  [class*="-card"],
  [class*="-kpi"],
  [class*="-metric"],
  [class*="-summary"],
  [class*="-page"],
  [class*="-dashboard"],
  [class*="-report"],
  [class*="tms-"]
) {
  box-shadow: var(--theme-shadow, 0 6px 20px rgba(25, 40, 34, 0.08)) !important;
}

body.theme-modern #content :is(h1, h2, h3, h4, h5, .card-title, .panel-title, .section-title, .page-title) {
  color: var(--theme-text) !important;
}

body.theme-modern #content :is(.text-muted, .text-secondary, .card-subtitle, .help-text, .form-text) {
  color: var(--theme-muted) !important;
}

body.theme-modern #content :is(.badge, .status-pill, .badge-status, [class*="status-"]) {
  border-color: var(--theme-border);
}

body.theme-modern #content :is(.form-control, .form-select, .input-group-text) {
  border-color: var(--theme-border);
}

body.theme-modern #content :is(.table, table) {
  color: var(--theme-text);
  --bs-table-color: var(--theme-text);
  --bs-table-bg: var(--theme-surface);
  --bs-table-border-color: var(--theme-border);
  --bs-table-striped-color: var(--theme-text);
  --bs-table-striped-bg: color-mix(in srgb, var(--theme-accent) 4%, var(--theme-surface));
  --bs-table-hover-color: var(--theme-text);
  --bs-table-hover-bg: color-mix(in srgb, var(--theme-accent) 10%, var(--theme-surface));
}

body.theme-modern #content :is(.table thead th, table thead th) {
  border-color: var(--theme-border) !important;
  background: color-mix(in srgb, var(--theme-accent) 6%, var(--theme-surface)) !important;
  color: var(--theme-muted) !important;
}

body.theme-modern #content :is(.table tbody td, table tbody td) {
  border-color: var(--theme-border) !important;
}

body.theme-modern #content :is(.filters-card, .filters-panel, .filter-card, .filter-panel, [class*="-filters"], [class*="-filter"]) {
  border-radius: 6px;
}

body.theme-modern #content :is(.text-success, .text-danger, .text-warning, .text-info, .bg-success, .bg-danger, .bg-warning, .bg-info, .btn-success, .btn-danger, .btn-warning, .btn-info, .badge) {
  background-image: none;
}

body.theme-modern #content :is(.text-success, .bg-success, .btn-success, .border-success) {
  --bs-success: var(--theme-positive);
}

body.theme-modern #content :is(.modal-content, .dropdown-menu, .popover, .tooltip, .list-group-item) {
  border-color: var(--theme-border);
  background-color: var(--theme-surface);
  color: var(--theme-text);
}

body.theme-modern #content :is(.nav-tabs .nav-link, .nav-pills .nav-link, .page-link) {
  transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease;
}

body.theme-modern #content :is(.btn, button, .form-control, .form-select):focus-visible {
  outline-color: var(--theme-accent);
}

body.theme-modern #content :is([class*="-hero"], [class*="-dashboard"], [class*="-page"], [class*="tms-"]) :is(h1, h2, h3, h4, h5, p, .text-muted) {
  color: inherit;
}

body.theme-modern #content :is(.panel, .panel-soft, .panel-wrap, .hero, .filters-card, .filters-panel, .filter-card, .filter-panel, [class*="-panel"], [class*="-hero"], [class*="-wrap"], [class*="-card"], [class*="tms-"]) {
  border-radius: 7px;
}

body.header-compact .navbar.menuSuperior {
  height: 46px !important;
  min-height: 46px !important;
}

body.header-compact #content {
  padding-top: 46px !important;
}

body.cards-soft #content .card {
  border-radius: 7px !important;
}

body.sidebar-compact:not(.sidebar-open-mobile) #sidebar {
  width: 78px !important;
  min-width: 78px !important;
  max-width: 78px !important;
}

body.sidebar-compact:not(.sidebar-open-mobile) #sidebar ~ #content {
  width: calc(100% - 78px) !important;
  max-width: calc(100% - 78px) !important;
  margin-left: 78px !important;
}

body.sidebar-compact:not(.sidebar-open-mobile) #sidebar ~ #content .navbar {
  left: 78px !important;
  width: calc(100% - 78px) !important;
}

body.theme-modern.theme-dark #content :is(.form-control, .form-select, .input-group-text) {
  background-color: var(--theme-surface) !important;
  color: var(--theme-text) !important;
}

body.theme-modern.theme-dark #content :is(.form-control, .form-select)::placeholder {
  color: var(--theme-muted) !important;
}

body.theme-modern[data-theme-palette="jade"] #content :is(.btn-primary, .nav-pills .nav-link.active, .page-item.active .page-link) {
  --bs-btn-bg: var(--theme-accent);
  --bs-btn-border-color: var(--theme-accent);
  --bs-btn-hover-bg: var(--theme-accent-hover);
  --bs-btn-hover-border-color: var(--theme-accent-hover);
}

@media (max-width: 760px) {
  body.theme-modern #content :is(.table-responsive, .table-wrapper, .table-wrap) {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 800px) {
  body.sidebar-compact #sidebar {
    width: min(82vw, 250px) !important;
    min-width: min(82vw, 250px) !important;
    max-width: min(82vw, 250px) !important;
  }

  body.sidebar-compact #sidebar ~ #content {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
  }

  body.sidebar-compact #sidebar ~ #content .navbar {
    left: 0 !important;
    width: 100% !important;
  }
}