/* Shared components extracted from POS (static/style.css + static/pultrack.css @ origin/main).
   Palette comes from tokens/tokens.css; fallbacks removed. */
/* ---- Data table (.pt-table) + pager ---- */
.pt-page{ display:flex; flex-direction:column; gap:.75rem; }
.pt-page__head,.pt-page__filters{ flex:none; }
.pt-page__head{ display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:.5rem 1rem; margin-bottom:1rem; }
.pt-page > .pt-page__head{ margin-bottom:0; }
.pt-page__title{ min-width:0; }
.pt-page__sub{ margin:.2rem 0 0; color:var(--muted); font-size:.875rem; }
.pt-count{ font-size:.6em; font-weight:600; vertical-align:middle; }
.pt-table{ display:flex; flex-direction:column; background:var(--app-card); border:1px solid var(--app-line);
  border-radius:12px; box-shadow:var(--shadow); overflow:hidden; }
.pt-table__body{ max-height:70vh; overflow:auto; -webkit-overflow-scrolling:touch; background:var(--app-card); }
.pt-table__body > table{ margin-bottom:0; border-collapse:separate; border-spacing:0; background:transparent; }
.pt-table__body table.sortable thead th,
.pt-table__body table.sticky-head thead th,
.pt-table__body table thead th{ position:sticky; top:0; z-index:3; background-color:var(--app-hover) !important;
  box-shadow:inset 0 -1px 0 var(--app-line); }
.pt-table__body table > tbody > tr > td{ background-color:var(--app-card); }
.pt-table__body table.table-hover > tbody > tr:hover > td{ background-color:var(--app-hover); }
.pt-table__body table > tbody > tr.text-muted > td{ background-color:var(--app-hover); }
.pt-table__body table tfoot th,.pt-table__body table tfoot td{ position:sticky; bottom:0; z-index:2;
  background-color:var(--app-hover) !important; box-shadow:inset 0 1px 0 var(--app-line); }
.pt-table__foot{ flex:none; border-top:1px solid var(--app-line); background:var(--app-hover); padding:.4rem .75rem; }
.pt-pager{ display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:.5rem 1rem; font-size:.875rem; }
.pt-pager__nav{ display:flex; align-items:center; gap:.35rem; }
.pt-pager__label{ padding:0 .35rem; white-space:nowrap; }
.pt-pager__meta{ white-space:nowrap; }
.pt-pager a.disabled{ pointer-events:none; opacity:.45; }
.pt-table--embedded .pt-table__foot{ display:none; }
.pt-table--lines{ flex:none; max-height:min(60vh,32rem); min-height:8rem; }
@media (max-width:767.98px){ .pt-pager{ font-size:.8rem; } .pt-table{ min-height:10rem; } }
thead th{ font-size:.8rem; font-weight:600; color:var(--muted); }

/* ---- Empty state ---- */
.pt-empty{ text-align:center; color:var(--muted); padding:1.75rem 1rem !important; font-size:var(--text-base); }
.pt-empty__icon{ display:block; font-size:1.5rem; opacity:.45; margin-bottom:.25rem; }

/* ---- KPI tile ---- */
.kpi-card{ transition:transform .15s ease, box-shadow .15s ease; height:100%; }
a:hover .kpi-card{ transform:translateY(-2px); box-shadow:0 6px 16px rgba(0,0,0,.12); }
.viz-kpi{ border:1px solid var(--app-line); box-shadow:none; }
.viz-kpi .card-body{ padding:14px 16px; container-type:inline-size; }
.viz-kpi-label{ font-size:var(--text-xs); color:var(--muted); font-weight:600;
  text-transform:uppercase; letter-spacing:.03em;
  white-space:normal; overflow-wrap:anywhere; }
.viz-kpi-value{ font-size:20px; font-size:clamp(14px, 11cqi, 23px); font-weight:700; color:var(--app-ink);
  line-height:1.2; margin-top:3px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  font-variant-numeric:tabular-nums; }
.viz-kpi-ccy{ font-size:.62em; font-weight:600; color:var(--muted); }
.viz-kpi-sub{ font-size:var(--text-xs); color:var(--muted); margin-top:2px;
  min-height:1.4em; }
.viz-kpi-neg .viz-kpi-value{ color:var(--debt); }
/* Coloured tiles (tone=primary|success|warning|danger): text follows the tone. */
.viz-kpi[class*="text-bg-"]{ border-color:transparent; }
.viz-kpi[class*="text-bg-"] .viz-kpi-label,
.viz-kpi[class*="text-bg-"] .viz-kpi-value,
.viz-kpi[class*="text-bg-"] .viz-kpi-ccy,
.viz-kpi[class*="text-bg-"] .viz-kpi-sub{ color:inherit; }
.viz-kpi[class*="text-bg-"] .viz-kpi-label,
.viz-kpi[class*="text-bg-"] .viz-kpi-ccy,
.viz-kpi[class*="text-bg-"] .viz-kpi-sub{ opacity:.85; }
.pt-kpi-link{ color:inherit; }
