/* Kho Mơ Hương: only what the kit does not carry, plus layout glue. Colours, spacing, radii and type come from tokens.css. */

/* ---------- sign-in art: the shelves of a candle store, drawn in one line weight ---------- */
.mh-art { display: block; width: min(100%, 22rem); height: auto; opacity: 0.55; }
.mh-art-phone { width: 11rem; margin-inline: auto; color: var(--primary); opacity: 1; }
.mh-aside-title { font-size: var(--fs-3xl); line-height: var(--lh-tight); max-width: 20ch; }

/* ---------- small pieces ---------- */
.mh-strong { font-weight: 700; }
.mh-today { font-size: var(--fs-sm); white-space: nowrap; }
.mh-tags { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.mh-center { text-align: center; }
.mh-two-line { display: grid; text-align: start; flex: 1; }
.mh-two-line .muted { font-size: var(--fs-sm); }
.mh-indent { padding-inline-start: var(--sp-6); font-weight: 400; }
.mh-suggest { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }

/* ---------- office layout ---------- */
.mh-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 30rem), 1fr)); gap: var(--sp-5); align-items: start; }
.mh-narrow { max-width: 60rem; width: 100%; }
.mh-form-end { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--sp-3); }
.mh-form-end > p { margin: 0 auto 0 0; }
.mh-grow { flex: 1; }
.mh-foot-tools { display: flex; flex-wrap: wrap; gap: var(--sp-3); }

/* voucher entry grid. It has to fit a 1280px window beside the side bar: the item box keeps a whole name, every other column takes the least */
.mh-entry { --cell-min: 3.25rem; }
.mh-entry .mh-cell-item { min-width: 15.75rem; }
.mh-entry .mh-w-note { --cell-min: 6.25rem; }
.mh-entry .mh-w-lot { --cell-min: 4.75rem; }
.mh-entry .mh-w-date { --cell-min: 5.75rem; }
.mh-entry td, .mh-entry th { vertical-align: middle; }
.mh-entry td.muted, .mh-entry .cell-sub { white-space: normal; }
.mh-entry td.actions { padding-inline: var(--sp-1); }
.mh-entry .combo-list { min-width: 22rem; }

/* "Lọc thêm" sits on the same line as the labelled fields of a filter bar */
.mh-filter-more { align-self: end; }

/* a short text link that still takes a thumb */
.mh-tap { display: inline-flex; align-items: center; justify-content: center; min-width: var(--tap); min-height: var(--tap); }

.mh-total { margin: 0; }
.mh-total dt { color: var(--muted); }
.mh-total dd { margin: 0; font-family: var(--font-heading); font-size: var(--fs-3xl); font-weight: var(--heading-weight); line-height: var(--lh-tight); font-variant-numeric: tabular-nums; }

/* the over-stock line: error, "Cho tạm âm" and its reason */
.mh-override { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); gap: var(--sp-4); align-items: start; }

/* drill-down figure in a report: reads as a link without changing the column's alignment */
.mh-drill { text-decoration: underline; text-underline-offset: 0.2em; font-weight: 600; }

/* meter column of "Dưới tối thiểu" */
.mh-meter-cell { width: 30%; min-width: 12rem; }

/* drop zone of the import page */
.mh-drop { min-height: 14rem; align-content: center; }

/* one extra unit of an item: unit, factor, remove */
.mh-unit-row { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: var(--sp-3); align-items: end; }

.mh-add-row { display: flex; gap: var(--sp-3); }
.mh-add-row .input { flex: 1; min-width: 0; }

/* ---------- paper ---------- */
.mh-paper-sub { font-size: var(--fs-xs); }
.mh-paper-blank { width: 14%; }
.mh-paper-preview { width: 100%; min-height: 0; padding: var(--sp-5); font-size: var(--fs-sm); }

/* ---------- phone ---------- */
.mh-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); margin-block-end: var(--sp-2); }
.mh-section-head h2 { font-size: var(--fs-lg); margin: 0; }
.mh-chip-scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-block: var(--sp-1); }
.mh-chip-scroll > .chip { flex: none; }
.mh-pair { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: var(--sp-3); }
.mh-route { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: var(--sp-2); align-items: end; }
.mh-route-arrow { display: grid; place-items: center; height: var(--tap); color: var(--muted); }
.mh-add-lines { display: grid; gap: var(--sp-2); }
.mh-qty { font-weight: 700; font-size: var(--fs-md); white-space: nowrap; }
/* a field of a two-column .line-card-body that needs the whole row: a dd/mm/yyyy date needs 105 px, half a card at 390 px gives 86 px */
.mh-span { grid-column: 1 / -1; }
/* KIT_GAPS G31: .work-sub cuts with an ellipsis (kit.css 3477, white-space: nowrap). A line of stock figures must never be cut, so it wraps between
   figures (each figure is a span.nowrap). Measured before: S11 phone at 360 px, "Đầu 1.840 · Nhập 5.000 · Xuất 1…" 236 px of text in 199 px.
   Delete when the kit has a wrapping work-sub variant. */
