.ssr-page[hidden] { display: none !important; }

.ssr-page {
  position: fixed;
  inset: 0;
  z-index: 2380;
  overflow-y: auto;
  overscroll-behavior: contain;
  background:
    radial-gradient(circle at 14% 0%, rgba(140, 82, 255, .10), transparent 35%),
    radial-gradient(circle at 85% 85%, rgba(234, 57, 112, .10), transparent 35%),
    #13152e;
  color: #fff;
  font-family: Inter, var(--app-font), sans-serif;
}

.ssr-shell { width: min(1240px, 100%); margin: 0 auto; padding: 0 14px 32px; }
.ssr-topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 66px;
  margin: 0 -14px 16px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(143, 148, 186, .16);
  background: rgba(19, 21, 46, .94);
  backdrop-filter: blur(14px);
}
.ssr-back,
.ssr-filter-button,
.ssr-clear-button,
.ssr-page-button,
.ssr-preset {
  border: 0;
  font: inherit;
}
.ssr-back {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #2a2e57;
  color: #fff;
}
.ssr-title { min-width: 0; }
.ssr-title h2 { margin: 0; font-size: 1.05rem; font-weight: 800; }
.ssr-title p { margin: 3px 0 0; color: #8f94ba; font-size: .73rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ssr-scope {
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid rgba(0, 240, 255, .25);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(0, 240, 255, .08);
  color: #00f0ff;
  font-size: .68rem;
  font-weight: 800;
}

