/**
 * WooCommerce legacy reports (admin.php?page=wc-reports) — YOOAdmin Studio layout.
 */

body.ysh-wc-reports-active #wpbody-content {
  padding-top: 0 !important;
}

body.ysh-wc-reports-active #wpbody-content > .wrap.woocommerce {
  width: 100% !important;
  max-width: min(var(--ysh-layout-max, 1400px), 100%) !important;
  margin: 0 auto 40px !important;
  padding: 16px 0 0 !important;
  box-sizing: border-box !important;
  font-family: var(--ysh-font, inherit) !important;
  color: var(--ysh-text, #334155) !important;
}

/* Deprecation / admin notice at top */
body.ysh-wc-reports-active .wrap.woocommerce > #message,
body.ysh-wc-reports-active .wrap.woocommerce > .notice,
body.ysh-wc-reports-active .wrap.woocommerce > .updated,
body.ysh-wc-reports-active .wrap.woocommerce > .error {
  margin: 0 0 16px !important;
  padding: 14px 16px !important;
  border-radius: 10px !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  background: var(--ysh-card, #fff) !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
  max-width: 100% !important;
}

body.ysh-wc-reports-active .wrap.woocommerce > #message p,
body.ysh-wc-reports-active .wrap.woocommerce > #message strong {
  margin: 0 !important;
  font-size: 13px !important;
  line-height: 1.55 !important;
  font-weight: 500 !important;
  color: var(--ysh-text, #334155) !important;
}

body.ysh-wc-reports-active .wrap.woocommerce > #message a {
  color: var(--ysh-brand, #eda934) !important;
  font-weight: 600 !important;
}

html[data-yooadmin-studio-color-mode-effective="dark"] body.ysh-wc-reports-active .wrap.woocommerce > #message,
html.yooadmin-studio-hub-html[data-yooadmin-studio-color-mode-effective="dark"] body.ysh-wc-reports-active .wrap.woocommerce > #message {
  background: rgba(var(--ysh-brand-rgb, 237, 169, 52), 0.1) !important;
  border-color: rgba(var(--ysh-brand-rgb, 237, 169, 52), 0.35) !important;
}

html[data-yooadmin-studio-color-mode-effective="dark"] body.ysh-wc-reports-active .wrap.woocommerce > #message p,
html[data-yooadmin-studio-color-mode-effective="dark"] body.ysh-wc-reports-active .wrap.woocommerce > #message strong,
html.yooadmin-studio-hub-html[data-yooadmin-studio-color-mode-effective="dark"] body.ysh-wc-reports-active .wrap.woocommerce > #message p,
html.yooadmin-studio-hub-html[data-yooadmin-studio-color-mode-effective="dark"] body.ysh-wc-reports-active .wrap.woocommerce > #message strong {
  color: var(--ysh-text, #cfd6e0) !important;
}

/* Primary tabs */
body.ysh-wc-reports-active .wrap.woocommerce > nav.nav-tab-wrapper.woo-nav-tab-wrapper {
  --ysh-wc-tab-border: rgba(15, 23, 42, 0.09);
  --ysh-wc-tab-muted: #f8fafc;
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 4px !important;
  background: var(--ysh-wc-tab-muted) !important;
  border: none !important;
  border-bottom: 1px solid var(--ysh-wc-tab-border) !important;
  border-radius: 12px 12px 0 0 !important;
  padding: 8px 10px 0 !important;
  margin: 0 0 0 !important;
  overflow: hidden !important;
}

