/* Ads Analytics. Uses the tokens from theme.css; the single data series wears the brand accent. */
.ads-analytics { display: grid; gap: 20px; transition: opacity .2s ease; }
.ads-analytics.is-refreshing { opacity: .55; pointer-events: none; }

/* Stat tiles */
.ads-tile-sub { display: block; margin-top: 2px; color: var(--muted, #657184); font-size: 12px; }
.ads-delta { margin: 10px 0 0; font-size: 12px; color: var(--muted, #657184); }
.ads-delta b { font-weight: 700; }
.ads-delta.positive { color: var(--green, #1b8b61); }
.ads-delta.negative { color: #b42318; }

.ads-notice { margin: 0; padding: 11px 14px; border-radius: 10px; background: #fff7e6; color: #7a4b00; font-size: 13px; }

/* Delivery strip */
.ads-delivery { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; padding: 18px 22px; }
.ads-delivery div { display: grid; gap: 4px; min-width: 0; }
.ads-delivery span { font-size: 12px; color: var(--muted, #657184); }
.ads-delivery strong { font-size: 18px; color: var(--ink, #1d2939); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Daily spend chart: one series, thin columns with a rounded data end, hairline grid */
.ads-chart { position: relative; display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 8px; height: 250px; margin-top: 12px; padding-top: 20px; }
.ads-y { position: relative; margin-bottom: 24px; }
.ads-y span { position: absolute; right: 0; transform: translateY(50%); font-size: 11px; line-height: 1; color: var(--muted, #657184); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ads-plot { position: relative; min-width: 0; }
.ads-grid { position: absolute; inset: 0 0 24px 0; }
.ads-grid i { position: absolute; left: 0; right: 0; border-top: 1px solid #edf0f3; }
.ads-grid i:first-child { border-top-color: #d5dbe3; }
.ads-columns { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(var(--day-count), minmax(0, 1fr)); }
.ads-day { position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; min-width: 0; margin: 0; padding: 0 1px 24px; border: 0; background: none; cursor: default; }
.ads-day:focus-visible { outline: 2px solid #5c44d5; outline-offset: -2px; border-radius: 4px; }
.ads-bar { position: relative; width: 100%; max-width: 24px; border-radius: 4px 4px 0 0; background: var(--orange, #3d23c0); transition: background .12s ease; }
.ads-bar.zero { height: 0 !important; }
.ads-day:hover .ads-bar, .ads-day.hover .ads-bar, .ads-day:focus-visible .ads-bar { background: #5236db; }
.ads-peak { position: absolute; bottom: 100%; left: 50%; transform: translate(-50%, -4px); font-size: 11px; font-weight: 700; font-style: normal; color: var(--ink, #1d2939); white-space: nowrap; }
.ads-x { position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%); font-size: 11px; font-style: normal; color: var(--muted, #657184); white-space: nowrap; }
.ads-x.first { left: 0; transform: none; }
.ads-x.last { left: auto; right: 0; transform: none; }
.ads-tip { position: absolute; top: -8px; z-index: 5; display: grid; gap: 2px; min-width: 150px; padding: 10px 12px; border-radius: 10px; background: #1d2939; color: #fff; box-shadow: 0 10px 30px #1d293933; pointer-events: none; }
.ads-tip strong { font-size: 16px; }
.ads-tip span { font-size: 12px; opacity: .8; margin-bottom: 4px; }
.ads-tip small { font-size: 12px; opacity: .92; }
.ads-tip[hidden] { display: none; }
.ads-chart-empty { padding: 48px 0; text-align: center; color: var(--muted, #657184); }

/* Tables */
.ads-table-toggle { margin-top: 14px; }
.ads-table-toggle summary { cursor: pointer; width: fit-content; color: var(--orange, #3d23c0); font-size: 13px; font-weight: 600; }
.ads-table-scroll { overflow-x: auto; }
.ads-table, .ads-daily-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ads-table { min-width: 760px; }
.ads-table th, .ads-daily-table th { padding: 12px 10px; border-bottom: 1px solid var(--border, #e2e7ed); color: var(--muted, #657184); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.ads-table td, .ads-daily-table td { padding: 14px 10px; border-bottom: 1px solid #eef1f4; color: var(--ink, #1d2939); font-variant-numeric: tabular-nums; vertical-align: top; white-space: nowrap; }
.ads-daily-table td { padding: 9px 10px; }
.ads-table td small { display: block; margin-top: 2px; color: var(--muted, #657184); font-size: 11px; }
.ads-table tbody tr:hover td { background: #fafbfc; }
.ads-campaign { min-width: 260px; white-space: normal !important; }
.ads-campaign strong { display: block; font-weight: 600; }
.ads-campaign span { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.ads-campaign b { padding: 2px 7px; border-radius: 6px; background: #f4f6f8; color: var(--muted, #657184); font-size: 11px; font-weight: 500; }
.ads-table-empty { padding: 28px !important; color: var(--muted, #657184) !important; text-align: center; }

/* Status: a coloured dot beside ink text, never colour alone */
.ads-status { display: inline-flex; align-items: center; gap: 5px; color: var(--ink, #1d2939); font-size: 11px; font-weight: 600; }
.ads-status i { width: 7px; height: 7px; border-radius: 50%; background: #98a2b3; }
.ads-status.good i { background: var(--green, #1b8b61); }
.ads-status.warning i { background: #f79009; }
.ads-status.critical i { background: #d92d20; }

.ads-chart-card, .ads-campaigns { padding: 22px 24px; }
.ads-campaigns .ads-table-scroll { margin: 8px -24px -22px; padding: 0 14px; }
.ads-campaigns .card-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ads-filter { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--border, #e2e7ed); border-radius: 10px; background: #f9fafb; }
.ads-filter button { padding: 6px 12px; border: 0; border-radius: 8px; background: none; color: var(--muted, #657184); font-size: 13px; font-weight: 600; }
.ads-filter button.active { background: #fff; color: var(--ink, #1d2939); box-shadow: 0 1px 2px #1d29391a; }
.ads-filter button span { margin-left: 3px; font-weight: 500; color: var(--muted, #657184); }

.ads-footnote { margin: 0; color: var(--muted, #657184); font-size: 12px; }

@media (max-width: 1000px) {
  .ads-delivery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .ads-delivery { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 16px; }
  .ads-chart { height: 210px; grid-template-columns: 46px minmax(0, 1fr); }
  .ads-chart-card, .ads-campaigns { padding: 18px 16px; }
  .ads-campaigns .ads-table-scroll { margin: 8px -16px -18px; padding: 0 6px; }
  .ads-x:not(.first):not(.last):not(.mid) { display: none; }
}
