:root {
  --bg: #fafaf7;
  --surface: #ffffff;
  --border: rgba(0,0,0,0.08);
  --text: #1c1c1a;
  --muted: #6a6a66;
  --accent: #185FA5;
  --danger: #c23b22;
  --ok: #0F6E56;
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

/* App shell: sidebar + content */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 0.5px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  gap: 16px;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px;
}
.sidebar-brand .brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}
.sidebar-brand .brand-text { font-size: 15px; font-weight: 500; }

.sidebar-nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  cursor: pointer;
}
.nav-item:hover { background: #f1efe8; }
.nav-item.active { background: #e8eff6; color: var(--accent); font-weight: 500; }
.nav-item .nav-icon { font-size: 14px; line-height: 1; width: 16px; text-align: center; }
/* The hidden attribute must win over `.nav-item { display: flex }` above — without
   this, role-gated items (Affiliate Reports, Admin) stay visible to non-admins. */
.nav-item[hidden] { display: none; }

.content { flex: 1; min-width: 0; }

.view { display: none; }
.view.active { display: block; }

.empty-state {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 12px;
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
}
.empty-state p { margin: 0 0 6px; }

/* Google Analytics section */
.ga-intro { max-width: 720px; margin: 0 0 16px; }
.ga-filters { grid-template-columns: 2fr 1fr 1fr 1fr auto; }
.ga-run-btn {
  padding: 7px 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}
.ga-run-btn:hover { filter: brightness(1.05); }
.ga-run-btn:disabled { background: #a7a7a2; cursor: not-allowed; }
.ga-cards { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.ga-total-card { grid-template-columns: minmax(220px, 300px); margin-bottom: 8px; }
.ga-breakdown-heading { font-size: 15px; font-weight: 500; margin: 16px 0 10px; color: var(--text); }
.ga-summary { max-width: 720px; margin-top: 4px; font-size: 13px; line-height: 1.6; }

@media (max-width: 760px) {
  .ga-filters { grid-template-columns: 1fr 1fr; }
  .ga-cards { grid-template-columns: 1fr 1fr; }
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 0.5px solid var(--border);
  background: var(--surface);
}
.topbar h1 { margin: 0; font-size: 18px; font-weight: 500; }
.topbar .meta { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.topbar button {
  background: transparent;
  border: 0.5px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
}
.topbar button:hover { background: #f1efe8; }

/* Full-width, fluid content that follows the monitor width. Tables fill the
   available space and only scroll when genuinely wider than the viewport. */
main { width: 100%; padding: 24px 28px; }

.filters {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 2fr;
  gap: 12px;
  align-items: end;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
}
.filter-group { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.filter-group label { font-size: 12px; color: var(--muted); }
.filter-group select,
.filter-group input[type="month"],
.filter-group input[type="file"] {
  padding: 6px 8px;
  border: 0.5px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  font-size: 13px;
  font-family: inherit;
  min-width: 0;
}
.filter-group select { min-width: 180px; }

/* Searchable affiliate combobox (replaces the plain <select>) */
.combo { position: relative; }
.combo-input {
  width: 100%;
  min-width: 180px;
  padding: 6px 24px 6px 8px;
  border: 0.5px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
}
.combo-input::placeholder { color: var(--muted); }
.combo-clear {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  border: none; background: transparent; color: var(--muted);
  font-size: 16px; line-height: 1; padding: 0 3px; cursor: pointer;
}
.combo-clear:hover { color: var(--text); }
.combo-list {
  /* wider than the input when labels need it, so the sales summary is not clipped */
  position: absolute; z-index: 30; left: 0; top: calc(100% + 4px);
  min-width: 100%; width: max-content; max-width: min(440px, 80vw);
  margin: 0; padding: 4px; list-style: none;
  max-height: 300px; overflow-y: auto;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.14);
}
.combo-opt {
  padding: 6px 8px; border-radius: 6px; font-size: 13px; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.combo-opt:hover, .combo-opt.is-active { background: #f1efe8; }
.combo-opt-all {
  font-weight: 600;
  border-bottom: 0.5px solid var(--border);
  margin-bottom: 2px; padding-bottom: 7px;
}
.combo-empty { padding: 8px; font-size: 12px; color: var(--muted); }
.upload-row { display: flex; gap: 6px; align-items: center; }
.upload-row input[type="file"] { flex: 1; min-width: 0; }
.upload-row button {
  padding: 6px 10px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.upload-row button:disabled { background: #a7a7a2; cursor: not-allowed; }
.hint { font-size: 11px; color: var(--muted); margin-top: 2px; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}
.card .label { font-size: 13px; color: var(--muted); }
.card .value { font-size: 24px; font-weight: 500; margin-top: 4px; }

.chart-block {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}
.chart-block h2 { margin: 0 0 12px; font-size: 16px; font-weight: 500; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--muted);
}
.legend .swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.legend .dash { display: inline-block; width: 18px; height: 2px; vertical-align: middle; margin-right: 6px; }

.chart-wrap { position: relative; width: 100%; height: 380px; }

@media (max-width: 760px) {
  .app { flex-direction: column; }
  .sidebar {
    width: auto;
    flex-direction: row;
    align-items: center;
    border-right: none;
    border-bottom: 0.5px solid var(--border);
    overflow-x: auto;
  }
  .sidebar-nav { flex-direction: row; }
  .sidebar-user { margin-top: 0; margin-left: auto; padding: 6px 8px; border-top: none; }
  .filters { grid-template-columns: 1fr 1fr; }
  .chart-wrap { height: 320px; }
  main { padding: 14px; }
  .topbar { padding: 12px 16px; }
  .topbar h1 { font-size: 16px; }
}

/* GA referral / organic / AI leaderboard */
.ga-leaderboard-block { margin-top: 28px; padding-top: 22px; border-top: 0.5px solid var(--border); }
.ga-leaderboard-block h2 { font-size: 16px; font-weight: 500; margin: 0 0 6px; }
.ga-internal-block { margin-top: 26px; padding-top: 18px; border-top: 0.5px dashed var(--border); }
.ga-internal-block h3 { font-size: 14px; font-weight: 500; margin: 0 0 6px; color: var(--muted); }
.ga-lb-filters { grid-template-columns: 1fr 1fr 1fr auto; }
.ga-lb-table-wrap { overflow-x: auto; margin-top: 12px; }
/* Full width: the table fills the available area (no empty gap). Few-column
   tables spread to use the whole width; many-column tables (GA4 with all columns)
   can't fit their nowrap cells so they overflow and the wrapper scrolls — with a
   scrollbar on both top and bottom to reach every column. No overflow:hidden so
   rows never get clipped. */
.ga-lb-table { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--surface); border: 0.5px solid var(--border); border-radius: 12px; }
.ga-lb-table th, .ga-lb-table td { padding: 9px 12px; text-align: left; border-bottom: 0.5px solid var(--border); white-space: nowrap; }
.ga-lb-table tbody tr:last-child td { border-bottom: none; }
.ga-lb-table thead th { color: var(--muted); font-weight: 500; font-size: 12px; }
.ga-lb-table th.num, .ga-lb-table td.num { text-align: right; }
.ga-lb-table tbody tr:hover { background: rgba(0,0,0,0.02); }
.ga-lb-table th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.ga-lb-table th.sortable:hover { color: var(--text); }
.ga-lb-table th.sortable.sort-asc::after { content: ' \25B2'; font-size: 9px; }
.ga-lb-table th.sortable.sort-desc::after { content: ' \25BC'; font-size: 9px; }
.ga-tr-total td { font-weight: 600; background: #f3f3ef; }
.ga-ta-table { font-size: 12px; }
.ga-ta-table th, .ga-ta-table td { padding: 8px 10px; }
/* Freeze the # and Source/medium columns so they stay visible when scrolling
   the GA4 row-data table right. Scoped to #ta-table-wrap so it never affects the
   other .ga-ta-table tables (e.g. the YouTube daily-detail table). */
#ta-table-wrap .ga-ta-table th:nth-child(1), #ta-table-wrap .ga-ta-table td:nth-child(1),
#ta-table-wrap .ga-ta-table th:nth-child(2), #ta-table-wrap .ga-ta-table td:nth-child(2) { position: sticky; background: var(--surface); z-index: 2; }
#ta-table-wrap .ga-ta-table th:nth-child(1), #ta-table-wrap .ga-ta-table td:nth-child(1) { left: 0; width: 46px; min-width: 46px; }
#ta-table-wrap .ga-ta-table th:nth-child(2), #ta-table-wrap .ga-ta-table td:nth-child(2) { left: 46px; box-shadow: 1px 0 0 var(--border); }
#ta-table-wrap .ga-ta-table thead th:nth-child(1), #ta-table-wrap .ga-ta-table thead th:nth-child(2) { z-index: 3; }
#ta-table-wrap .ga-ta-table .ga-tr-total td:nth-child(1), #ta-table-wrap .ga-ta-table .ga-tr-total td:nth-child(2) { background: #f3f3ef; }
#ta-table-wrap .ga-ta-table tbody tr:hover td:nth-child(1), #ta-table-wrap .ga-ta-table tbody tr:hover td:nth-child(2) { background: #f6f6f2; }
.ga-ta-toolbar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.ga-presets { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.ga-presets button { font-size: 12px; padding: 6px 11px; border: 0.5px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); cursor: pointer; }
.ga-presets button:hover { background: #f1efe8; }
.ga-presets button.active { background: #e8eff6; color: var(--accent); border-color: var(--accent); font-weight: 500; }
.ga-ta-fields { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ga-ta-fields label { font-size: 12px; color: var(--muted); }
.ga-ta-fields input[type="date"] { padding: 6px 8px; border: 0.5px solid var(--border); border-radius: 8px; background: var(--surface); font: inherit; }
.ga-coltoggle { position: relative; display: inline-block; }
.ga-colbtn { font-size: 12px; padding: 7px 11px; border: 0.5px solid var(--border); border-radius: 8px; background: var(--surface); cursor: pointer; }
.ga-colbtn:hover { background: #f1efe8; }
.ga-colmenu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; width: 250px; max-height: 340px; overflow-y: auto; padding: 8px; background: var(--surface); border: 0.5px solid var(--border); border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,0.14); }
.ga-colmenu label { display: flex; align-items: center; gap: 8px; padding: 5px 6px; font-size: 13px; border-radius: 6px; cursor: pointer; }
.ga-colmenu label:hover { background: #f1efe8; }
.ga-colmenu-actions { display: flex; gap: 14px; padding: 2px 6px 8px; margin-bottom: 6px; border-bottom: 0.5px solid var(--border); }
.ga-colmenu-actions a { font-size: 12px; color: var(--accent); cursor: pointer; }
.ga-colmenu-actions a:hover { text-decoration: underline; }
.ga-scroll-top { overflow-x: auto; overflow-y: hidden; }
#ta-scroll-top-inner, .ga-scroll-top-inner { height: 1px; }
/* Clearly-visible horizontal scrollbars on the table wrappers (bottom) and the
   synced top bars (top), so wide tables are obviously scrollable. */
.ga-lb-table-wrap, .ga-scroll-top { scrollbar-width: thin; scrollbar-color: #c2c2bd transparent; }
.ga-lb-table-wrap::-webkit-scrollbar, .ga-scroll-top::-webkit-scrollbar { height: 12px; }
.ga-lb-table-wrap::-webkit-scrollbar-track, .ga-scroll-top::-webkit-scrollbar-track { background: transparent; }
.ga-lb-table-wrap::-webkit-scrollbar-thumb, .ga-scroll-top::-webkit-scrollbar-thumb { background: #c2c2bd; border-radius: 6px; }
.ga-lb-table-wrap::-webkit-scrollbar-thumb:hover, .ga-scroll-top::-webkit-scrollbar-thumb:hover { background: #a8a8a2; }
.yt-landing-input { min-width: 230px; padding: 6px 8px; border: 0.5px solid var(--border); border-radius: 8px; background: var(--surface); font: inherit; }
.yt-land-row { cursor: pointer; }
.yt-land-row:hover { background: #f1efe8; }
.sidebar-user { margin-top: auto; padding: 12px; border-top: 0.5px solid var(--border); }
.su-name { font-size: 12px; color: var(--muted); margin-bottom: 6px; word-break: break-word; }
.su-logout { width: 100%; padding: 7px; border: 0.5px solid var(--border); border-radius: 8px; background: var(--surface); cursor: pointer; font: inherit; font-size: 12px; }
.su-logout:hover { background: #f1efe8; }
.admin-acts { white-space: nowrap; }
.admin-acts button { font-size: 11px; padding: 4px 8px; margin: 2px 1px; border: 0.5px solid var(--border); border-radius: 7px; background: var(--surface); cursor: pointer; }
.admin-acts button:hover { background: #f1efe8; }
.admin-acts button.danger { color: var(--danger); border-color: #e2b9b0; }
#admin-refresh { padding: 6px 12px; border: 0.5px solid var(--border); border-radius: 8px; background: var(--surface); cursor: pointer; font: inherit; }
.ga-account-box { margin-top: 22px; max-width: 460px; }
.ga-account-fields { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.ga-account-fields input { width: 100%; max-width: 320px; padding: 9px 11px; border: 0.5px solid var(--border); border-radius: 9px; background: var(--surface); font: inherit; }
.ga-tag { display: inline-block; font-size: 11px; line-height: 1.4; padding: 2px 8px; border-radius: 10px; background: #efefea; color: var(--muted); white-space: nowrap; }
.ga-tag-referral { background: #e6f0fb; color: #185FA5; }
.ga-tag-AI { background: #ece4fb; color: #6b3fb0; }
.ga-tag-search { background: #e3f4ec; color: #0F6E56; }
.ga-tag-social { background: #fce9f3; color: #a8348a; }
.ga-tag-email { background: #fdf0df; color: #97600f; }
.ga-tag-paid { background: #f0f0ec; color: #6a6a66; }
@media (max-width: 760px) {
  .ga-lb-filters { grid-template-columns: 1fr 1fr; }
}

/* Funnel drop-off */
.fn-steps { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.fn-step-bar-track { background: #eef1f4; border-radius: 6px; height: 26px; overflow: hidden; }
.fn-step-bar { background: linear-gradient(90deg, #185FA5, #2b7cc9); height: 100%; border-radius: 6px; min-width: 2px; transition: width .3s; }
.fn-step-missing .fn-step-bar-track { background: repeating-linear-gradient(45deg, #f3f0ea, #f3f0ea 6px, #ece8e0 6px, #ece8e0 12px); }
.fn-step-meta { display: flex; align-items: baseline; gap: 10px; font-size: 13px; flex-wrap: wrap; margin-top: 4px; }
.fn-step-name { font-weight: 600; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.fn-step-rate { color: var(--muted); }
.fn-drop { color: var(--danger); }
.fn-step-missing-tag { color: var(--danger); font-style: italic; }
.fn-ba { display: flex; flex-direction: column; gap: 8px; }
.fn-ba-card { border: 0.5px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--surface); }
.fn-ba-date { font-weight: 600; margin-bottom: 4px; }
.fn-ba-rates { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13px; }
.fn-ba-arrow { color: var(--muted); }
.fn-ba-delta { margin-left: auto; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: #eef1f4; }
.fn-ba-delta.fn-bad { background: rgba(194, 59, 34, 0.12); color: #b3361f; }
.fn-ba-delta.fn-good { background: rgba(33, 128, 80, 0.12); color: #218050; }
.fn-deploykey { color: var(--danger); }

/* Billing funnel */
.bf-breakdown { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.bf-chip { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: #eef1f4; color: var(--text); font-weight: 500; }
.bf-chip-good { background: rgba(33, 128, 80, 0.12); color: #218050; }
.bf-chip-bad { background: rgba(194, 59, 34, 0.12); color: #b3361f; }
.bf-chip-mute { background: #f0f0ec; color: #6a6a66; }
.bf-chip-rev { background: #e6f0fb; color: #185FA5; }
.bf-syncbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; padding-top: 14px; border-top: 0.5px dashed var(--border); }
.bf-syncbar .ga-run-btn { flex: 0 0 auto; }
.bf-src { font-size: 11px; color: var(--muted); }
.bf-steptag { font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); border: 0.5px solid var(--border); border-radius: 4px; padding: 0 5px; margin-left: 4px; }
.bf-ba-label { min-width: 160px; font-weight: 500; color: var(--muted); }

/* "How to read this" callout */
.howto { background: #f4f7fb; border: 0.5px solid var(--border); border-left: 3px solid var(--accent); border-radius: 8px; padding: 11px 16px; margin: 0 0 16px; max-width: 760px; }
.howto-title { display: block; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--accent); margin-bottom: 6px; }
.howto ul { margin: 0; padding-left: 18px; }
.howto li { font-size: 13px; line-height: 1.55; color: var(--text); margin: 3px 0; }
.bf-mom-delta { font-size: 11px; font-weight: 600; margin-left: 4px; white-space: nowrap; }
.bf-mom-delta.fn-good { color: #218050; }
.bf-mom-delta.fn-bad { color: #b3361f; }

/* ── Cross Check Sales ────────────────────────────────────────────────────── */
.cc-boxes { display: grid; grid-template-columns: repeat(3, minmax(160px, 1fr)); gap: 12px; max-width: 780px; margin-top: 10px; }
.cc-boxes label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); font-weight: 500; }
.cc-boxes input { padding: 9px 11px; border: 0.5px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--text); font-size: 14px; font-variant-numeric: tabular-nums; }
.cc-boxes input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.cc-verdict { margin-top: 14px; padding: 10px 14px; border-radius: 10px; font-size: 14px; }
.cc-verdict.dup { background: #fbe9e5; color: #8f2a12; border: 0.5px solid #eac2b8; }
.cc-verdict.ok { background: #e3f4ec; color: #0F6E56; border: 0.5px solid #bfe3d2; }
.cc-verdict.none { background: #f1f1ec; color: var(--muted); border: 0.5px solid var(--border); }
.cc-anchor { margin-top: 10px; padding: 10px 14px; background: var(--surface); border: 0.5px solid var(--border); border-radius: 10px; font-size: 13px; }
.cc-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 12px; }
.cc-col { background: var(--surface); border: 0.5px solid var(--border); border-radius: 12px; padding: 12px 14px; min-width: 0; }
.cc-col h4 { margin: 0 0 8px; font-size: 13px; font-weight: 600; }
.cc-count { display: inline-block; min-width: 18px; text-align: center; background: #efefea; border-radius: 9px; font-size: 11px; padding: 1px 6px; color: var(--muted); }
.cc-row { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; padding: 6px 0; border-bottom: 0.5px dashed var(--border); flex-wrap: wrap; }
.cc-row:last-child { border-bottom: none; }
.cc-chip { display: inline-block; font-size: 10.5px; line-height: 1.4; padding: 1px 7px; border-radius: 9px; background: #efefea; color: var(--muted); white-space: nowrap; }
.cc-approved, .cc-cleared { background: #e3f4ec; color: #0F6E56; }
.cc-pending { background: #fdf3dd; color: #8a6116; }
.cc-declined, .cc-deleted, .cc-reversed, .cc-refunded, .cc-chargeback { background: #fbe9e5; color: #8f2a12; }
.cc-net-awin { background: #e6f0fb; color: #185FA5; }
.cc-net-impact { background: #ece4fb; color: #6b3fb0; }
.cc-net-pap, .cc-net-pap-client { background: #e3f4ec; color: #0F6E56; }
.cc-h3 { margin: 18px 0 4px; font-size: 15px; }
.cc-ghost-btn { padding: 8px 14px; border: 0.5px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--text); font-size: 13px; cursor: pointer; }
.cc-ghost-btn:hover { border-color: var(--accent); color: var(--accent); }
.cc-ghost-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.cc-syncbtns { display: flex; gap: 8px; align-items: center; }
@media (max-width: 900px) { .cc-boxes, .cc-cols { grid-template-columns: 1fr; } }
.cc-anchor-sub { margin-top: 6px; padding-top: 6px; border-top: 0.5px dashed var(--border); font-size: 13px; }

/* Compact filter toolbars above the YouTube GA4 tables */
.yt-tools {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  margin: 8px 0 10px; font-size: 12px; color: var(--muted);
}
.yt-tools label { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.yt-tools select,
.yt-tools input[type="search"] {
  padding: 4px 7px; border: 0.5px solid var(--border); border-radius: 6px;
  background: var(--surface); color: var(--text); font-family: inherit; font-size: 12px;
}
.yt-tools input[type="search"] { min-width: 210px; }
.yt-tools .yt-check { gap: 6px; }
.yt-tools .yt-check input { margin: 0; }
.yt-tools .yt-count { margin-left: auto; font-variant-numeric: tabular-nums; }
.yt-group-note { margin: -4px 0 10px; }
@media (max-width: 760px) {
  .yt-tools .yt-count { margin-left: 0; width: 100%; }
  .yt-tools input[type="search"] { min-width: 0; flex: 1; }
}

/* Fraud Monitoring tab strip + PPC Violations report */
.fm-tabs { display: flex; gap: 4px; margin: 4px 0 14px; border-bottom: 1px solid var(--border); }
.fm-tab {
  appearance: none; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 13px; color: var(--muted);
  padding: 8px 14px; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.fm-tab:hover { color: var(--text); }
.fm-tab.is-active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

.fm-block {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; background: var(--surface); margin-bottom: 14px;
}
.ppc-kpis { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.ppc-kpi {
  flex: 1 1 130px; min-width: 130px;
  border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; background: var(--surface);
}
.ppc-kpi-v { font-size: 19px; font-weight: 650; letter-spacing: -0.2px; }
.ppc-kpi-l { font-size: 11px; color: var(--muted); margin-top: 2px; }
.ppc-table td { vertical-align: top; }
.ppc-table code { font-size: 11.5px; background: #f1efe8; padding: 1px 4px; border-radius: 4px; }
.ppc-table select { font: inherit; font-size: 12px; padding: 3px 5px; border: 0.5px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); }

/* Current / Archived switch inside the PPC Violations report */
.ppc-tabs { display: flex; gap: 6px; margin: 4px 0 10px; }
.ppc-tab {
  appearance: none; cursor: pointer; font: inherit; font-size: 12.5px;
  padding: 5px 12px; border-radius: 999px;
  border: 0.5px solid var(--border); background: var(--surface); color: var(--muted);
}
.ppc-tab:hover { color: var(--text); }
.ppc-tab.is-active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.ppc-tab .ppc-tab-n { opacity: .75; margin-left: 4px; font-variant-numeric: tabular-nums; }

.ppc-table th, .ppc-table td { padding-right: 14px; }
.ppc-table td + td { border-left: 0; }