body.ysh-wc-reports-active .wrap.woocommerce > nav.nav-tab-wrapper a.nav-tab {
  border: 0 !important;
  border-radius: 8px 8px 0 0 !important;
  padding: 11px 16px !important;
  margin: 0 !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1.3 !important;
  color: var(--ysh-heading, #1e293b) !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.ysh-wc-reports-active .wrap.woocommerce > nav.nav-tab-wrapper a.nav-tab-active {
  background: var(--ysh-card, #fff) !important;
  color: var(--ysh-heading, #1e293b) !important;
  position: relative !important;
}

body.ysh-wc-reports-active .wrap.woocommerce > nav.nav-tab-wrapper a.nav-tab-active::after {
  content: "" !important;
  position: absolute !important;
  left: 0 !important;
  right: 0 !important;
  bottom: -1px !important;
  height: 3px !important;
  background: var(--ysh-brand, #eda934) !important;
  border-radius: 2px !important;
}

/* Sub-report links */
body.ysh-wc-reports-active .wrap.woocommerce > ul.subsubsub {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 4px 0 !important;
  margin: 12px 0 16px !important;
  padding: 0 !important;
  font-size: 13px !important;
  line-height: 1.5 !important;
  color: var(--ysh-text-muted, #64748b) !important;
}

body.ysh-wc-reports-active .wrap.woocommerce > ul.subsubsub li {
  margin: 0 !important;
  padding: 0 !important;
}

body.ysh-wc-reports-active .wrap.woocommerce > ul.subsubsub a {
  padding: 4px 8px !important;
  border-radius: 6px !important;
  text-decoration: none !important;
  color: var(--ysh-text-muted, #64748b) !important;
}

body.ysh-wc-reports-active .wrap.woocommerce > ul.subsubsub a.current {
  color: var(--ysh-brand, #eda934) !important;
  font-weight: 600 !important;
  background: rgba(var(--ysh-brand-rgb, 237, 169, 52), 0.12) !important;
}

body.ysh-wc-reports-active .wrap.woocommerce > br.clear {
  display: none !important;
}

/* Report card shell */
body.ysh-wc-reports-active .woocommerce-reports-wide,
body.ysh-wc-reports-active .woocommerce-reports-wrap {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  float: none !important;
  clear: both !important;
}

body.ysh-wc-reports-active .woocommerce-reports-wide .postbox,
body.ysh-wc-reports-active .woocommerce-reports-wrap .postbox {
  border-radius: 0 0 12px 12px !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  border-top: none !important;
  margin: 0 !important;
  overflow: hidden !important;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.06) !important;
}

/* Date range toolbar */
body.ysh-wc-reports-active .postbox :is(div.stats_range, h3.stats_range) ul {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: stretch !important;
  gap: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
  background: var(--ysh-surface, #f6f7f8) !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
}

body.ysh-wc-reports-active .postbox :is(div.stats_range, h3.stats_range) ul li {
  float: none !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
}

body.ysh-wc-reports-active .postbox :is(div.stats_range, h3.stats_range) ul li a {
  padding: 12px 14px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  border-right: 1px solid rgba(0, 0, 0, 0.06) !important;
  color: var(--ysh-text-muted, #64748b) !important;
  text-decoration: none !important;
}

body.ysh-wc-reports-active .postbox :is(div.stats_range, h3.stats_range) ul li.active {
  background: var(--ysh-card, #fff) !important;
  box-shadow: none !important;
}

body.ysh-wc-reports-active .postbox :is(div.stats_range, h3.stats_range) ul li.active a {
  color: var(--ysh-heading, #1e293b) !important;
}

body.ysh-wc-reports-active .postbox :is(div.stats_range, h3.stats_range) .export_csv {
  float: none !important;
  margin-left: auto !important;
  padding: 12px 16px !important;
  border-left: 1px solid rgba(0, 0, 0, 0.06) !important;
  font-size: 13px !important;
}

/* Chart area — flex instead of WC negative-margin floats */
body.ysh-wc-reports-active .postbox .inside.chart-with-sidebar {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start !important;
  gap: 16px !important;
  padding: 16px !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  width: 100% !important;
}

body.ysh-wc-reports-active .postbox .chart-with-sidebar .chart-sidebar {
  order: 2 !important;
  width: 260px !important;
  min-width: 260px !important;
  max-width: 260px !important;
  margin: 0 !important;
  float: none !important;
  flex: 0 0 260px !important;
}

body.ysh-wc-reports-active .postbox .chart-with-sidebar .main {
  order: 1 !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  width: auto !important;
  max-width: 100% !important;
  float: none !important;
  margin: 0 !important;
}

body.ysh-wc-reports-active .postbox .chart-with-sidebar .chart-container,
body.ysh-wc-reports-active .postbox .inside:not(.chart-with-sidebar) .chart-container {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  float: none !important;
  box-sizing: border-box !important;
}

body.ysh-wc-reports-active .chart-placeholder.main,
body.ysh-wc-reports-active .chart-placeholder {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 280px !important;
  min-height: 380px !important;
  height: 400px !important;
  box-sizing: border-box !important;
  display: block !important;
}

@media (max-width: 960px) {
  body.ysh-wc-reports-active .postbox .inside.chart-with-sidebar {
    flex-direction: column !important;
  }

  body.ysh-wc-reports-active .postbox .chart-with-sidebar .chart-sidebar {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    flex: 1 1 auto !important;
    order: 2 !important;
  }

  body.ysh-wc-reports-active .postbox .chart-with-sidebar .main {
    order: 1 !important;
    width: 100% !important;
  }
}

/* Dark mode */
html[data-yooadmin-studio-color-mode-effective="dark"] body.ysh-wc-reports-active,
html.yooadmin-studio-hub-html[data-yooadmin-studio-color-mode-effective="dark"] body.ysh-wc-reports-active {
  color: var(--ysh-text, #cfd6e0) !important;
}

html[data-yooadmin-studio-color-mode-effective="dark"] body.ysh-wc-reports-active .wrap.woocommerce > nav.nav-tab-wrapper,
html.yooadmin-studio-hub-html[data-yooadmin-studio-color-mode-effective="dark"] body.ysh-wc-reports-active .wrap.woocommerce > nav.nav-tab-wrapper {
  --ysh-wc-tab-border: rgba(255, 255, 255, 0.1);
  --ysh-wc-tab-muted: rgba(255, 255, 255, 0.04);
}

html[data-yooadmin-studio-color-mode-effective="dark"] body.ysh-wc-reports-active .wrap.woocommerce > nav.nav-tab-wrapper a.nav-tab,
html.yooadmin-studio-hub-html[data-yooadmin-studio-color-mode-effective="dark"] body.ysh-wc-reports-active .wrap.woocommerce > nav.nav-tab-wrapper a.nav-tab {
  color: var(--ysh-text, #cfd6e0) !important;
}

html[data-yooadmin-studio-color-mode-effective="dark"] body.ysh-wc-reports-active .wrap.woocommerce > nav.nav-tab-wrapper a.nav-tab-active,
html.yooadmin-studio-hub-html[data-yooadmin-studio-color-mode-effective="dark"] body.ysh-wc-reports-active .wrap.woocommerce > nav.nav-tab-wrapper a.nav-tab-active {
  background: var(--ysh-card, #1a1d23) !important;
  color: var(--ysh-heading, #d8d3ce) !important;
}

html[data-yooadmin-studio-color-mode-effective="dark"] body.ysh-wc-reports-active .woocommerce-reports-wide .postbox,
html.yooadmin-studio-hub-html[data-yooadmin-studio-color-mode-effective="dark"] body.ysh-wc-reports-active .woocommerce-reports-wide .postbox {
  background: var(--ysh-card, #1a1d23) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28) !important;
}

html[data-yooadmin-studio-color-mode-effective="dark"] body.ysh-wc-reports-active .postbox :is(div.stats_range, h3.stats_range) ul,
html.yooadmin-studio-hub-html[data-yooadmin-studio-color-mode-effective="dark"] body.ysh-wc-reports-active .postbox :is(div.stats_range, h3.stats_range) ul {
  background: rgba(255, 255, 255, 0.04) !important;
  border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}

html[data-yooadmin-studio-color-mode-effective="dark"] body.ysh-wc-reports-active .postbox :is(div.stats_range, h3.stats_range) ul li a,
html.yooadmin-studio-hub-html[data-yooadmin-studio-color-mode-effective="dark"] body.ysh-wc-reports-active .postbox :is(div.stats_range, h3.stats_range) ul li a {
  color: var(--ysh-text-muted, #9aa3b2) !important;
  border-right-color: rgba(255, 255, 255, 0.08) !important;
}

html[data-yooadmin-studio-color-mode-effective="dark"] body.ysh-wc-reports-active .postbox :is(div.stats_range, h3.stats_range) ul li.active,
html.yooadmin-studio-hub-html[data-yooadmin-studio-color-mode-effective="dark"] body.ysh-wc-reports-active .postbox :is(div.stats_range, h3.stats_range) ul li.active {
  background: var(--ysh-card-hover, #22262e) !important;
}

html[data-yooadmin-studio-color-mode-effective="dark"] body.ysh-wc-reports-active .postbox :is(div.stats_range, h3.stats_range) ul li.active a,
html.yooadmin-studio-hub-html[data-yooadmin-studio-color-mode-effective="dark"] body.ysh-wc-reports-active .postbox :is(div.stats_range, h3.stats_range) ul li.active a {
  color: var(--ysh-heading, #d8d3ce) !important;
}

html[data-yooadmin-studio-color-mode-effective="dark"] body.ysh-wc-reports-active .postbox .chart-container,
html[data-yooadmin-studio-color-mode-effective="dark"] body.ysh-wc-reports-active .postbox .chart-legend,
html[data-yooadmin-studio-color-mode-effective="dark"] body.ysh-wc-reports-active .postbox .chart-widgets li.chart-widget,
html.yooadmin-studio-hub-html[data-yooadmin-studio-color-mode-effective="dark"] body.ysh-wc-reports-active .postbox .chart-container,
html.yooadmin-studio-hub-html[data-yooadmin-studio-color-mode-effective="dark"] body.ysh-wc-reports-active .postbox .chart-legend,
html.yooadmin-studio-hub-html[data-yooadmin-studio-color-mode-effective="dark"] body.ysh-wc-reports-active .postbox .chart-widgets li.chart-widget {
  background: var(--ysh-card-hover, #22262e) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

html[data-yooadmin-studio-color-mode-effective="dark"] body.ysh-wc-reports-active .postbox .chart-widgets li.chart-widget h4,
html.yooadmin-studio-hub-html[data-yooadmin-studio-color-mode-effective="dark"] body.ysh-wc-reports-active .postbox .chart-widgets li.chart-widget h4 {
  background: rgba(255, 255, 255, 0.04) !important;
  background-image: none !important;
  color: var(--ysh-heading, #d8d3ce) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

html[data-yooadmin-studio-color-mode-effective="dark"] body.ysh-wc-reports-active .postbox .chart-legend li,
html[data-yooadmin-studio-color-mode-effective="dark"] body.ysh-wc-reports-active .postbox .chart-legend li strong,
html.yooadmin-studio-hub-html[data-yooadmin-studio-color-mode-effective="dark"] body.ysh-wc-reports-active .postbox .chart-legend li,
html.yooadmin-studio-hub-html[data-yooadmin-studio-color-mode-effective="dark"] body.ysh-wc-reports-active .postbox .chart-legend li strong {
  color: var(--ysh-text-muted, #9aa3b2) !important;
}

html[data-yooadmin-studio-color-mode-effective="dark"] body.ysh-wc-reports-active .widefat,
html.yooadmin-studio-hub-html[data-yooadmin-studio-color-mode-effective="dark"] body.ysh-wc-reports-active .widefat {
  background: var(--ysh-card-hover, #22262e) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: var(--ysh-text, #cfd6e0) !important;
}
