/* S84 C2: a report template's Template | Parameter settings tabs, the parameter tables and their
   dialogs (js/ui/report-params.js), and the data set's Parameters tab (js/ui/report-values.js). */

.tpl-tabs {
  display: flex; gap: 2px; padding: 0 10px; flex: none;
  border-bottom: 1px solid var(--border); background: var(--surface);
}
.tpl-tabs button {
  padding: 6px 12px; background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--muted); cursor: pointer; font: inherit; font-size: 12.5px; margin-bottom: -1px;
}
.tpl-tabs button:hover { color: var(--ink); }
.tpl-tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }
.tpl-tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.report-params { flex: 1; min-height: 0; overflow: auto; background: var(--surface); }
.rp { max-width: 960px; padding: 12px 16px 24px; font-size: 12.5px; color: var(--ink); }

.rp-bar { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.rp-note { flex: 1; margin: 0; color: var(--muted); line-height: 1.5; }
.rp-bar-actions { display: flex; gap: 6px; flex: none; }

.rp-errors {
  margin: 0 0 10px; padding: 7px 10px; border-radius: 7px; line-height: 1.45;
  background: var(--danger-soft); color: var(--danger);
}

.rp-report {
  border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px; margin-bottom: 14px;
  background: var(--surface);
}
.rp-page-no { font-weight: 650; font-size: 12px; color: var(--muted); }
.rp-btn { width: 24px; height: 24px; font-size: 14px; line-height: 1; }
.rp-btn.rp-danger:hover { color: var(--danger); }

.rp-grid { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: flex-end; }
.rp-field { display: flex; flex-direction: column; gap: 3px; min-width: 120px; flex: 1 1 140px; }
.rp-field.rp-wide { flex: 2 1 220px; }
.rp-field.rp-num { flex: 0 1 110px; min-width: 90px; }
.rp-field > span, .rp-sub {
  font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); font-weight: 600;
}
.rp-field input, .rp-field select, .rp-value input {
  width: 100%; font: inherit; padding: 5px 8px; min-width: 0;
  border: 1px solid var(--border-strong); border-radius: 7px; background: var(--surface); color: var(--ink);
}
.rp-check { display: flex; align-items: center; gap: 6px; padding: 6px 0; cursor: pointer; white-space: nowrap; }
.rp-check input { width: 14px; height: 14px; margin: 0; accent-color: var(--accent); }
.rp .rp-bad, .rp input.rp-bad, .rp select.rp-bad { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger) inset; }
.rp-static { display: inline-block; padding: 5px 8px; border-radius: 7px; background: var(--surface2); color: var(--ink); }

.rp-values { flex: 1 1 100%; display: flex; flex-direction: column; gap: 4px; }
.rp-value { display: flex; gap: 6px; align-items: center; }
.rp-value input:first-child { flex: 0 1 180px; }
.rp-value input:nth-child(2) { flex: 1 1 220px; }
.rp-link {
  align-self: flex-start; background: none; border: none; padding: 2px 0; cursor: pointer;
  color: var(--accent-ink); font: inherit; font-size: 12px;
}

