/* creator-reports-module.css — Creator Army report (creator-reports-module.js).
   Token-driven (var(--rr-*)). One accent per screen: the pink token marks data
   (chart bars, funnel bars); text stays in text tokens. Phone first: at 390px
   nothing scrolls sideways — the creators table turns into stacked rows. */

.cr-section { padding: 4px 2px 40px; }
.cr-section .rr-page-actions { flex-wrap: wrap; }
.cr-linkbtn { text-decoration: none; }
.cr-muted { color: var(--rr-text-muted); }
.cr-center { display: flex; justify-content: center; padding: 8px 0 18px; }
.cr-error { color: var(--rr-danger); font-size: 13px; margin: 6px 0 10px; }
.cr-body { transition: opacity .2s var(--rr-ease, ease); }
.cr-body-loading { opacity: 0.55; pointer-events: none; }

/* controls: one row above everything they scope */
.cr-controls { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin: 0 0 10px; }
.cr-field { display: flex; flex-direction: column; gap: 5px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--rr-text-muted); min-width: 0; }
.cr-field select, .cr-field input { background: rgba(0,0,0,0.3); border: 1px solid var(--rr-border); border-radius: 10px; padding: 9px 11px; color: var(--rr-text); font-family: inherit; font-size: 13.5px; letter-spacing: 0; text-transform: none; min-width: 0; max-width: 100%; }
.cr-field select:focus, .cr-field input:focus { outline: none; border-color: var(--rr-cyan); }
.cr-pinned { font-size: 13.5px; color: var(--rr-text); letter-spacing: 0; text-transform: none; padding: 9px 0; }
.cr-custom { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin: 0 0 10px; }
.cr-custom .cr-error { flex-basis: 100%; margin: 0; }
.cr-scope { font-size: 12px; color: var(--rr-text-muted); margin: 4px 0 14px; }

/* sections */
.cr-sec { margin-bottom: 18px; }
.cr-sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 0 8px; }
.cr-sec-h h2 { font-size: 13px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--rr-text-dim); }
.cr-sec-sub { font-size: 12.5px; color: var(--rr-text-muted); margin: -4px 0 12px; }
.cr-h3 { font-size: 12px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--rr-text-muted); margin: 18px 0 8px; }
.cr-foot { font-size: 12.5px; color: var(--rr-text-muted); margin-top: 10px; line-height: 1.5; }
.cr-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 14px; }
.cr-stats .rr-stat { background: rgba(0,0,0,0.18); border: 1px solid var(--rr-inner, rgba(255,255,255,0.06)); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.cr-stats .rr-stat-num { font-size: 24px; }

/* needs attention */
.cr-attn { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.cr-attn li { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--rr-border); }
.cr-attn li:last-child { border-bottom: none; }
.cr-attn-n { font-family: 'JetBrains Mono', monospace; font-size: 20px; font-weight: 700; color: var(--rr-text); overflow-wrap: anywhere; }
.cr-attn-l { font-size: 14px; }
.cr-attn-go { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.cr-ext { color: var(--rr-cyan); text-decoration: none; font-size: 13px; white-space: nowrap; }
.cr-ext:hover { text-decoration: underline; }
.cr-studio-links { font-size: 12.5px; color: var(--rr-text-muted); margin-top: 12px; line-height: 1.8; }

/* key/value rows */
.cr-kv { display: flex; flex-direction: column; margin: 0; }
.cr-kv > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--rr-border); font-size: 13.5px; }
.cr-kv > div:last-child { border-bottom: none; }
.cr-kv dt { color: var(--rr-text-muted); }
.cr-kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.cr-kv .cr-bad dd { color: var(--rr-danger); font-weight: 600; }
.cr-kv .cr-good dd { color: var(--rr-ok); font-weight: 600; }
.cr-kv .cr-warnrow dd { color: var(--rr-warn); font-weight: 600; }
.cr-notice { background: rgba(255,194,75,0.10); border: 1px solid rgba(255,194,75,0.35); color: var(--rr-text); border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-bottom: 10px; }

