/* ---------------------------------------------------------------------------
   Reporting (public/reporting.js, public/ad-reporting.js): the Custom
   reports landing and New report screens, the ads reports' tiles, charts
   and table, and the Local Marketing Audit tab.
--------------------------------------------------------------------------- */

/* ----- the module header: Reporting · tabs, as the reference draws it ----- */
.page-head.module-head.rp-module-head { min-height: 56px; padding: 0 16px 0 0; }
.rp-module-head .page-title { font: 500 24px/32px Roboto, var(--font, system-ui), sans-serif; padding: 12px 10px 12px 8px; margin: 0 8px; }
.rp-module-head .subtabs { align-self: stretch; }
.rp-module-head .subtab { font: 500 15.5px/24px Roboto, var(--font, system-ui), sans-serif; padding: 16px 7px 14px; margin: 0 4px; border-bottom-width: 2px; align-self: stretch; }
.rp-module-head .subtab.on { font-weight: 500; }
@media (max-width: 900px) { .rp-module-head .page-title { font-size: 20px; } .rp-module-head .subtab { font-size: 14.5px; padding: 14px 6px 12px; } }

/* ----- Custom reports: the empty landing ----- */
.rp-empty { text-align: center; padding: 48px 20px 36px; max-width: 1180px; margin: 0 auto; }
.rp-empty-art { width: 300px; max-width: 80%; height: auto; margin: 0 auto 26px; display: block; }
.rp-empty h2 { font-size: 28px; line-height: 1.2; font-weight: 600; letter-spacing: -0.02em; margin: 0 auto 12px; max-width: 620px; }
.rp-empty p { color: var(--muted); font-size: 17px; line-height: 1.5; max-width: 680px; margin: 0 auto 26px; }
.rp-empty .btn { font-size: 15px; padding: 11px 20px; }
.rp-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; margin: 34px auto 0; text-align: center; }
.rp-feature { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 30px 26px 26px; }
.rp-feature .ring { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 18px; }
.rp-feature .ring.blue { background: #eaf1fe; color: #2f6fed; }
.rp-feature .ring.red { background: #fdeaea; color: #d64545; }
.rp-feature .ring.amber { background: #fff6e0; color: #c98a00; }
.rp-feature h3 { font-size: 17px; font-weight: 600; margin: 0 0 8px; }
.rp-feature p { color: var(--muted); font-size: 14.5px; line-height: 1.5; margin: 0; }

/* ----- New report ----- */
.rp-topbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 14px 26px; background: var(--surface); box-shadow: rgba(0, 0, 0, 0.11) 0 2px 3px; position: relative; z-index: 2; }
.rp-topbar h1 { margin: 0; font-size: 22px; font-weight: 600; text-align: center; }
.rp-topbar .btn.link { color: var(--text); font-size: 16px; font-weight: 550; justify-self: start; }
.rp-new { max-width: 1320px; margin: 24px auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 40px clamp(16px, 6vw, 110px) 48px; }
.rp-section { border: 1px solid var(--line); border-radius: 12px; padding: 26px 28px 28px; }
.rp-section h2 { font-size: 18px; font-weight: 600; margin: 0 0 4px; }
.rp-section > p { color: var(--muted); font-size: 15px; margin: 0 0 24px; }
.rp-sources { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 22px; }
.rp-source { border: 1px solid var(--line); border-radius: 10px; padding: 30px 22px 28px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.rp-source svg.art { width: 230px; max-width: 100%; height: 170px; margin-bottom: 14px; }
.rp-source h3 { font-size: 17px; font-weight: 600; margin: 0; }
.rp-source p { color: var(--muted); font-size: 15px; margin: 0 0 14px; line-height: 1.4; }
.rp-source .btn { margin-top: auto; min-width: 96px; padding: 10px 18px; font-size: 14px; }
.rp-or { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 15px; margin: 34px 0; }
.rp-or::before, .rp-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.rp-import { display: grid; grid-template-columns: 1fr minmax(240px, 380px); gap: 28px; align-items: center; }
.rp-import .row { display: flex; gap: 12px; align-items: center; }
.rp-import select { flex: 1; min-width: 0; padding: 12px 14px; font-size: 15px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); }
.rp-import .btn { padding: 12px 22px; font-size: 15px; }
.rp-import svg.art { width: 100%; height: auto; }
@media (max-width: 720px) { .rp-import { grid-template-columns: 1fr; } .rp-import svg.art { display: none; } }

/* ----- the reports table and builder ----- */
.rp-prop { margin: 0 0 10px; }
.rp-prop label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; font-weight: 550; }
.rp-prop input, .rp-prop select { width: 100%; box-sizing: border-box; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text); font-size: 13.5px; }
.rp-prop input[type=color] { height: 34px; padding: 2px 4px; }
.rp-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 14px; }
.rp-head h2 { font-size: 18px; font-weight: 600; margin: 0; }
.rp-head .sub { color: var(--muted); font-size: 13px; }
.rp-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rp-widget-row { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.rp-widget-row input { flex: 1; min-width: 140px; }
.rp-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }

