﻿/* ==========================================================================
   Admin · Reports (2026-12-03): Detailed Transaction, Net Gross Statement, Balance Track, Balance Track with
   Dr & Cr, Consolidate Sales. Builds on employee-list.css (ev-*), manage-access.css (ma-*) and action.css (ac-*).
   Tokens only.
   ========================================================================== */

/* ---- Report switcher (the four account reports share one live page) ---- */
.rp-switch { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-top: 18px; padding: 4px; border-radius: var(--tb-radius-control); background: var(--tb-ice); }
.rp-switch__item { display: inline-flex; align-items: baseline; gap: 6px; padding: 8px 14px; border-radius: calc(var(--tb-radius-control) - 2px); font-size: 14px; font-weight: 500; color: var(--tb-text-neutral); text-decoration: none; }
.rp-switch__item:hover { color: var(--tb-primary); background: var(--tb-ice-2); }
.rp-switch__item.is-active { background: var(--tb-surface); color: var(--tb-primary); font-weight: 600; box-shadow: 0 1px 2px rgba(11, 31, 58, .08); }
.rp-switch__item:focus-visible { outline: 2px solid var(--tb-royal); outline-offset: 2px; }
.rp-switch__note { font-size: 11.5px; font-weight: 500; color: var(--tb-text-muted); }
.rp .rp-switch + .ev-filters { margin-top: 12px; }

/* ---- Filters: one row on a wide screen ---- */
.rp-filters__grid { display: grid; grid-template-columns: minmax(0, 180px) minmax(0, 180px) minmax(0, 1fr) auto; gap: 16px; align-items: end; }
.rp-filters__grid--cs { grid-template-columns: minmax(0, 170px) minmax(0, 170px) minmax(0, 1fr) minmax(0, 180px); }
.rp-filters__grid--cs .rp-filters__actions { grid-column: 1 / -1; padding-top: 14px; border-top: 1px solid var(--tb-bg); }
.rp-filters__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.rp-filters .tb-field[hidden] { display: none; }

/* ---- Key figures: the live Total row, read before the table ---- */
.rp-figures { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; margin: 0 0 16px; padding: 18px 24px; }
.rp-figures__ctx { flex: 1 1 200px; min-width: 0; }
.rp-figures__eyebrow { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--tb-royal); }
.rp-figures__who { margin: 4px 0 0; font-size: 15px; font-weight: 600; color: var(--tb-text-strong); overflow-wrap: anywhere; }
.rp-figures__list { display: flex; flex-wrap: wrap; gap: 12px 0; margin: 0; }
.rp-figures__list > div { padding: 0 28px; border-left: 1px solid var(--tb-border); }
.rp-figures__list dt { font-size: 12px; font-weight: 600; color: var(--tb-text-muted); }
.rp-figures__list dd { margin: 4px 0 0; font-size: 20px; font-weight: 700; color: var(--tb-text-strong); white-space: nowrap; }
.rp-figures__list .rp-figures__key dd { color: var(--tb-primary); }
.rp-figures__sub { display: block; margin-top: 2px; font-size: 12px; font-weight: 500; color: var(--tb-text-muted); white-space: normal; }
.rp .rp-cr { color: var(--tb-success); }
.rp .rp-neg { color: var(--tb-danger-ink); }
.rp-export { gap: 6px; margin-left: 4px; }