/* funnel bars (one series, one color) */
.cr-funnel { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.cr-funnel-l { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.cr-funnel-l b { font-family: 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums; }
.cr-funnel-track { height: 10px; border-radius: 0 4px 4px 0; background: rgba(255,255,255,0.06); margin-top: 6px; overflow: hidden; }
.cr-funnel-track i { display: block; height: 100%; background: var(--rr-pink); border-radius: 0 4px 4px 0; min-width: 0; }
.cr-funnel-d { font-size: 11.5px; color: var(--rr-text-muted); margin-top: 4px; }

/* drinks-by-day chart: inline SVG drawn to scale. The plot column never grows
   past the 640-unit viewBox, so a bar's 24 units are never more than 24px. */
.cr-chart { margin: 4px 0 6px; }
.cr-chart-cap { font-size: 12px; color: var(--rr-text-muted); margin-bottom: 6px; }
.cr-chart-plot { display: grid; grid-template-columns: 30px minmax(0, 640px); column-gap: 8px; row-gap: 4px; }
.cr-y { position: relative; font-size: 11px; color: var(--rr-text-muted); font-variant-numeric: tabular-nums; }
.cr-y span { position: absolute; right: 0; transform: translateY(-50%); white-space: nowrap; }
.cr-chart-area { position: relative; min-width: 0; }
.cr-chart-svg { display: block; width: 100%; height: auto; overflow: visible; }
.cr-grid, .cr-axis { stroke: rgba(255,255,255,0.12); stroke-width: 1; }
.cr-axis { stroke: rgba(255,255,255,0.22); }
.cr-hit { fill: transparent; }
.cr-bar-fill { fill: var(--rr-pink); }
.cr-bar.is-hover .cr-bar-fill { fill: var(--rr-light-pink); }
.cr-bar.is-hover .cr-hit { fill: rgba(255,255,255,0.04); }
.cr-tip { position: absolute; top: -6px; transform: translate(-50%, -100%); background: rgba(20,4,34,0.95); border: 1px solid var(--rr-border); border-radius: 8px; padding: 6px 9px; font-size: 12px; white-space: nowrap; pointer-events: none; box-shadow: var(--rr-shadow-soft, 0 4px 16px rgba(0,0,0,0.25)); z-index: 2; }
.cr-tip[hidden] { display: none; }
.cr-tip b { display: block; font-size: 13px; color: var(--rr-text); }
.cr-tip span { color: var(--rr-text-muted); }
.cr-x-row { position: relative; height: 18px; font-size: 11px; color: var(--rr-text-muted); }
.cr-x { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.cr-x-first { left: 0 !important; transform: none; }
.cr-x-last { left: auto !important; right: 0; transform: none; }
.cr-table-view { margin: 8px 0 4px; font-size: 12.5px; color: var(--rr-text-muted); }
.cr-table-view summary { cursor: pointer; color: var(--rr-cyan); }
.cr-mini { border-collapse: collapse; margin-top: 8px; font-variant-numeric: tabular-nums; }
.cr-mini th, .cr-mini td { padding: 3px 14px 3px 0; text-align: left; border-bottom: 1px solid var(--rr-border); }

/* invoice periods */
.cr-periods { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.cr-periods li { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 8px 0; border-bottom: 1px solid var(--rr-border); font-size: 13px; }
.cr-periods li:last-child { border-bottom: none; }
.cr-periods li .cr-muted { flex-basis: 100%; font-size: 12px; }

/* creators table */
.cr-table-tools { display: flex; gap: 10px; align-items: flex-end; justify-content: flex-end; flex-wrap: wrap; margin-bottom: 10px; }
.cr-sort-mobile { display: none; }
.cr-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.cr-table th { text-align: left; font-weight: 600; border-bottom: 1px solid var(--rr-border); padding: 0; white-space: nowrap; }
.cr-table th button { background: none; border: none; color: var(--rr-text-muted); font: inherit; font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; padding: 8px 8px 8px 0; cursor: pointer; }
.cr-table th[aria-sort="ascending"] button, .cr-table th[aria-sort="descending"] button { color: var(--rr-text); }
.cr-table th button:focus-visible { outline: 2px solid var(--rr-cyan); outline-offset: 2px; }
.cr-table td { padding: 9px 8px 9px 0; border-bottom: 1px solid var(--rr-border); }
.cr-table tr:last-child td { border-bottom: none; }
.cr-td-num, .cr-td-pct, .cr-td-money, .cr-th-num, .cr-th-pct, .cr-th-money { text-align: right; font-variant-numeric: tabular-nums; }
.cr-th-num button, .cr-th-pct button, .cr-th-money button { padding: 8px 0 8px 8px; }
.cr-td-text:first-child { font-weight: 600; }

@media (max-width: 900px) {
  .cr-table { font-size: 12.5px; }
}
@media (max-width: 700px) {
  .cr-sort-mobile { display: flex; }
  .cr-table-tools { justify-content: space-between; }
  .cr-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .cr-table, .cr-table tbody, .cr-table tr, .cr-table td { display: block; width: 100%; }
  .cr-table tr { border: 1px solid var(--rr-border); border-radius: 10px; padding: 6px 10px; margin-bottom: 8px; }
  .cr-table td { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: none; text-align: right; }
  .cr-table td::before { content: attr(data-label); color: var(--rr-text-muted); text-align: left; }
  .cr-table td:first-child { font-size: 14px; }
}
@media (max-width: 600px) {
  .cr-section .rr-page-actions .rr-btn { flex: 1 1 auto; }
  .cr-controls .cr-field { flex: 1 1 100%; }
  .cr-custom .cr-field { flex: 1 1 140px; }
  .cr-custom .rr-btn { flex: 1 1 100%; }
  .cr-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cr-attn li { grid-template-columns: 52px minmax(0, 1fr); }
  .cr-attn-go { grid-column: 1 / -1; justify-content: flex-start; }
}
