/* Khánh Toàn · Bán hàng (tenant letanngocthanh): only what kit v1.10 lacks, plus layout glue.
   Colours, radii, shadows and type all come from tokens (var(--*)); no kit component is restyled here.
   Every rule below is a row in KIT_GAPS.md. */

/* S1 Tổng quan: the day chosen under the "Doanh thu theo ngày" columns (letanngocthanh.js fills it from tvkit:chart-select). */
.ktn-day {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2) var(--sp-3);
  padding-block-start: var(--sp-3);
  border-top: 1px solid var(--panel-border);
}
.ktn-day-text { display: grid; gap: var(--sp-1); min-width: 0; }
.ktn-day-fig { font-family: var(--font-figure, inherit); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* S1: the profit figure hidden behind the eye button; the two spans swap (letanngocthanh.js). */
.ktn-secret[data-shown="false"] .ktn-secret-on,
.ktn-secret[data-shown="true"] .ktn-secret-off { display: none; }

/* S6 Quét mã: the kit's .cam stage fills its parent (height: 100%), so the page gives it the whole screen;
   and a heading on the stage takes the stage's text colour (kit .cam recolours text, not h1: KIT_GAPS "Defects in the kit" #2). */
.ktn-cam-page { height: 100dvh; }
.ktn-cam-title { margin: 0; font-size: var(--fs-md); color: var(--stage-fg); }

/* S6 Bán hàng on a 360 px phone: the quantity stepper of a marked row (.work-act, about 170 px) left the item name about 80 px, one word a line.
   Below 23.5rem the stepper goes under the name, at the row's end; at 390 px nothing moves (KIT_GAPS #59). Delete when .work-row lets its act wrap. */
@media (max-width: 23.5rem) {
  .work-row:has(> .work-act[data-ktn-marked]) { grid-template-columns: minmax(0, 1fr); }
  .work-row > .work-act[data-ktn-marked] { justify-self: end; padding-block-start: 0; }
}

/* S6, S7, S8, S9, S13: the search field and its icon buttons ("+", quét mã; sắp xếp, lọc) stay on one row, as in the clip (khung 00m39.0s, 00m46.0s, 00m51.0s, 01m35.6s).
   In a kit .cluster the .input-icon keeps the input's own width (about 250 px) and the row wraps, so at 390 px the last button fell onto a line of its own (KIT_GAPS #62). */
.ktn-tim { flex-wrap: nowrap; }
.ktn-tim > .input-icon { flex: 1 1 0; min-width: 0; }
.ktn-tim > .btn { flex: none; }

/* S39, S43: a title or subtitle that does not fit one line at 390 px (a supplier's full name, both shift times) wraps instead of ending in "…" (KIT_GAPS #73). */
.topbar-title.ktn-title-wrap > .topbar-title-text,
.topbar-title.ktn-title-wrap > .topbar-title-sub { white-space: normal; }

/* S15 Bản in A4: the customer's own sheet. The QR sits where a voucher number would, at the top right of the letterhead. */
.ktn-paper-qr { --qr-size: 30mm; }
.ktn-paper-party {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: var(--sp-1) var(--sp-5);
  margin-block-end: var(--sp-3);
}
.ktn-paper-party p { margin: 0; }
/* the gift line numbered "2.1" under its parent line: its number is set in */
.ktn-paper-sub { padding-inline-start: var(--sp-4); }
.ktn-paper-end { display: grid; gap: var(--sp-1); margin-block: var(--sp-3); }
.ktn-paper-end p { margin: 0; }

/* ---- Hàng hoá S29 Kiểm kho (prefix ktn-kho-; KIT_GAPS rows "S29"). ---- */
/* kit v1.10 defines .count-row twice: the later rule (the stepper row of "Colour and variant tiles") wins over the stocktake row, so the book figure ("Tồn máy: 40")
   slid under the field and the row lost its side padding. ul.count-list.ktn-kho-count puts the stocktake row back as COMPONENTS.md draws it (KIT_GAPS Defects #5). */
.ktn-kho-count > .count-row { grid-template-columns: minmax(0, 1fr) auto auto; gap: var(--sp-1) var(--sp-3); padding: var(--sp-3) var(--sp-4); }
/* S29 thiếu số: a row still without its counted figure when Hoàn thành was pressed takes a red edge; the field carries aria-invalid and the words sit in .count-row-diff. */
.ktn-kho-count > .count-row.ktn-kho-thieu { background: var(--danger-bg); box-shadow: inset 0 0 0 2px var(--danger); }