/* Item 396 Ads Report — compact month table that fits at 1280px. */

.ads-report-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1rem;
}
.ads-report-heading > div {
  flex: 1 1 18rem;
  min-width: 0;
}

.ads-report-heading h2 {
  margin: 0;
  font-size: 1.55rem;
  letter-spacing: -0.02em;
}

.ads-report-heading p {
  margin: 0.25rem 0 0;
  color: var(--admin-muted, #647488);
  max-width: 42rem;
}

.ads-report-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 0.65rem;
  flex: 0 0 auto;
  margin-left: auto;
}

.ads-report-month {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.75rem;
  color: var(--admin-muted, #647488);
  font-weight: 600;
}

.ads-report-month select {
  min-width: 10.5rem;
  height: 2.15rem;
  padding: 0 0.6rem;
  border: 1px solid var(--admin-line, #d7e1e6);
  border-radius: 0.45rem;
  background: var(--admin-paper, #fff);
  color: var(--admin-ink, #0e2440);
  font-weight: 600;
}

.ads-report-export {
  height: 2.15rem;
  padding: 0 1rem;
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.ads-report-export:hover,
.ads-report-export:focus-visible {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}

.ads-report-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.9rem 0 0.85rem;
}

.ads-report-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--admin-line, #d7e1e6);
  background: var(--admin-paper, #fff);
  color: var(--admin-ink, #0e2440);
  border-radius: 999px;
  padding: 0.32rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.2;
}

.ads-report-tab svg {
  width: 0.9rem;
  height: 0.9rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ads-report-tab[aria-selected="true"] {
  background: var(--admin-navy, #061e35);
  border-color: var(--admin-navy, #061e35);
  color: #fff;
}

.ads-report-tab:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.ads-report-card {
  background: var(--admin-paper, #fff);
  border: 1px solid var(--admin-line, #d7e1e6);
  border-radius: 0.85rem;
  box-shadow: var(--admin-shadow, 0 18px 45px rgba(3, 23, 42, .08));
  padding: 0.9rem 0.9rem 0.6rem;
  overflow: hidden;
}

.ads-report-card-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 0.6rem;
}

.ads-report-brand {
  display: inline-flex;
  align-items: center;
  background: #1d4ed8;
  color: #fff;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  padding: 0.18rem 0.5rem;
  border-radius: 0.3rem;
}

.ads-report-card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 750;
  color: var(--admin-ink, #0e2440);
}

.ads-report-label-chip {
  display: inline-flex;
  align-items: center;
  background: #eef2f6;
  color: #4b5563;
  font-size: 0.72rem;
  font-weight: 650;
  padding: 0.14rem 0.45rem;
  border-radius: 999px;
}

.ads-report-scope {
  margin: 0 0 0.55rem;
  color: #4b5563;
  font-size: 0.78rem;
}

.ads-report-note {
  margin: 0 0 0.75rem;
  padding: 0.55rem 0.7rem;
  background: #fff7dc;
  border: 1px solid #f0d889;
  border-radius: 0.45rem;
  color: #6b4e00;
  font-size: 0.75rem;
  line-height: 1.45;
}

.ads-report-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.ads-report-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.68rem;
}

.ads-report-table th:nth-child(1),
.ads-report-table td:nth-child(1) { width: 8.4rem; }
.ads-report-table th:nth-child(2),
.ads-report-table td:nth-child(2) { width: 6.6rem; }
.ads-report-table th,
.ads-report-table td {
  padding: 0.28rem 0.22rem;
  text-align: right;
  border-bottom: 1px solid var(--admin-line, #d7e1e6);
  white-space: nowrap;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: clip;
}

.ads-report-table th:first-child,
.ads-report-table td:first-child,
.ads-report-table tfoot td:first-child {
  text-align: left;
  white-space: nowrap;
}

.ads-report-table thead th {
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--admin-muted, #647488);
  font-weight: 700;
  background: #f7fafb;
  position: sticky;
  top: 0;
}

.ads-report-date {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 600;
}





.ads-report-spend {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.15rem;
  font-variant-numeric: tabular-nums;
}

.ads-report-spend-prefix {
  min-width: 1.7rem;
  color: var(--admin-muted, #647488);
  font-weight: 650;
}

.ads-report-spend input {
  width: 4.35rem;
  height: 1.45rem;
  padding: 0 0.22rem;
  border: 1px solid var(--admin-line, #d7e1e6);
  border-radius: 0.3rem;
  text-align: right;
  font: inherit;
  font-variant-numeric: tabular-nums;
  background: #fff;
}

.ads-report-spend input[readonly] {
  background: #f4f7f8;
  color: var(--admin-ink, #0e2440);
  border-color: transparent;
  font-weight: 650;
}

.ads-report-released {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-weight: 650;
}

.ads-report-metric {
  font-variant-numeric: tabular-nums;
}

.ads-report-metric .ads-report-cost {
  color: var(--admin-muted, #647488);
}

.ads-report-table tfoot td {
  font-weight: 750;
  border-bottom: 0;
  background: #f3f7f8;
}

.ads-report-writers {
  margin: 0.9rem 0 0;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--admin-line, #d7e1e6);
  border-radius: 0.6rem;
  background: var(--admin-paper, #fff);
  font-size: 0.8rem;
}

.ads-report-writers summary {
  cursor: pointer;
  font-weight: 650;
}

.ads-report-writers textarea {
  width: 100%;
  margin: 0.35rem 0 0.5rem;
}

@media (max-width: 1280px) {
  .ads-report-table {
    font-size: 0.64rem;
  }
  .ads-report-table th,
  .ads-report-table td {
    padding: 0.24rem 0.16rem;
  }
  .ads-report-table th:nth-child(1),
  .ads-report-table td:nth-child(1) { width: 7.6rem; }
  .ads-report-table th:nth-child(2),
  .ads-report-table td:nth-child(2) { width: 6.1rem; }
  .ads-report-spend input {
    width: 3.9rem;
  }
  .ads-report-note {
    font-size: 0.7rem;
  }
}

/* Contain the report in the 1470 desktop canvas (sidebar 252px + content padding). */
#adSpendSection.admin-content,
#adSpendSection {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow-x: hidden;
}
#adSpendSection .ads-report-heading,
#adSpendSection .ads-report-tabs,
#adSpendSection .ads-report-card {
  max-width: 100%;
  min-width: 0;
}
.ads-report-note,
.ads-report-scope {
  overflow-wrap: anywhere;
  max-width: 100%;
}
.ads-report-table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
}
#adSpendSection .ads-report-table {
  width: 100% !important;
  max-width: 100%;
  table-layout: fixed !important;
}
#adSpendSection .ads-report-table th:nth-child(1),
#adSpendSection .ads-report-table td:nth-child(1) { width: 16%; }
#adSpendSection .ads-report-table th:nth-child(2),
#adSpendSection .ads-report-table td:nth-child(2) { width: 16%; }
#adSpendSection .ads-report-table th:nth-child(n+3),
#adSpendSection .ads-report-table td:nth-child(n+3) { width: 13.6%; }
#adSpendSection .ads-report-table th:nth-child(7),
#adSpendSection .ads-report-table td:nth-child(7) { width: 16%; }
#adSpendSection .ads-report-table th,
#adSpendSection .ads-report-table td {
  box-sizing: border-box;
}

/* Lock the workspace to the 1470 canvas minus the 252px sidebar so the
   table cannot widen the page and clip Export or the last column. */
body:has(#adSpendSection:not(.admin-hidden)) .admin-main,
body:has(#adSpendSection:not(.admin-hidden)) .admin-workspace {
  max-width: calc(1470px - 252px);
  overflow-x: hidden;
  box-sizing: border-box;
}