/* ----- the ads reports ----- */
.ads-banner { text-align: center; color: #d64545; font-size: 15px; padding: 2px 0 14px; }
.ads-banner.grey { color: var(--muted); }
.ads-banner button.link { background: none; border: 0; padding: 0; color: #2f6fed; font: inherit; cursor: pointer; }
.ads-banner button.link:hover { text-decoration: underline; }
.ads-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 18px; }
.ads-title h2 { font-size: 24px; font-weight: 500; margin: 0; letter-spacing: -0.01em; }
.ads-title .right { margin-left: auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ads-range { position: relative; }
.ads-range > button { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 8px; padding: 11px 16px; font-size: 15px; cursor: pointer; white-space: nowrap; }
.ads-pop { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12); padding: 12px; z-index: 20; min-width: 280px; }
.ads-pop .presets { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 10px; }
.ads-pop .presets button { text-align: left; border: 0; background: none; padding: 7px 9px; border-radius: 6px; font-size: 13.5px; color: var(--text); cursor: pointer; }
.ads-pop .presets button:hover { background: var(--hover); }
.ads-pop .presets button.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.ads-pop .dates { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ads-pop .dates input { width: 100%; box-sizing: border-box; padding: 7px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text); }
.ads-pop .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.ads-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; margin: 0 0 18px; }
.ads-tile { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px 18px 10px; }
.ads-tile .lab { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.ads-tile .lab .ico-ring { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; }
.ads-tile .lab .name { border-bottom: 1px dashed currentColor; cursor: help; }
.ads-tile .big { font-size: 34px; font-weight: 500; letter-spacing: -0.02em; margin: 14px 0 6px; font-variant-numeric: tabular-nums; }
.ads-tile svg.chart { width: 100%; height: auto; display: block; }
.ads-tile .flat { color: var(--muted); font-size: 13px; padding: 30px 0; text-align: center; }
.ads-small { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 18px; margin: 0 0 22px; }
.ads-small .ads-tile { padding: 16px 18px 18px; }
.ads-small .lab { justify-content: space-between; }
.ads-small .big { font-size: 32px; margin: 10px 0 0; }
.ads-gear { border: 0; background: none; padding: 2px; color: var(--muted); cursor: pointer; display: grid; place-items: center; border-radius: 6px; }
.ads-gear:hover { background: var(--hover); color: var(--text); }
.ads-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 14px; }
.ads-search { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 10px 14px; min-width: 260px; color: var(--muted); }
.ads-search input { border: 0; background: none; outline: none; font-size: 15px; color: var(--text); flex: 1; min-width: 0; }
.ads-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px; font-size: 13px; background: var(--brand-soft); color: var(--brand); }
.ads-chip button { border: 0; background: none; color: inherit; cursor: pointer; padding: 0; display: grid; }
.ads-toolbar .right { margin-left: auto; display: flex; gap: 8px; align-items: center; position: relative; }
.ads-cols { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12); padding: 10px 6px; z-index: 20; min-width: 220px; max-height: 360px; overflow: auto; }
.ads-cols label { display: flex; align-items: center; gap: 8px; padding: 6px 10px; font-size: 13.5px; border-radius: 6px; cursor: pointer; }
.ads-cols label:hover { background: var(--hover); }
.ads-cols label.fixed { color: var(--muted); cursor: default; }
.ads-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.ads-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ads-table th { text-align: left; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 14px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ads-table th button { border: 0; background: none; font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; display: inline-flex; align-items: center; gap: 5px; cursor: pointer; padding: 0; }
.ads-table th button .ico { opacity: 0.45; }
.ads-table th.on button { color: var(--text); }
.ads-table th.on button .ico { opacity: 1; color: var(--brand); }
.ads-table th .ico-help { color: var(--muted); cursor: help; }
.ads-table td { padding: 14px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; font-variant-numeric: tabular-nums; }
.ads-table tr:last-child td { border-bottom: 0; }
.ads-table tr:nth-child(even) td { background: color-mix(in srgb, var(--bg) 55%, transparent); }
.ads-table .num, .ads-table th.num { text-align: center; }
.ads-table .name { font-weight: 600; max-width: 180px; }
.ads-table .name a { color: #2f6fed; text-decoration: underline; cursor: pointer; }
.ads-table .name .sub { font-weight: 400; color: var(--muted); font-size: 12px; }
.ads-status { display: inline-grid; place-items: center; }
.ads-status.active { color: #22a06b; }
.ads-status.paused { color: #f0932b; }
.ads-status.ended { color: #9aa3ae; }
.ads-foot { display: flex; align-items: center; gap: 12px; margin: 14px 2px 0; font-size: 14px; color: var(--muted); }
.ads-pages { margin-left: auto; display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--surface); }
.ads-pages button { border: 0; border-left: 1px solid var(--line); background: none; min-width: 34px; height: 34px; color: var(--muted); cursor: pointer; display: grid; place-items: center; font-size: 13.5px; }
.ads-pages button:first-child { border-left: 0; }
.ads-pages button.on { background: #2f6fed; color: #fff; }
.ads-pages button:disabled { opacity: 0.4; cursor: default; }
.ads-tabs { display: flex; gap: 18px; border-bottom: 1px solid var(--line); margin: 0 0 14px; }
.ads-tabs button { border: 0; background: none; padding: 8px 2px 10px; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; margin-bottom: -1px; }
.ads-tabs button.on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.ads-empty { padding: 36px; text-align: center; color: var(--muted); }

/* ----- Local Marketing Audit ----- */