.rp-add-page { margin-top: 2px; }
.rp-empty { color: var(--muted); margin: 6px 0 12px; }
.rp-problems { margin: 6px 0 0; padding-left: 18px; line-height: 1.5; }
.rp-placeholder { color: var(--faint); font-style: italic; }
.rp-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* One tab = one table: a caption bar (the tab's name and hint, its actions), a shaded header row,
   rows parted by horizontal rules only — no vertical lines. The row's pencil and bin sit at the
   right end of its last cell, faint until the row is hovered or focused. */
.rp-table {
  width: 100%; border-collapse: collapse; margin: 0 0 16px; font-size: 12.5px; background: var(--surface);
  border-bottom: 1px solid var(--border-strong);
}
.rp-caption { caption-side: top; text-align: left; padding: 0; }
.rp-cap-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  background: var(--surface2); border-top: 1px solid var(--border-strong); border-bottom: 1px solid var(--border-strong);
}
.rp-cap-text { flex: 1; min-width: 0; }
.rp-cap-name { font-weight: 650; font-size: 13px; color: var(--ink); }
.rp-cap-hint { margin-top: 2px; color: var(--muted); font-size: 11.5px; }
.rp-cap-tools { display: flex; gap: 2px; flex: none; }
.rp-table thead th {
  background: var(--surface2); color: var(--ink); font-weight: 600; font-size: 12px; text-align: left;
  padding: 7px 10px; border-bottom: 1px solid var(--border-strong);
  vertical-align: bottom; line-height: 1.25;
}
.rp-table td {
  padding: 7px 10px; overflow-wrap: anywhere; border-bottom: 1px solid var(--border);
  vertical-align: middle; color: var(--ink);
}
.rp-table tbody tr.rp-row:hover > td { background: var(--surface2); }
.rp-table .rp-name { font-family: var(--mono, ui-monospace, Consolas, monospace); font-weight: 600; overflow-wrap: anywhere; }
.rp-table td.rp-last { position: relative; padding-right: 64px; }
.rp-row-acts {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  display: flex; gap: 2px; opacity: .45; transition: opacity .12s;
}
.rp-table tr.rp-row:hover .rp-row-acts, .rp-table tr.rp-row:focus-within .rp-row-acts { opacity: 1; }
.rp-table .rp-empty { color: var(--muted); padding: 10px; margin: 0; }
.rp-table tfoot td { background: var(--surface); padding: 8px 10px; border-bottom: none; }
.rp-table tr.rp-row.rp-bad > td:first-child { color: var(--danger); }
.rp-add { display: flex; gap: 6px; align-items: center; }

/* The parameter and tab dialogs (js/ui/report-params.js). */
.dlg.dlg-param { width: min(560px, 92vw); }
.rp-dlg-kind { display: flex; flex-direction: column; gap: 3px; margin-bottom: 12px; }
.rp-dlg-kind > span {
  font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); font-weight: 600;
}
.rp-dlg-kind select {
  font: inherit; padding: 5px 8px; border: 1px solid var(--border-strong); border-radius: 7px;
  background: var(--surface); color: var(--ink);
}
.rp-dlg-errors {
  margin: 0 0 12px; padding: 7px 10px; border-radius: 7px; line-height: 1.45;
  background: var(--danger-soft); color: var(--danger);
}
.rp-dlg-errors p { margin: 0 0 4px; }
.rp-dlg-errors .rp-problems { margin: 0; }

/* The data set's "Parameters" tab (js/ui/report-values.js): the cashier's values over the set's
   <ReportSettings>. Same table look as the template side. */
.report-values { flex: 1; min-height: 0; overflow: auto; background: var(--surface); }
.rv { max-width: 960px; padding: 12px 16px 24px; font-size: 12.5px; color: var(--ink); }
.rv-bar { margin-bottom: 8px; }
.rv-for { margin: 0 0 4px; font-weight: 650; }
.rv-note { margin: 0; color: var(--muted); line-height: 1.5; }
.rv-page { margin-bottom: 8px; }
.rv-page-title { margin: 12px 0 6px; font-size: 12px; font-weight: 650; }
.rv .rp-table thead th { border-top: 1px solid var(--border-strong); }
.rv-cell { display: flex; align-items: center; gap: 6px; }
.rv-cell > :first-child { flex: 0 1 240px; min-width: 0; }
.rv-cell > .rv-period { flex: 0 1 auto; }
.rv-name { text-align: left; font-weight: 600; white-space: normal; text-transform: none; letter-spacing: 0; color: var(--ink); font-size: 12.5px; }
.rv-name span { display: block; }
.rv-name code { font-family: var(--mono, ui-monospace, Consolas, monospace); font-size: 11px; color: var(--faint); font-weight: 400; }
.rv-control input, .rv-control select {
  font: inherit; padding: 4px 8px; min-width: 0; width: 100%; max-width: 240px;
  border: 1px solid var(--border-strong); border-radius: 7px; background: var(--surface); color: var(--ink);
}
.rv-control input.rp-bad { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger) inset; }
.rv-period { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rv-period span { color: var(--muted); }
.rv-period input { width: auto; max-width: none; }
.rv-def { color: var(--muted); }
.rv-empty { color: var(--muted); margin: 6px 0 12px; }
