


/* ============================================================ */
/* Polish v3 — density / weight-bar / col-toggle / context-menu  */
/*           / pagination / autocomplete / print / sparkline      */
/* ============================================================ */

/* ---------- Density modes ---------- */

body.density-comfortable table.table thead th { padding: 0.55rem 0.65rem; }
body.density-comfortable table.table tbody td { padding: 0.52rem 0.65rem; font-size: 0.9rem; }
body.density-comfortable .compact-card .card-body { padding: 0.7rem 0.85rem; }

body.density-compact table.table thead th { padding: 0.32rem 0.5rem; font-size: 0.7rem; }
body.density-compact table.table tbody td { padding: 0.28rem 0.5rem; font-size: 0.82rem; }
body.density-compact .compact-card .card-body { padding: 0.42rem 0.55rem; }

body.density-min table.table thead th { padding: 0.2rem 0.42rem; font-size: 0.66rem; line-height: 1.1; }
body.density-min table.table tbody td { padding: 0.18rem 0.42rem; font-size: 0.78rem; line-height: 1.18; }
body.density-min .compact-card .card-body { padding: 0.32rem 0.45rem; }
body.density-min .summary-strip__item { padding: 0.5rem 0.6rem; }

/* Density switcher pill */
.density-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border-radius: 7px;
  border: 1px solid var(--surface-border);
  background: var(--surface-muted);
}

.density-switch__btn {
  border: 0;
  background: transparent;
  width: 22px;
  height: 18px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-500);
  cursor: pointer;
  padding: 0;
}

.density-switch__btn svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

.density-switch__btn.is-active {
  background: var(--brand-700);
  color: #ffffff;
}

.density-switch__btn:hover:not(.is-active) {
  background: rgba(120, 145, 178, 0.12);
  color: var(--text-700);
}

/* ---------- Weight bar (inline) ---------- */

.weight-bar {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  min-width: 110px;
  font-variant-numeric: tabular-nums;
}

.weight-bar__track {
  position: relative;
  flex: 1 1 auto;
  height: 6px;
  border-radius: 3px;
  background: rgba(120, 145, 178, 0.16);
  overflow: hidden;
}

.weight-bar__fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--brand-600), var(--brand-500));
}

.weight-bar__pct {
  flex: 0 0 auto;
  font-size: 0.78rem;
  color: var(--text-700);
  min-width: 42px;
  text-align: right;
}

html[data-theme="dark"] .weight-bar__track {
  background: rgba(140, 168, 200, 0.14);
}

html[data-theme="dark"] .weight-bar__fill {
  background: linear-gradient(90deg, #60a5fa, #3b82f6);
}

/* ---------- Sparkline ---------- */

.spark {
  display: inline-block;
  vertical-align: middle;
  width: 76px;
  height: 22px;
}

.spark canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* ---------- Column toggle popover ---------- */

.col-toggle {
  position: relative;
  display: inline-block;
}

.col-toggle__btn {
  min-width: 32px;
  height: 32px;
  padding: 0 0.55rem;
  gap: 0.32rem;
  border-radius: 7px;
  border: 1px solid var(--surface-border-strong);
  background: var(--surface-strong);
  color: var(--text-500);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 700;
}

.col-toggle__btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.col-toggle__label {
  line-height: 1;
  white-space: nowrap;
}

.col-toggle__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 1080;
  min-width: 180px;
  max-height: min(320px, calc(100vh - 24px));
  overflow-y: auto;
  padding: 6px;
  border-radius: 8px;
  border: 1px solid var(--surface-border);
  background: var(--surface-strong);
  box-shadow: var(--surface-shadow);
  display: none;
}

.col-toggle.is-open .col-toggle__menu { display: block; }

.col-toggle__item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.32rem 0.4rem;
  border-radius: 5px;
  font-size: 0.82rem;
  color: var(--text-700);
  cursor: pointer;
  user-select: none;
}

.col-toggle__item:hover { background: rgba(120, 145, 178, 0.10); }

.col-toggle__item input { margin: 0; }

/* Hidden columns */
table.table th.col-hidden,
table.table td.col-hidden { display: none !important; }