/* ---- Tables ---- */
.rp .rp-table td { vertical-align: top; }
.rp .rp-table td.ma-r, .rp .rp-table th.ma-r { text-align: right; }
.rp .rp-zero { color: var(--tb-text-muted); }
.rp .rp-type { display: inline-block; padding: 2px 9px; border-radius: var(--tb-radius-pill); background: var(--tb-ice); font-size: 12.5px; font-weight: 600; color: var(--tb-primary); white-space: nowrap; }
.rp .rp-type--cr { background: var(--tb-success-soft); color: var(--tb-success); }
.rp .rp-clip { display: block; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp .rp-clip--wide { max-width: 280px; }
.rp .rp-pax { min-width: 160px; white-space: normal; }
/* Net gross: ten columns, kept within a 1440 screen */
.rp .rp-table--rpth th:not(:first-child), .rp .rp-table--rpth td:not(:first-child) { padding-left: 9px; padding-right: 9px; }
.rp .rp-table--rpth .rp-type { padding: 2px 7px; font-size: 12px; }
.rp .rp-pax .ev-by { display: block; margin-top: 2px; white-space: normal; }

/* Detailed transaction: the live Description, laid out (wraps: beats manage-access.css's nowrap cells) */
html body .rp .rp-table td.rp-desc, html body .rp .rp-table td.rp-pax { white-space: normal; }
.rp .rp-desc { min-width: 300px; }
.rp-desc__pax { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; }
.rp-desc__parts { display: flex; flex-wrap: wrap; gap: 2px 14px; margin: 6px 0 0; font-size: 12.5px; color: var(--tb-text-muted); }
.rp-desc__parts b { font-weight: 600; color: var(--tb-text-neutral); }
.rp-desc__parts--add { margin-top: 3px; }
.rp-desc__parts--add span::before { content: "+ "; color: var(--tb-text-muted); }

/* Total row (live's last row) */
.rp .rp-table tfoot th, .rp .rp-table tfoot td { padding: 14px 12px; border-top: 2px solid var(--tb-border); background: var(--tb-ice); font-weight: 700; color: var(--tb-primary); white-space: nowrap; }
.rp .rp-table tfoot th { padding-left: 24px; text-align: left; font-size: 13px; }
.rp-total-note { margin: 0; padding: 10px 24px; font-size: 12.5px; color: var(--tb-text-muted); }

/* ---- Consolidate sales ---- */
.rp-state { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 16px; padding: 48px 20px; text-align: center; }
.rp-hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 16px; padding: 22px 26px; }
.rp-hero__flow { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px 40px; }
.rp-hero__label { margin: 0; font-size: 13px; font-weight: 600; color: var(--tb-text-muted); }
.rp-hero__value { margin: 4px 0 0; font-size: var(--tb-fs-hero-num, 36px); font-weight: 700; line-height: 1.1; color: var(--tb-primary); letter-spacing: -.01em; }
.rp-hero__sub { margin: 6px 0 0; font-size: 13px; color: var(--tb-text-muted); }
.rp-hero__parts { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin: 0; }
.rp-hero__part { padding: 12px 16px; border-radius: var(--tb-radius-control); background: var(--tb-surface-muted); }
.rp-hero__part dt { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--tb-text-muted); }
.rp-hero__part dd { margin: 3px 0 0; font-size: 17px; font-weight: 700; color: var(--tb-text-strong); }
.rp-hero__op { font-size: 20px; font-weight: 600; color: var(--tb-text-muted); }
.rp-dot { width: 8px; height: 8px; border-radius: 50%; }
.rp-dot--sales { background: var(--tb-success); }
.rp-dot--cancel { background: var(--tb-danger); }

.rp-section { margin-top: 22px; }
.rp-st { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: var(--tb-radius-pill); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.rp-st::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.rp-st--sales { background: var(--tb-success-soft); color: var(--tb-success); }
.rp-st--cancel { background: var(--tb-danger-soft); color: var(--tb-danger-ink); }
.rp-st--net { background: var(--tb-ice); color: var(--tb-primary); }
.rp .rp-sum tbody th { padding: 14px 12px 14px 24px; border-bottom: 1px solid var(--tb-bg); text-align: left; background: var(--tb-surface); }
.rp .rp-sum .rp-sum__net th, .rp .rp-sum .rp-sum__net td { font-weight: 700; color: var(--tb-primary); background: var(--tb-surface-muted); }
.rp .rp-bd tbody th.rp-bd__name { padding: 14px 10px 14px 24px; border-bottom: 1px solid var(--tb-bg); text-align: left; font-size: 14px; font-weight: 600; color: var(--tb-text-strong); background: var(--tb-surface); white-space: nowrap; }
.rp .rp-sum tbody th { font-size: 14px; }
/* Airline: twelve live columns, kept within a 1440 screen */
.rp .rp-bd th:not(:first-child), .rp .rp-bd td { padding-left: 8px; padding-right: 8px; }
.rp .rp-bd tr[hidden] { display: none; }

.rp-two { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; margin-top: 22px; }
.rp-card { padding: 18px 20px 20px; min-width: 0; }
.rp-card__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin-bottom: 14px; }
.rp-card__head .ac-card__title { margin: 0; }
.rp-card__note { margin: 0; font-size: 12.5px; color: var(--tb-text-muted); }