.mh-figs { white-space: normal; text-overflow: clip; }
.mh-day { padding: var(--sp-3) var(--sp-4) var(--sp-1); background: var(--sunk); }
.mh-day h3 { margin: 0; font-size: var(--fs-sm); color: var(--muted); }

/* lots picked for one issue line (kit has no line-split list) */
.mh-lots { display: grid; gap: var(--sp-2); }
.mh-lots-head { display: flex; align-items: center; gap: var(--sp-2); margin: 0; font-size: var(--fs-sm); color: var(--muted); }
.mh-lots ul { list-style: none; margin: 0; padding: 0; border: 1px solid var(--panel-border); border-radius: var(--radius); }
.mh-lots li { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-3); padding: var(--sp-2) var(--sp-3); }
.mh-lots li + li { border-block-start: 1px solid var(--panel-border); }
.mh-lots li strong { white-space: nowrap; font-variant-numeric: tabular-nums; }
.mh-lots .btn { justify-self: start; }

/* multi-select of items inside a sheet */
.mh-pick-list { list-style: none; margin: 0; padding: 0; }
.mh-pick-list li + li { border-block-start: 1px solid var(--panel-border); }
.mh-pick { display: flex; align-items: center; gap: var(--sp-3); min-height: var(--tap); padding-block: var(--sp-2); }
.mh-pick > span { display: grid; }
.mh-pick .muted { font-size: var(--fs-sm); }

/* asked figure beside the approved field */
.mh-approve { align-items: end; }
.mh-asked { display: grid; gap: var(--sp-1); }
.mh-asked strong { display: flex; align-items: center; min-height: var(--tap); font-size: var(--fs-lg); font-variant-numeric: tabular-nums; }

/* one item's balance on the phone stock card */
.mh-balance-label { margin: 0; color: var(--muted); }
.mh-balance-figure { margin: 0; font-family: var(--font-heading); font-size: var(--fs-3xl); font-weight: var(--heading-weight); line-height: var(--lh-tight); font-variant-numeric: tabular-nums; }

/* KIT_GAPS defect 11: .paper-watermark is rotated as a whole inset:0 box, so its corners reach past the sheet and .paper-stage scrolls sideways
   inside itself. Measured before the patch: S7-in-phieu-da-huy 1219 px of content in a 1171 px stage (1440 and 1280). Delete when the kit clips the mark. */
.paper:has(> .paper-watermark) { overflow: clip; }

/* KIT_GAPS defect 12: a.file-tile-name::after is stretched over the whole tile (kit.css 3837) and lies on top of the remove button, so the button cannot be
   clicked. Measured before the patch: the point at the middle of "Xóa tệp phieu-giao.jpg" on S6-chi-tiet-phieu-nhap hit the name link. Delete when the kit
   lifts the foot button above the stretched link. */
.file-tile-foot > .btn { position: relative; z-index: 1; }

/* KIT_GAPS defect 10: the date picker's day buttons are 40 px high and about 42 px wide (kit.css .calendar 20rem, .calendar-day 2.5rem), under the 44 px
   touch target. On phone pages the calendar grows to the window and the days to 44 px. Measured before the patch: 40x40 at 390x844. Delete when the kit
   sizes its days for touch. */
:root[data-look="app"] .calendar { width: 23rem; padding: var(--sp-2); }
:root[data-look="app"] .calendar-day { height: 2.75rem; }

/* print preview on a phone: the whole A4 sheet shows at once, the printout itself is unchanged */
@media screen and (max-width: 30rem) {
  .mh-paper-fit { padding: var(--sp-2); }
  .mh-paper-fit > .paper { zoom: 0.42; }
}

/* An office form opened on a narrow window: a .seg with long labels (Lý do nhập, 3 items, 480 px) is wider than the screen and the whole page scrolls sideways.
   Measured before the patch: S3-lap-phieu-nhap-may-tinh 517 px of page at 375 px. Below 40rem the items wrap onto more rows instead. */
@media screen and (max-width: 40rem) {
  .seg:not(.seg-block) { flex-wrap: wrap; border-radius: var(--radius-lg, 12px); }
}
