/* Referrals app (sellers). Buttons, colours and fonts are the shared Danti ones; card accents are the Danti chart
   palette (Constants/ChartColours.js) with dark text on them. The chart rules are the ones Reports.css gives the
   shared ReportCharts.js. */
@font-face { font-family: "App-Medium"; src: url("/fonts/Nunito-Medium.ttf"); }
@font-face { font-family: "App-Regular"; src: url("/fonts/Nunito-Light.ttf"); }

.ref-login-note { margin: 6px 0 18px; font-size: 13px; color: #5b6770; }
.ref-login-notice { margin: 0 0 14px; padding: 8px 10px; border-radius: 8px; font-size: 13px; background: #ffaaaa; color: #1f2a30; } /* palette red, dark text */
.ref-login-notice[hidden] { display: none; }

.ref-body { margin: 0; min-height: 100vh; background: #fafafa; color: #1f2a30; font-family: App-Medium, App-Regular, system-ui, sans-serif; }
.ref-body * { box-sizing: border-box; }
.ref-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; background: #113F57; color: #fff; }
.ref-brand { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.ref-brand-name { font-size: 20px; font-weight: 700; }
.ref-brand-role { font-size: 12px; padding: 3px 10px; border-radius: 12px; background: #ffea9f; color: #1f2a30; white-space: nowrap; }
.ref-top-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ref-user { font-size: 13px; opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 45vw; }
.ref-top .btn-outline { background: #fff; }

.ref-main { max-width: 1100px; margin: 0 auto; padding: 16px 16px 40px; }
.ref-state { padding: 40px 12px 12px; text-align: center; color: #5b6770; }
.ref-state[hidden] { display: none; }
#retryId { display: block; margin: 0 auto; }
#retryId[hidden] { display: none; }
.ref-sub { display: block; font-size: 12px; color: #5b6770; font-weight: 400; }
.ref-note { margin: 0 0 14px; font-size: 13px; color: #5b6770; }
.ref-note[hidden] { display: none; }
.ref-empty { padding: 24px 12px; text-align: center; color: #5b6770; }
.ref-empty[hidden] { display: none; }

.ref-code { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; margin-bottom: 14px; background: #fff; border: 1px solid #e6eaec; border-radius: 12px; }
.ref-code-label { display: block; font-size: 12px; color: #5b6770; }
.ref-link-text { display: block; margin-top: 4px; font-size: 12px; color: #076A89; overflow-wrap: anywhere; user-select: all; }
.ref-code > div { min-width: 0; }
.ref-code-value { display: block; font-size: 22px; letter-spacing: 1px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.ref-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 10px; }
.ref-card { border-radius: 12px; padding: 12px 14px; color: #1f2a30; min-width: 0; }
.ref-card-label { font-size: 12px; }
.ref-card-value { font-size: 24px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ref-card-sub { font-size: 12px; margin-top: 2px; opacity: .85; }

.ref-panel { background: #fff; border: 1px solid #e6eaec; border-radius: 12px; padding: 14px; margin-bottom: 14px; }
.ref-panel[hidden] { display: none; }
.ref-panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.ref-panel-head h2 { margin: 0; font-size: 17px; }
.ref-filter { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #5b6770; }
.ref-select { height: 32px; padding: 0 8px; border: 1px solid #d5dbdf; border-radius: 8px; font: inherit; font-size: 13px; color: #1f2a30; background: #fff; }

.ref-table-wrap { overflow-x: auto; }
.ref-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ref-table[hidden] { display: none; }
.ref-table th { text-align: left; font-weight: 700; font-size: 12px; color: #5b6770; padding: 8px 10px; white-space: nowrap; border-bottom: 1px solid #e6eaec; }
.ref-table td { padding: 9px 10px; border-bottom: 1px solid #f0f3f4; vertical-align: top; }
.ref-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ref-table tr.is-selected { background: #e6f3f6; box-shadow: inset 3px 0 0 #076A89; }
.ref-link { all: unset; cursor: pointer; color: #076A89; text-decoration: underline; text-underline-offset: 2px; text-transform: capitalize; }
.ref-link:focus-visible { outline: 2px solid #076A89; outline-offset: 2px; border-radius: 4px; }

/* Status: colour AND words (never colour alone). Fills are the Danti chart palette, text stays dark. */
.ref-pill { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 12px; white-space: nowrap; color: #1f2a30; }
.ref-pill-pending { background: #ffea9f; }
.ref-pill-earned { background: #b9d6d1; }
.ref-pill-paid { background: #adcf87; }
.ref-pill-partly { background: #cecf87; }
.ref-pill-cancelled { background: #9aa3a8; }

.ref-pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 10px; }
.ref-pager[hidden] { display: none; }

/* Shared bar chart (Pages/Modules/Reports/ReportCharts.js) */
.ref-body { --chart-bar: #75a0ff; --chart-grid: #ececec; --chart-axis: #8a8a8a; }
.chart-box { position: relative; }
.chart-box[hidden] { display: none; }
.bars-box { margin: 4px 0 10px; width: 100%; }
.chart-box svg { display: block; max-width: 100%; height: auto; }
.bars-split { display: flex; align-items: flex-start; width: 100%; }
.bars-split .bars-yaxis { flex: 0 0 auto; }
.bars-scroll { flex: 1 1 auto; min-width: 0; overflow-x: auto; overflow-y: hidden; padding-bottom: 6px; outline: none; scrollbar-width: thin; scrollbar-color: #c4c4c4 transparent; }
.chart-box .bars-scroll svg { max-width: none; }
.bars-grid { stroke: var(--chart-grid); stroke-width: 1; }
.bars-baseline { stroke: #cfcfcf; stroke-width: 1; }
.bars-axis { font-family: App-Regular, system-ui, sans-serif; font-size: 11px; fill: var(--chart-axis); }
.bars-hit { cursor: pointer; outline: none; }
.bars-hit:hover, .bars-hit:focus-visible { fill: rgba(7, 106, 137, 0.06); }
.chart-tooltip { display: none; position: absolute; z-index: 5; pointer-events: none; padding: 6px 10px; border-radius: 8px; background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .18); font-size: 12px; white-space: nowrap; }
.chart-tooltip-title { font-family: App-Medium, system-ui, sans-serif; color: #3B3B3B; }
.chart-tooltip-line { color: #6B6B6B; font-variant-numeric: tabular-nums; }

@media (max-width: 760px) {
  .ref-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ref-card-value { font-size: 20px; }
  .ref-main { padding: 12px 10px 32px; }
}
@media (max-width: 420px) {
  .ref-cards { grid-template-columns: 1fr; }
  .ref-code { flex-direction: column; align-items: flex-start; }
}