/* Net sales by month: columns in HTML so the labels stay readable at every width */
.rp-bars-wrap { position: relative; overflow-x: auto; scrollbar-width: thin; }   /* relative (2026-12-03): the months' screen-reader labels stay inside the scroll area, so a phone page doesn't scroll sideways */
.rp-bars-wrap:focus-visible { outline: 2px solid var(--tb-royal); outline-offset: 2px; border-radius: 4px; }
.rp-bars { --rp-h: 200px; display: grid; grid-template-columns: repeat(13, minmax(40px, 1fr)); gap: 6px; min-width: 560px; margin: 0; padding: 0; list-style: none; }
.rp-bars__col { display: flex; flex-direction: column; min-width: 0; }
.rp-bars__plot { display: flex; flex-direction: column; height: var(--rp-h); padding-top: 18px; }
.rp-bars__pos { position: relative; display: flex; align-items: flex-end; justify-content: center; height: var(--rp-pos); border-bottom: 1px solid var(--tb-border-strong); }
.rp-bars__neg { position: relative; display: flex; align-items: flex-start; justify-content: center; flex: 1; min-height: 20px; }
/* --tb-border-hover is TravelBrandBusiness's primary-200 navy tint; the busiest month is full navy */
.rp-bars__bar { position: relative; display: block; width: 64%; max-width: 30px; min-height: 2px; border-radius: 4px 4px 0 0; background: var(--tb-border-hover); }
.rp-bars__col.is-peak .rp-bars__bar { background: var(--tb-primary); }
.rp-bars__bar--neg { max-height: calc(100% - 16px); border-radius: 0 0 4px 4px; background: var(--tb-danger); }
.rp-bars__val { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 3px; font-size: 10.5px; font-weight: 600; color: var(--tb-text-neutral); white-space: nowrap; }
.rp-bars__bar--neg .rp-bars__val { top: 100%; bottom: auto; margin: 3px 0 0; color: var(--tb-danger-ink); }
.rp-bars__val--zero { position: static; transform: none; margin: 0 0 3px; color: var(--tb-text-muted); font-weight: 500; }
.rp-bars__col.is-peak .rp-bars__val { color: var(--tb-primary); }
.rp-bars__label { display: flex; flex-direction: column; align-items: center; margin-top: 8px; font-size: 12px; font-weight: 600; color: var(--tb-text-neutral); }
.rp-bars__label small { font-size: 10.5px; font-weight: 500; color: var(--tb-text-muted); }

/* Share of net sales (live pie) as a ranked list */
.rp-shares { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.rp-shares__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: baseline; }
.rp-shares__name { font-size: 14px; font-weight: 600; color: var(--tb-text-strong); overflow-wrap: anywhere; }
.rp-shares__pct { font-size: 14px; font-weight: 700; color: var(--tb-primary); }
.rp-shares__track { grid-column: 1 / -1; height: 8px; border-radius: var(--tb-radius-pill); background: var(--tb-ice); overflow: hidden; }
.rp-shares__track i { display: block; height: 100%; border-radius: inherit; background: var(--tb-primary); }
.rp-shares__amt { grid-column: 1 / -1; margin-top: -2px; font-size: 12.5px; color: var(--tb-text-muted); }
.rp-shares__row.is-zero .rp-shares__name, .rp-shares__row.is-zero .rp-shares__pct { color: var(--tb-text-muted); font-weight: 500; }
.rp-section .rp-shares { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 32px; }