.ssr-stack { display: grid; gap: 14px; }
.ssr-panel {
  min-width: 0;
  border: 1px solid rgba(46, 50, 92, .72);
  border-radius: 18px;
  background: #1f2246;
  box-shadow: 0 12px 30px rgba(4, 6, 24, .16);
}
.ssr-filter-panel { padding: 16px; }
.ssr-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.ssr-panel-head h3 { margin: 0; font-size: .84rem; font-weight: 800; }
.ssr-panel-head h3 i { margin-right: 7px; color: #ff4c82; }
.ssr-clear-button { padding: 6px 9px; border-radius: 9px; background: rgba(255, 76, 130, .10); color: #ff7da3; font-size: .68rem; font-weight: 800; }
.ssr-clear-button:disabled { display: none; }
.ssr-date-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.ssr-field label { display: block; margin: 0 0 5px; color: #8f94ba; font-size: .62rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.ssr-field input,
.ssr-table-search {
  width: 100%;
  min-height: 40px;
  border: 1px solid #2e325c;
  border-radius: 11px;
  background: #161936;
  color: #fff;
  padding: 8px 10px;
  outline: none;
  font-size: .78rem;
}
.ssr-field input:focus,
.ssr-table-search:focus { border-color: #ff4c82; box-shadow: 0 0 0 3px rgba(255, 76, 130, .15); }
.ssr-field input::-webkit-calendar-picker-indicator { filter: invert(1); opacity: .65; }
.ssr-filter-button { min-height: 40px; border-radius: 11px; padding: 8px 14px; background: #ff4c82; color: #fff; font-size: .74rem; font-weight: 800; }
.ssr-presets { display: grid; gap: 8px; margin-top: 12px; }
.ssr-preset-row { display: flex; align-items: center; gap: 5px; overflow-x: auto; padding-bottom: 2px; }
.ssr-preset-label { flex: 0 0 auto; color: #8f94ba; font-size: .68rem; font-weight: 800; }
.ssr-preset { flex: 0 0 auto; border-radius: 8px; padding: 5px 9px; background: #2a2e57; color: #a2a8cc; font-size: .68rem; font-weight: 800; }
.ssr-preset.active { background: #ff4c82; color: #fff; }

.ssr-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.ssr-kpi { min-width: 0; padding: 13px; }
.ssr-kpi span { display: block; color: #8f94ba; font-size: .60rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.ssr-kpi strong { display: block; margin-top: 5px; overflow: hidden; text-overflow: ellipsis; color: var(--ssr-accent, #ff4c82); font-size: 1rem; white-space: nowrap; }

.ssr-dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ssr-chart-panel { display: flex; min-height: 320px; max-height: 470px; flex-direction: column; padding: 14px; }
.ssr-chart-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.ssr-chart-title h3 { margin: 0; font-size: .82rem; font-weight: 800; }
.ssr-chart-title button { border: 0; background: transparent; color: var(--ssr-accent, #ff4c82); font-size: .68rem; font-weight: 800; }
.ssr-chart-title button:disabled { display: none; }
.ssr-bars { min-height: 0; overflow-y: auto; border-radius: 12px; padding: 7px; background: rgba(22, 25, 54, .65); }
.ssr-bar { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; min-height: 38px; margin-bottom: 6px; border: 1px solid rgba(46, 50, 92, .72); border-radius: 10px; padding: 8px 10px; background: #161936; color: #fff; cursor: pointer; }
.ssr-bar:last-child { margin-bottom: 0; }
.ssr-bar::before { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--ssr-width, 0%); background: color-mix(in srgb, var(--ssr-accent, #3b82f6) 17%, transparent); pointer-events: none; }
.ssr-bar.active { border-color: var(--ssr-accent, #3b82f6); box-shadow: inset 0 0 0 1px var(--ssr-accent, #3b82f6); }
.ssr-bar.muted { opacity: .38; }
.ssr-bar-name,
.ssr-bar-value { position: relative; z-index: 1; font-size: .70rem; font-weight: 800; }
.ssr-bar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ssr-bar-value { color: var(--ssr-accent, #3b82f6); white-space: nowrap; }
.ssr-empty { display: grid; min-height: 180px; place-items: center; color: #8f94ba; font-size: .75rem; font-weight: 700; text-align: center; }

.ssr-table-panel { overflow: hidden; }
.ssr-table-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px; border-bottom: 1px solid #2e325c; }
.ssr-table-tools h3 { margin: 0; font-size: .84rem; font-weight: 800; white-space: nowrap; }
.ssr-search-wrap { position: relative; width: min(360px, 62%); }
.ssr-search-wrap i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: #8f94ba; font-size: .75rem; }
.ssr-table-search { padding-left: 32px; min-height: 36px; }
.ssr-table-scroll { overflow-x: auto; }
.ssr-table { width: 100%; min-width: 1040px; border-collapse: collapse; color: #dbe2ff; font-size: .70rem; }
.ssr-table th { position: sticky; top: 0; padding: 10px 8px; background: #25294f; color: #8f94ba; text-align: left; white-space: nowrap; cursor: pointer; }
.ssr-table td { padding: 9px 8px; border-top: 1px solid rgba(46, 50, 92, .55); vertical-align: top; }
.ssr-table th.numeric,
.ssr-table td.numeric { text-align: right; }
.ssr-table tbody tr:hover { background: rgba(255, 255, 255, .025); }
.ssr-order-code { color: #ff7da3; font-weight: 800; }
.ssr-table-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-top: 1px solid #2e325c; color: #8f94ba; font-size: .70rem; }
.ssr-pagination { display: flex; align-items: center; gap: 5px; }
.ssr-page-button { min-width: 32px; height: 32px; border-radius: 9px; background: #2a2e57; color: #fff; font-weight: 800; }
.ssr-page-button:disabled { opacity: .35; }
.ssr-report-loading { display: grid; min-height: 300px; place-items: center; color: #a2a8cc; font-size: .82rem; font-weight: 700; }

@media (max-width: 760px) {
  .ssr-shell { padding-inline: 8px; }
  .ssr-topbar { margin-inline: -8px; padding-inline: 10px; }
  .ssr-scope { max-width: 110px; }
  .ssr-filter-panel { padding: 12px; }
  .ssr-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .ssr-kpi { padding: 11px; }
  .ssr-kpi strong { font-size: .88rem; }
  .ssr-dashboard-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .ssr-chart-panel { min-height: 270px; max-height: 390px; }
  .ssr-table-tools { align-items: stretch; flex-direction: column; }
  .ssr-search-wrap { width: 100%; }
  .ssr-table-footer { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 420px) {
  .ssr-date-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .ssr-filter-button { grid-column: 1 / -1; width: 100%; }
  .ssr-title h2 { font-size: .94rem; }
}

/* Giao diện dùng nguyên reportContainer của app Quản lý đơn hàng. */
html.seller-sales-report-open,
body.seller-sales-report-open {
  background: #13152e;
  overscroll-behavior-y: auto;
}
body.seller-sales-report-open {
  display: block;
  min-height: 100dvh;
  margin: 0;
  padding: 0;
  overflow: visible;
}
body.seller-sales-report-open > .main-card { display: none; }
#sellerSalesReportPage[hidden] { display: none !important; }
#sellerSalesReportPage {
  position: relative;
  width: 100%;
  min-height: 100dvh;
  overflow: visible;
  overscroll-behavior: auto;
  background: #13152e;
  color: #fff;
  font-family: Inter, Arial, sans-serif;
}
#sellerSalesReportPage,
#sellerSalesReportPage *,
#sellerSalesReportPage *::before,
#sellerSalesReportPage *::after { box-sizing: border-box; }
#sellerSalesReportPage #reportContainer { min-height: calc(100dvh - 64px); }
#sellerSalesReportPage button,
#sellerSalesReportPage input { font-family: inherit; line-height: inherit; }
#sellerSalesReportPage h1,
#sellerSalesReportPage h2,
#sellerSalesReportPage h3,
#sellerSalesReportPage p { margin: 0; }

#sellerSalesReportPage button[onclick^="openSalesReportOrderDocument("] {
  appearance: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: #7dd3fc;
  font-size: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
#sellerSalesReportPage button[onclick^="openSalesReportOrderDocument("]:hover { color: #fff; }
#sellerSalesReportPage button[onclick^="openSalesReportOrderDocument("]:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
  border-radius: 2px;
}

#sellerSalesReportPage button[onclick="loadSalesReportData()"],
#sellerSalesReportPage button[onclick="exportSalesDetailToExcel()"] {
  appearance: none;
  border: 0 !important;
  outline: 0;
}

#sellerSalesReportPage [id^="btnReset"] {
  appearance: none;
  padding: 0;
  border: 0 !important;
  background: transparent !important;
  font-size: 12px;
  font-weight: 700;
  line-height: 1rem;
  text-decoration: none;
}
#sellerSalesReportPage [id^="btnReset"]:hover { text-decoration: underline; }
#sellerSalesReportPage #btnResetSellers { color: #ff4c82; }
#sellerSalesReportPage #btnResetCustomers { color: #3b82f6; }
#sellerSalesReportPage #btnResetProducts { color: #b162ff; }
#sellerSalesReportPage #btnResetCategories { color: #00f0ff; }

.seller-sales-report-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  height: 64px;
  flex: 0 0 64px;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid rgba(46, 50, 92, .5);
  background: #13152e;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, .1), 0 2px 4px -2px rgba(0, 0, 0, .1);
}
.seller-sales-report-header-title { display: flex; align-items: center; }
.seller-sales-report-header-title > button {
  display: grid;
  width: 22px;
  height: 40px;
  place-items: center;
  margin-right: 16px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #8f94ba;
  font-size: 20px;
  transition: color 150ms ease;
}
.seller-sales-report-header-title > button:hover,
.seller-sales-report-header-title > button:focus-visible { color: #fff; outline: none; }
.seller-sales-report-header-title h1 {
  margin: 0;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
}
.seller-sales-report-header-title p {
  margin: 0;
  color: #8f94ba;
  font-size: 12px;
  font-weight: 500;
  line-height: 1rem;
}
#sellerSalesReportRefresh {
  display: flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border: 0;
  border-radius: 9999px;
  background: #1f2246;
  color: #8f94ba;
  transition: color 150ms ease, background-color 150ms ease;
}
#sellerSalesReportRefresh:hover,
#sellerSalesReportRefresh:focus-visible { background: #2e325c; color: #ff4c82; outline: none; }
#sellerSalesReportRefresh:disabled { cursor: wait; opacity: .6; }
#sellerSalesReportRefresh svg { display: block; width: 19px; height: 19px; }
#sellerSalesReportRefresh:disabled svg { animation: seller-report-refresh-spin .75s linear infinite; }
@keyframes seller-report-refresh-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  #sellerSalesReportRefresh:disabled svg { animation: none; }
}

/* Bootstrap dùng .border với !important; khóa lại đúng bảng màu của trang gốc. */
#sellerSalesReportPage .border { border: 1px solid #2e325c !important; }
#sellerSalesReportPage [class~="border-[#2e325c]"] { border-color: #2e325c !important; }
#sellerSalesReportPage [class~="border-[#2e325c]/20"] { border-color: rgba(46, 50, 92, .2) !important; }
#sellerSalesReportPage [class~="border-[#2e325c]/50"] { border-color: rgba(46, 50, 92, .5) !important; }
#sellerSalesReportPage [class~="border-[#2e325c]/60"] { border-color: rgba(46, 50, 92, .6) !important; }
#sellerSalesReportPage [class~="border-[#ff4c82]"] { border-color: #ff4c82 !important; }
#sellerSalesReportPage [class~="border-[#ff4c82]/20"] { border-color: rgba(255, 76, 130, .2) !important; }
#sellerSalesReportPage [class~="border-[#ff4c82]/30"] { border-color: rgba(255, 76, 130, .3) !important; }
#sellerSalesReportPage [class~="border-[#ff4c82]/50"] { border-color: rgba(255, 76, 130, .5) !important; }
#sellerSalesReportPage [class~="border-[#00f0ff]"] { border-color: #00f0ff !important; }
#sellerSalesReportPage [class~="border-[#00f0ff]/20"] { border-color: rgba(0, 240, 255, .2) !important; }
#sellerSalesReportPage [class~="border-[#00f0ff]/50"] { border-color: rgba(0, 240, 255, .5) !important; }
#sellerSalesReportPage [class~="border-[#b162ff]/20"] { border-color: rgba(177, 98, 255, .2) !important; }
#sellerSalesReportPage [class~="border-[#b162ff]/50"] { border-color: rgba(177, 98, 255, .5) !important; }
#sellerSalesReportPage [class~="border-[#3b82f6]/20"] { border-color: rgba(59, 130, 246, .2) !important; }
#sellerSalesReportPage [class~="border-[#3b82f6]/50"] { border-color: rgba(59, 130, 246, .5) !important; }

/* Khôi phục đúng thang spacing Tailwind bị utility Bootstrap cùng tên ghi đè. */
#sellerSalesReportPage .gap-3 { gap: .75rem !important; }
#sellerSalesReportPage .gap-4 { gap: 1rem !important; }
#sellerSalesReportPage .gap-5 { gap: 1.25rem !important; }
#sellerSalesReportPage .p-3 { padding: .75rem !important; }
#sellerSalesReportPage .px-3 { padding-left: .75rem !important; padding-right: .75rem !important; }
#sellerSalesReportPage .pb-3 { padding-bottom: .75rem !important; }
#sellerSalesReportPage .pt-3 { padding-top: .75rem !important; }
#sellerSalesReportPage .pl-3 { padding-left: .75rem !important; }
#sellerSalesReportPage .pr-3 { padding-right: .75rem !important; }
#sellerSalesReportPage .mb-4 { margin-bottom: 1rem !important; }
#sellerSalesReportPage .mt-5 { margin-top: 1.25rem !important; }
#sellerSalesReportPage .shadow-sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, .05) !important; }

@media (max-width: 639px) {
  #sellerSalesReportPage .p-4 { padding: 1rem !important; }
}
@media (min-width: 640px) {
  #sellerSalesReportPage [class~="sm:gap-3"] { gap: .75rem !important; }
  #sellerSalesReportPage [class~="sm:gap-4"] { gap: 1rem !important; }
  #sellerSalesReportPage [class~="sm:mt-5"] { margin-top: 1.25rem !important; }
  #sellerSalesReportPage [class~="sm:p-2.5"] { padding: .625rem !important; }
  #sellerSalesReportPage [class~="sm:p-4"] { padding: 1rem !important; }
  #sellerSalesReportPage [class~="sm:p-5"] { padding: 1.25rem !important; }
  #sellerSalesReportPage [class~="sm:p-6"] { padding: 1.5rem !important; }
  #sellerSalesReportPage [class~="sm:pr-10"] { padding-right: 2.5rem !important; }
  #sellerSalesReportPage [class~="sm:px-3"] { padding-left: .75rem !important; padding-right: .75rem !important; }
  #sellerSalesReportPage [class~="sm:py-1.5"] { padding-top: .375rem !important; padding-bottom: .375rem !important; }
  #sellerSalesReportPage [class~="sm:py-2.5"] { padding-top: .625rem !important; padding-bottom: .625rem !important; }
}
@media (min-width: 768px) {
  #sellerSalesReportPage [class~="md:p-8"] { padding: 2rem !important; }
}
@media (min-width: 1024px) {
  #sellerSalesReportPage [class~="lg:pl-5"] { padding-left: 1.25rem !important; }
}
#sellerSalesReportPage #salesDetailTable { width: 100%; max-width: 100%; table-layout: fixed; }
#sellerSalesReportPage #salesDetailTable th,
#sellerSalesReportPage #salesDetailTable td {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
  padding-left: clamp(.25rem, .55vw, .5rem);
  padding-right: clamp(.25rem, .55vw, .5rem);
}
@media (max-width: 767px) {
  #sellerSalesReportPage .sales-detail-table-scroll {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }
  #sellerSalesReportPage #salesDetailTable {
    width: max-content;
    min-width: 100%;
    max-width: none;
    table-layout: auto;
  }
  #sellerSalesReportPage #salesDetailTable col {
    width: auto !important;
  }
}
.seller-sales-report-back {
  position: fixed;
  right: 18px;
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 2390;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 999px;
  background: #ff4c82;
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}
.seller-sales-report-back:hover,
.seller-sales-report-back:focus-visible { background: #ff7da3; outline: 2px solid #fff; outline-offset: 2px; }
.seller-sales-report-loading-indicator {
  position: fixed;
  inset: 0;
  z-index: 2400;
  display: none;
  place-items: center;
  background: rgba(19, 21, 46, .72);
  color: #fff;
  font-size: .85rem;
  font-weight: 700;
  backdrop-filter: blur(2px);
}
.seller-sales-report-loading .seller-sales-report-loading-indicator { display: grid; }
#sellerSalesReportPage::-webkit-scrollbar,
#sellerSalesReportPage *::-webkit-scrollbar { width: 8px; height: 8px; }
#sellerSalesReportPage::-webkit-scrollbar-thumb,
#sellerSalesReportPage *::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 999px; background: #2e325c; background-clip: padding-box; }
#sellerSalesReportPage::-webkit-scrollbar-track,
#sellerSalesReportPage *::-webkit-scrollbar-track { background: #13152e; }
@media (max-width: 640px) {
  .seller-sales-report-header { padding: 0 16px; }
  .seller-sales-report-header-title h1 { font-size: 17px; }
  .seller-sales-report-back {
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    width: 40px;
    height: 40px;
  }
}

@media (min-width: 640px) {
  #sellerSalesReportPage button[onclick="loadSalesReportData()"] {
    align-self: flex-end;
    margin-top: 0 !important;
  }
}
