/* Reports (app_reports): the report page, the library and dashboards of report boxes. Colours come from the section
   tokens in ui-theme.css; nothing here sets a colour of its own except the star. */

/* the report page */
.rep-head { margin: .25rem 0 .5rem; }
.rep-table td, .rep-table th { white-space: nowrap; }
.rep-table td.rep-col-text, .rep-table th.rep-col-text { white-space: normal; }
.rep-table .rep-col-amount, .rep-table .rep-col-number, .rep-table .rep-col-percent { text-align: right; font-variant-numeric: tabular-nums; }
.rep-row-heading td { font-weight: 600; background: var(--ui-section-soft); color: var(--ui-section-strong); }
.rep-row-group td { font-weight: 600; }
.rep-row-subtotal td { font-weight: 600; border-top: 1px solid #cbd5e1; }
.rep-row-total td { font-weight: 700; border-top: 2px solid var(--ui-section); background: var(--ui-tone-neutral-bg); }
.rep-row-muted td { color: var(--ui-muted); font-style: italic; }
.rep-row-spacer td { border: 0; height: .75rem; }
.rep-table--compact td, .rep-table--compact th { font-size: .82rem; padding: .2rem .4rem; }
.rep-chart { width: 100%; min-height: 260px; }
.rep-print-only { display: none; }
.rep-star { color: var(--ui-muted); background: none; border: 1px solid var(--bs-border-color); }
.rep-star svg { width: 15px; height: 15px; }
.rep-star.is-on { color: var(--ui-tone-warning-solid); }
.rep-star.is-on svg { fill: currentColor; }

/* the library */
.rep-library__bar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-bottom: 1rem; }
.rep-search { position: relative; flex: 1 1 18rem; max-width: 26rem; }
.rep-search svg { position: absolute; left: .7rem; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--ui-muted); pointer-events: none; }
.rep-search input { width: 100%; padding: .5rem .75rem .5rem 2.2rem; border: 1px solid var(--bs-border-color); border-radius: .5rem; }
.rep-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.rep-chip { border: 1px solid var(--bs-border-color); background: #fff; border-radius: 999px; padding: .2rem .7rem; font-size: .82rem; }
.rep-chip small { color: var(--ui-muted); }
.rep-chip.is-on { background: var(--ui-section-soft, #eef2ff); border-color: var(--ui-section-line, #c7d2fe); font-weight: 600; }
.rep-section { margin-bottom: 1.5rem; }
.rep-section[hidden], .rep-group[hidden], .rep-card[hidden] { display: none; }
.rep-heading { display: flex; align-items: center; gap: .4rem; margin: 0 0 .5rem; font-size: .85rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ui-section-strong, var(--ui-muted)); }
.rep-heading svg { width: 14px; height: 14px; }
.rep-subheading { margin: .6rem 0 .4rem; font-size: .75rem; font-weight: 600; color: var(--ui-muted); }
.rep-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .6rem; }
.rep-card { position: relative; border: 1px solid var(--bs-border-color); border-radius: .55rem; background: #fff; }
.rep-card:hover, .rep-card:focus-within { border-color: var(--ui-section-line, #c7d2fe); background: var(--ui-section-soft, #f8fafc); }
.rep-card__link { display: flex; gap: .65rem; align-items: flex-start; padding: .65rem 2.2rem .65rem .7rem; color: inherit; text-decoration: none; height: 100%; }
.rep-card__icon { flex: none; display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: .45rem; background: var(--ui-section-soft, #eef2ff); color: var(--ui-section-strong, #4338ca); }
.rep-card__icon svg { width: 17px; height: 17px; }
.rep-card__label { display: block; font-weight: 600; font-size: .9rem; line-height: 1.25; }
.rep-card__text small { display: block; margin-top: .15rem; color: var(--ui-muted); font-size: .78rem; line-height: 1.3; }
.rep-card__star { position: absolute; top: .4rem; right: .4rem; display: inline-flex; padding: .25rem; border: 0; border-radius: .35rem; background: none; color: var(--ui-muted); }
.rep-card__star:hover { color: var(--ui-tone-warning-solid); background: rgba(0, 0, 0, .05); }
.rep-card__star svg { width: 15px; height: 15px; }
.rep-card__star.is-on { color: var(--ui-tone-warning-solid); }
.rep-card__star.is-on svg { fill: currentColor; }

/* dashboards: twelve columns, a box takes 3, 4, 6 or 12 of them, and boxes stack on a phone */
.rep-board { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: .75rem; align-items: start; }
.rep-box { grid-column: span 6; min-width: 0; border: 1px solid var(--bs-border-color); border-radius: .55rem; background: #fff; padding: .6rem .75rem; }
.rep-box--3 { grid-column: span 3; }
.rep-box--4 { grid-column: span 4; }
.rep-box--12 { grid-column: span 12; }
.rep-box__head { display: flex; align-items: center; gap: .5rem; margin-bottom: .4rem; }
.rep-box__title { flex: 1; margin: 0; font-size: .9rem; font-weight: 650; }
.rep-box__actions { display: inline-flex; gap: .4rem; }
.rep-box__actions a { color: var(--ui-muted); }
.rep-box__actions svg { width: 15px; height: 15px; }
.rep-figure__value { font-size: 1.8rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
@media (max-width: 768px) { .rep-box, .rep-box--3, .rep-box--4 { grid-column: span 12; } }

@media print {
  .rep-noprint, .ui-sidebar, .ui-topbar, .ui-pagebar__actions, .rep-library__bar { display: none !important; }
  .rep-print-only { display: block; }
  .rep-print-company { font-size: 1.25rem; font-weight: 700; }
  .rep-table td, .rep-table th { font-size: 10pt; padding: .15rem .35rem; }
  .rep-box { break-inside: avoid; }
}