/* Sales / Cancellation picker (live gridview) */
.rp-seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--tb-radius-control); background: var(--tb-ice); }
.rp-seg__btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 0; border-radius: calc(var(--tb-radius-control) - 2px); background: transparent; font: inherit; font-size: 13px; font-weight: 500; color: var(--tb-text-neutral); cursor: pointer; }
.rp-seg__btn .num { font-size: 12px; color: var(--tb-text-muted); }
.rp-seg__btn.is-active { background: var(--tb-surface); color: var(--tb-primary); font-weight: 600; box-shadow: 0 1px 2px rgba(11, 31, 58, .08); }
.rp-seg__btn:focus-visible { outline: 2px solid var(--tb-royal); outline-offset: 2px; }

/* ---- Narrower page area ---- */
@container adcontent (max-width: 1100px) {
    .rp-two { grid-template-columns: minmax(0, 1fr); }
}
@container adcontent (max-width: 900px) {
    .rp-filters__grid, .rp-filters__grid--cs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rp-filters__customer { grid-column: 1 / -1; }
    .rp-filters__actions { grid-column: 1 / -1; }
    .rp-figures__list > div { padding: 0 20px; }
    .rp-figures__list > div:first-child { padding-left: 0; border-left: 0; }
    .rp-section .rp-shares { grid-template-columns: minmax(0, 1fr); }
}
@container adcontent (max-width: 520px) {
    .rp-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
    .rp-switch__item { flex-direction: column; gap: 0; padding: 8px 10px; }
    .rp-filters__grid, .rp-filters__grid--cs { grid-template-columns: minmax(0, 1fr); }
    .rp-filters__actions .btn { flex: 1; }
    .rp-figures { padding: 16px; }
    .rp-figures__list { display: grid; grid-template-columns: minmax(0, 1fr); width: 100%; gap: 12px; }
    .rp-figures__list > div { padding: 12px 0 0; border-left: 0; border-top: 1px solid var(--tb-bg); }
    .rp-figures__list > div:first-child { padding-top: 0; border-top: 0; }
    .rp-hero { padding: 18px 16px; }
    .rp-hero__value { font-size: 30px; }
    .rp-hero__parts { display: grid; grid-template-columns: minmax(0, 1fr); width: 100%; gap: 8px; }
    .rp-hero__op { display: none; }
    .rp-export { margin-left: auto; }
    .rp-seg { width: 100%; }
    .rp-seg__btn { flex: 1; justify-content: center; }
}

/* Tables as cards: row headers and the total row follow the cells */
@container evtable (max-width: 640px) {
    .rp .rp-table tbody th[scope="row"] { display: block; grid-column: 1 / -1; padding: 0; border: 0; background: none; }
    .rp .rp-table tfoot, .rp .rp-table tfoot tr { display: block; }
    .rp .rp-table tfoot tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; padding: 16px 20px; background: var(--tb-ice); }
    .rp .rp-table tfoot th, .rp .rp-table tfoot td { display: block; padding: 0; border: 0; background: none; text-align: left; white-space: normal; }
    .rp .rp-table tfoot th { grid-column: 1 / -1; }
    .rp .rp-table tfoot td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 2px; font-size: 12px; font-weight: 600; color: var(--tb-text-muted); }
    .rp .rp-table td.ma-r { text-align: left; }
    .rp .rp-desc, .rp .rp-pax { min-width: 0; grid-column: 1 / -1; }
    .rp .rp-clip, .rp .rp-clip--wide { max-width: none; white-space: normal; }
    .rp .rp-sum .rp-sum__net td { background: none; }
}
