/* PT Mulia look and feel (direction D, owner's decision 1 Oct 2026).
   Colours and fonts live in the first block below: change them there and every screen follows.
   The rest dresses Bootstrap's parts (buttons, cards, tables, forms) and lays out the app:
   a side menu on computers, a bottom tab bar on phones. */

/* Plus Jakarta Sans 5.3.0 (Fontsource, SIL Open Font License: static/vendor/fonts/LICENSE),
   kept in the project like Bootstrap. One file covers every weight. */
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("../vendor/fonts/plus-jakarta-sans-latin-wght-normal.7660bd9909fb.woff2") format("woff2");
}

:root {
  /* --- Brand: change these to restyle the whole system --- */
  --pm-navy: #16365F;          /* main colour: menu, headers, main buttons */
  --pm-navy-rgb: 22, 54, 95;
  --pm-navy-dark: #0E2442;     /* side menu */
  --pm-navy-soft: #E3EBF6;     /* selected tab, light navy fills */
  --pm-butter: #F3C74E;        /* small highlights */
  --pm-butter-soft: #FFF7DE;
  --pm-red: #C8202F;           /* logo mark only */
  --pm-cream: #FAF8F3;         /* page background */
  --pm-font: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;

  /* --- Neutrals --- */
  --pm-surface: #FFFFFF;
  --pm-surface-2: #F7F5EF;
  --pm-line: #ECE8DE;
  --pm-line-soft: #F0EDE5;
  --pm-line-strong: #CFCABD;
  --pm-ink: #142033;
  --pm-ink-2: #2F3A4C;
  --pm-muted: #5A6474;

  /* --- Meanings --- */
  --pm-ok: #17633B;      --pm-ok-bg: #DDEFE4;
  --pm-draft: #3B4555;   --pm-draft-bg: #ECEEF2;
  --pm-bad: #9E1B26;     --pm-bad-bg: #FBE2E3;   --pm-bad-text: #B4232F;
  --pm-warn: #6E4700;    --pm-warn-bg: #FFF1C9;
  --pm-frozen: #1D4F8A;  --pm-frozen-bg: #E3EEF9;
  --pm-chilled: #0F5E55; --pm-chilled-bg: #DCF1EE;
  --pm-ambient: #6B4A12; --pm-ambient-bg: #F3EBDD;

  /* --- Sizes --- */
  --pm-radius: 12px;
  --pm-radius-card: 18px;
  --pm-sidebar-width: 256px;
  --pm-tabbar-height: 68px;

  /* --- Bootstrap, following the brand --- */
  --bs-body-font-family: var(--pm-font);
  --bs-body-bg: var(--pm-cream);
  --bs-body-color: var(--pm-ink);
  --bs-emphasis-color: var(--pm-ink);
  --bs-secondary-color: var(--pm-muted);
  --bs-tertiary-bg: var(--pm-surface-2);
  --bs-primary: var(--pm-navy);
  --bs-primary-rgb: var(--pm-navy-rgb);
  --bs-link-color: var(--pm-navy);
  --bs-link-color-rgb: var(--pm-navy-rgb);
  --bs-link-hover-color: var(--pm-navy-dark);
  --bs-link-hover-color-rgb: 14, 36, 66;
  --bs-border-color: var(--pm-line);
  --bs-border-radius: var(--pm-radius);
  --bs-border-radius-sm: 8px;
  --bs-border-radius-lg: var(--pm-radius-card);
  --bs-focus-ring-color: rgba(var(--pm-navy-rgb), 0.25);
  --bs-heading-color: var(--pm-ink);
}

body {
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { font-weight: 800; letter-spacing: -0.01em; }
a { text-underline-offset: 2px; }
.fw-semibold { font-weight: 700 !important; }
.text-body-secondary { color: var(--pm-muted) !important; }
.icon { flex-shrink: 0; }

/* --- The logo --- */
.brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 11px; background: var(--pm-red); color: #FFFFFF;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px;
  letter-spacing: 0.02em; flex-shrink: 0;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-weight: 800; font-size: 17px; }
.brand-sub { font-size: 12px; opacity: 0.75; }

/* --- App layout --- */
.app-shell { min-height: 100vh; }
.app-body { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.app-main { width: 100%; max-width: 1240px; padding: 28px 40px 48px; flex-grow: 1; }
.plain-main { width: 100%; max-width: 560px; margin: 0 auto; padding: 32px 16px 48px; }

.test-banner {
  background: var(--pm-butter-soft); color: #5C4300; border-bottom: 1px solid #F1DB98;
  text-align: center; font-size: 13px; font-weight: 600; padding: 5px 12px;
}

/* Side menu: part of the page on computers, a slide-in panel (the "More" tab) on phones. */
.app-sidebar { --bs-offcanvas-bg: var(--pm-navy-dark); --bs-offcanvas-width: 300px; --bs-offcanvas-color: #FFFFFF; color: #FFFFFF; }
.app-sidebar-inner {
  background: var(--pm-navy-dark); color: #FFFFFF; min-height: 100%; width: 100%;
  display: flex; flex-direction: column; gap: 24px; padding: 22px 16px; overflow-y: auto;
}
.app-sidebar .brand { padding: 0 6px; }
.app-sidebar .brand-sub { color: #AFC0D8; opacity: 1; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: #8EA3C0; padding: 16px 12px 6px;
}
.side-link {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  color: #C9D6E8; text-decoration: none; font-size: 15px; font-weight: 500;
}
.side-link:hover, .side-link:focus-visible { color: #FFFFFF; background: rgba(255, 255, 255, 0.07); }
.side-link.active { color: #FFFFFF; background: rgba(255, 255, 255, 0.12); font-weight: 700; }
.side-link.active .icon { color: var(--pm-butter); }
.side-link.sub { padding: 7px 12px 7px 44px; font-size: 14px; }
.side-account {
  margin-top: auto; background: rgba(255, 255, 255, 0.06); border-radius: 12px; padding: 12px;
  display: flex; flex-direction: column; gap: 10px;
}
.side-account-name { font-weight: 700; font-size: 14px; }
.side-account-role { font-size: 12px; color: #AFC0D8; }
.side-account .side-link { padding: 7px 8px; font-size: 14px; }
.side-account form { margin: 0; }
.side-account button.side-link { width: 100%; border: 0; background: transparent; text-align: left; }
.side-account button.side-link:hover { background: rgba(255, 255, 255, 0.07); }

@media (min-width: 992px) {
  .app-shell { display: grid; grid-template-columns: var(--pm-sidebar-width) minmax(0, 1fr); }
  .app-sidebar { position: sticky; top: 0; height: 100vh; }
  .app-sidebar-inner { height: 100vh; }
}

/* Phone and tablet: a slim top bar and a tab bar at the bottom. */
.app-topbar {
  background: var(--pm-navy); color: #FFFFFF; padding: 10px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.app-topbar .brand-mark { width: 34px; height: 34px; font-size: 13px; border-radius: 10px; }
.app-topbar .brand-name { font-size: 16px; }
.app-topbar .brand-sub { color: #D5E0EF; opacity: 1; }
.app-tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
  height: calc(var(--pm-tabbar-height) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--pm-surface); border-top: 1px solid #E6E2D8;
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); align-items: center;
}
.tab-link {
  display: flex; flex-direction: column; align-items: center; gap: 3px; border: 0; background: transparent;
  color: var(--pm-muted); text-decoration: none; font-size: 11px; font-weight: 600; padding: 4px 0;
}
.tab-link .tab-icon { width: 52px; max-width: 100%; height: 30px; border-radius: 999px; display: flex; align-items: center; justify-content: center; position: relative; }
/* How many wait for this person (Approvals): butter yellow, the small highlight colour. */
.nav-count {
  margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 999px; text-align: center;
  background: var(--pm-butter); color: #412402; font-size: 12px; font-weight: 800; line-height: 18px;
}
.tab-icon .nav-count { position: absolute; top: -2px; right: 2px; margin: 0; min-width: 18px; padding: 0 5px; font-size: 10px; line-height: 16px; }
.tab-link.active { color: var(--pm-navy); font-weight: 800; }
.tab-link.active .tab-icon { background: var(--pm-navy-soft); }

@media (max-width: 991.98px) {
  .app-main { padding: 20px 16px calc(var(--pm-tabbar-height) + 32px + env(safe-area-inset-bottom)); }
  .app-main.has-action-bar { padding-bottom: calc(var(--pm-tabbar-height) + 104px + env(safe-area-inset-bottom)); }
}

/* A main button kept in reach at the bottom of a phone screen (e.g. Post DO). */
.mobile-action-bar {
  position: fixed; left: 0; right: 0; z-index: 1029;
  bottom: calc(var(--pm-tabbar-height) + env(safe-area-inset-bottom));
  background: var(--pm-surface); border-top: 1px solid #E6E2D8; padding: 10px 16px;
  display: flex; gap: 10px;
}
.mobile-action-bar .btn { flex-grow: 1; min-height: 52px; font-size: 16px; }

/* Language switch (EN / ID) */
.lang-switch { display: inline-flex; background: rgba(255, 255, 255, 0.12); border-radius: 10px; padding: 3px; gap: 2px; }
.lang-switch button {
  border: 0; border-radius: 8px; background: transparent; color: #D5E0EF;
  font-size: 12px; font-weight: 700; padding: 4px 10px; min-height: 28px;
}
.lang-switch button[aria-pressed="true"] { background: #FFFFFF; color: var(--pm-navy); }
.lang-switch.on-light { background: #EFECE4; }
.lang-switch.on-light button { color: var(--pm-muted); }
.lang-switch.on-light button[aria-pressed="true"] { color: var(--pm-ink); box-shadow: 0 1px 2px rgba(20, 32, 51, 0.08); }

/* --- Page header --- */
.app-main h1, .plain-main h1 { font-size: clamp(1.5rem, 1.15rem + 1.2vw, 1.875rem); letter-spacing: -0.02em; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 16px; margin-bottom: 20px; }
.page-head h1 { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.page-sub { color: var(--pm-muted); font-size: 14px; margin: 4px 0 0; }
.page-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.section-title { font-size: 18px; font-weight: 800; margin: 0; }

.breadcrumb { --bs-breadcrumb-divider: "/"; --bs-breadcrumb-margin-bottom: 8px; font-size: 14px; color: var(--pm-muted); }
.breadcrumb a { font-weight: 600; text-decoration: none; }
/* Phones (picture A1, owner 23 Oct 2026): only the parent link, with an arrow, instead of the whole path. */
@media (max-width: 767.98px) {
  .breadcrumb-item { display: none; }
  .breadcrumb-item:nth-last-child(2) { display: block; padding-left: 0; }
  .breadcrumb-item:nth-last-child(2)::before { content: "← "; float: none; padding-right: 0; color: inherit; }
  /* An approval page keeps its place after the arrow (picture D): "← Approvals · 1 of 3". */
  .breadcrumb.keep-place .breadcrumb-item.active { display: block; padding-left: 6px; }
  .breadcrumb.keep-place .breadcrumb-item.active::before { content: "· "; float: none; padding-right: 0; }
}
/* An approval page's facts: who sent it on its own row first (picture D1). */
.facts > .wide { grid-column: 1 / -1; }
/* One status line under a document's title on phones (picture A3): badge plus a few words. */
.status-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: -8px 0 16px; font-size: 14px; color: var(--pm-muted); }
/* An approved DO on phones (picture B2): the four steps as one bar; tap it for who recorded each. */
.do-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; width: 100%; margin: -8px 0 12px; padding: 0; border: 0; background: none; font: inherit; text-align: center; }
.do-step { font-size: 12px; font-weight: 700; color: var(--pm-muted); line-height: 1.25; overflow-wrap: anywhere; }
.do-step i { display: block; height: 6px; border-radius: 999px; background: var(--pm-line-strong); margin-bottom: 6px; }
.do-step.done { color: var(--pm-ok); } .do-step.done i { background: var(--pm-ok); }
.do-step.next { color: var(--pm-navy); } .do-step.next i { background: var(--pm-butter); }
.do-step small { display: block; font-size: 11px; font-weight: 500; color: var(--pm-muted); }
.facts.do-steps-who, .do-steps-who { grid-template-columns: 1fr; gap: 8px; margin-bottom: 12px; }
/* An issued DO's three dates in one row (picture A3, 3 Dec 2026): DO date (issued), scheduled delivery (highlighted),
   actual delivery. */
.do-dates { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 0 0 12px; }
.do-date { background: var(--pm-surface); border: 1px solid var(--pm-line); border-radius: 10px; padding: 6px 8px; min-width: 0; }
.do-date.main { border-color: var(--pm-butter); background: var(--pm-butter-soft); }
.do-date dt { font-size: 11px; font-weight: 600; color: var(--pm-muted); line-height: 1.2; overflow-wrap: anywhere; }
.do-date dd { margin: 2px 0 0; font-size: 14px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.do-date small { display: block; font-size: 11px; font-weight: 500; color: var(--pm-muted); }
.pick-zone.gap { background: var(--pm-warn-bg); color: var(--pm-warn); }
/* A sales order's line once approved (picture 7 of 30 Oct; step 7e-iii): where its goods are, as one bar (an
   SVG, its parts' widths as attributes) with a legend: Delivered, On the way, Scheduled, Not decided yet, Closed. */
.so-split-cell { min-width: 220px; }
.so-bar { display: block; width: 100%; height: 10px; border-radius: 999px; overflow: hidden; background: var(--pm-line-soft); margin-top: 4px; }
.so-bar rect { fill: var(--so-part); }
.so-part-delivered { --so-part: var(--pm-ok); }
.so-part-on_the_way { --so-part: var(--pm-navy); }
.so-part-scheduled { --so-part: var(--pm-butter); }
.so-part-not_decided { --so-part: var(--pm-line-strong); }
.so-part-closed { --so-part: var(--pm-muted); }
/* Two columns, or one when a column would be under 130 px ("Not decided yet" on three lines on a folded phone,
   344 px, 30 Nov 2026). */
.so-legend { list-style: none; margin: 6px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(max(130px, calc((100% - 14px) / 2)), 1fr)); gap: 3px 14px; font-size: 13px; color: var(--pm-muted); }
.so-legend li { display: flex; align-items: center; gap: 6px; }
.so-legend li.whole { grid-column: 1 / -1; }
.so-legend b { margin-left: auto; white-space: nowrap; color: var(--pm-ink); }
.so-key { width: 10px; height: 10px; border-radius: 3px; flex: none; background: var(--so-part); }
.quiet-fold { font-size: 13px; }

/* --- Buttons --- */
.btn {
  --bs-btn-font-weight: 700;
  --bs-btn-padding-x: 1.125rem;
  --bs-btn-padding-y: 0.6rem;
  --bs-btn-border-radius: var(--pm-radius);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px;
}
.btn-sm { --bs-btn-padding-x: 0.75rem; --bs-btn-padding-y: 0.3rem; --bs-btn-border-radius: 9px; --bs-btn-font-size: 0.85rem; min-height: 34px; }
.btn-primary, .btn-success {
  --bs-btn-color: #FFFFFF; --bs-btn-bg: var(--pm-navy); --bs-btn-border-color: var(--pm-navy);
  --bs-btn-hover-color: #FFFFFF; --bs-btn-hover-bg: var(--pm-navy-dark); --bs-btn-hover-border-color: var(--pm-navy-dark);
  --bs-btn-active-color: #FFFFFF; --bs-btn-active-bg: var(--pm-navy-dark); --bs-btn-active-border-color: var(--pm-navy-dark);
  --bs-btn-disabled-color: #FFFFFF; --bs-btn-disabled-bg: var(--pm-navy); --bs-btn-disabled-border-color: var(--pm-navy);
  --bs-btn-focus-shadow-rgb: var(--pm-navy-rgb);
}
.btn-primary .icon, .btn-success .icon { color: var(--pm-butter); }
.btn-outline-primary, .btn-outline-secondary, .btn-light {
  --bs-btn-color: var(--pm-ink); --bs-btn-bg: var(--pm-surface); --bs-btn-border-color: var(--pm-line-strong);
  --bs-btn-hover-color: var(--pm-navy); --bs-btn-hover-bg: var(--pm-navy-soft); --bs-btn-hover-border-color: var(--pm-navy);
  --bs-btn-active-color: var(--pm-navy); --bs-btn-active-bg: var(--pm-navy-soft); --bs-btn-active-border-color: var(--pm-navy);
  --bs-btn-disabled-color: var(--pm-muted); --bs-btn-disabled-bg: var(--pm-surface); --bs-btn-disabled-border-color: var(--pm-line);
  --bs-btn-focus-shadow-rgb: var(--pm-navy-rgb);
}
.btn-outline-danger {
  --bs-btn-color: var(--pm-bad-text); --bs-btn-bg: var(--pm-surface); --bs-btn-border-color: #E8B4B8;
  --bs-btn-hover-color: var(--pm-bad); --bs-btn-hover-bg: var(--pm-bad-bg); --bs-btn-hover-border-color: var(--pm-bad-text);
  --bs-btn-active-color: var(--pm-bad); --bs-btn-active-bg: var(--pm-bad-bg); --bs-btn-active-border-color: var(--pm-bad-text);
}
.btn-danger {
  --bs-btn-bg: var(--pm-bad-text); --bs-btn-border-color: var(--pm-bad-text);
  --bs-btn-hover-bg: var(--pm-bad); --bs-btn-hover-border-color: var(--pm-bad);
  --bs-btn-active-bg: var(--pm-bad); --bs-btn-active-border-color: var(--pm-bad);
}
.btn-link-danger {
  --bs-btn-color: var(--pm-bad-text); --bs-btn-bg: transparent; --bs-btn-border-color: transparent;
  --bs-btn-hover-color: var(--pm-bad); --bs-btn-hover-bg: var(--pm-bad-bg); --bs-btn-hover-border-color: transparent;
  --bs-btn-active-color: var(--pm-bad); --bs-btn-active-bg: var(--pm-bad-bg); --bs-btn-active-border-color: transparent;
}

/* Big action buttons (Home) */
.action-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 24px; }
@media (max-width: 575.98px) { .action-grid { gap: 10px; } .action-button { min-height: 62px; padding: 10px 14px; } }
.action-button {
  display: flex; align-items: center; gap: 14px; min-height: 72px; padding: 14px 18px; border-radius: 16px;
  background: var(--pm-navy); color: #FFFFFF; text-decoration: none; font-weight: 700; font-size: 16px;
  border: 1px solid var(--pm-navy);
}
.action-button:hover, .action-button:focus-visible { background: var(--pm-navy-dark); color: #FFFFFF; }
.action-button .action-icon {
  width: 44px; height: 44px; border-radius: 12px; background: var(--pm-butter); color: #2A2200;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.action-button.outline { background: var(--pm-surface); color: var(--pm-ink); border-color: var(--pm-line-strong); }
.action-button.outline:hover, .action-button.outline:focus-visible { background: var(--pm-navy-soft); color: var(--pm-navy); }
.action-button.outline .action-icon { background: var(--pm-navy-soft); color: var(--pm-navy); }

/* --- Cards --- */
.card {
  --bs-card-border-color: var(--pm-line);
  --bs-card-border-radius: var(--pm-radius-card);
  --bs-card-inner-border-radius: calc(var(--pm-radius-card) - 1px);
  --bs-card-cap-bg: transparent;
  --bs-card-cap-padding-y: 1rem;
  --bs-card-cap-padding-x: 1.25rem;
  --bs-card-spacer-x: 1.25rem;
  --bs-card-spacer-y: 1.1rem;
  background: var(--pm-surface);
}
.card.shadow-sm, .shadow-sm { box-shadow: 0 1px 2px rgba(20, 32, 51, 0.04) !important; }
.card:has(> .table-responsive), .card:has(> .list-group) { overflow: hidden; }
.card-header { font-weight: 800; font-size: 1.05rem; border-bottom-color: var(--pm-line-soft); }
.card-footer { background: transparent; border-top-color: var(--pm-line-soft); }
.list-group { --bs-list-group-border-color: var(--pm-line-soft); --bs-list-group-item-padding-x: 1.25rem; --bs-list-group-item-padding-y: 0.8rem; }
/* Tappable rows (the Approvals list) in the normal text colour: Bootstrap's grey made them look faded (trial run, 23 Oct 2026). */
.list-group { --bs-list-group-action-color: var(--pm-ink); --bs-list-group-action-hover-color: var(--pm-ink); }

/* Summary cards with a large number (Home) */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card {
  background: var(--pm-surface); border: 1px solid var(--pm-line); border-radius: var(--pm-radius-card);
  padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; color: inherit; text-decoration: none; min-width: 0;
}
a.stat-card:hover, a.stat-card:focus-visible { border-color: var(--pm-line-strong); box-shadow: 0 4px 14px rgba(14, 36, 66, 0.06); color: inherit; }
/* A card that opens a list shows it can be tapped, the same on every card (trial run finding 57). */
a.stat-card { position: relative; padding-right: 36px; }
a.stat-card::after { content: "›"; position: absolute; right: 14px; bottom: 10px; font-size: 26px; line-height: 1; color: var(--pm-navy); }
.stat-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.stat-label { font-size: 14px; font-weight: 600; color: var(--pm-ink-2); }
.stat-icon { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--pm-navy-soft); color: var(--pm-navy); }
.stat-icon.warn { background: var(--pm-warn-bg); color: var(--pm-warn); }
.stat-icon.bad { background: var(--pm-bad-bg); color: var(--pm-bad); }
.stat-icon.ok { background: var(--pm-ok-bg); color: var(--pm-ok); }
.stat-number { font-size: 44px; font-weight: 800; line-height: 1.05; letter-spacing: -0.02em; color: var(--pm-navy); }
.stat-note { font-size: 13px; color: var(--pm-muted); }
@media (max-width: 991.98px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat-number { font-size: 34px; }
  .stat-card { padding: 14px; }
}
/* Phones (overnight piece 13): the cards' icons give their room to the label ("Expiring within 30 days" was
   three lines at 360 px in English). */
@media (max-width: 575.98px) { .stat-icon { display: none; } }

/* Simple rows inside a card (recent documents, needs attention) */
.row-list { list-style: none; margin: 0; padding: 0; }
.row-list > li { border-top: 1px solid var(--pm-line-soft); }
.row-list > li:first-child { border-top: 0; }
.row-link { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 20px; color: inherit; text-decoration: none; }
a.row-link:hover, a.row-link:focus-visible { background: #FBFAF6; color: inherit; }
.row-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.row-title { font-weight: 700; }
.row-title.doc { color: var(--pm-navy); font-weight: 800; }
.row-sub { font-size: 13px; color: var(--pm-muted); }
.row-empty { padding: 16px 20px; color: var(--pm-muted); font-size: 14px; }
.so-far > li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 20px; font-size: 14px; }
/* The PO's Received card as a checklist (the boss, 30 Oct 2026): a mark, the item with the day(s) it came,
   and how much of what was ordered. */
.check-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 20px; }
.check-row > .row-main { flex: 1 1 auto; }
.check-mark { flex: none; width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; border: 2px solid var(--pm-line); color: var(--pm-muted); }
.check-mark.check-done { background: var(--pm-navy); border-color: var(--pm-navy); color: #fff; }
.check-mark.check-part, .check-mark.check-over { border-color: var(--pm-butter); background: var(--pm-butter-soft); color: #5C4300; }
.check-mark.check-closed { background: var(--pm-surface-2); }
.check-qty { flex: none; text-align: right; font-weight: 700; white-space: nowrap; }
.check-qty small { display: block; font-weight: 400; color: var(--pm-muted); }
/* The Receive goods page: a PO's card opens the PO; its Receive goods button sits beside it, or under it on
   a phone (trial run finding 104). */
.receive-row { display: flex; flex-wrap: wrap; align-items: center; }
.receive-row > .row-link { flex: 1 1 60%; min-width: 0; }
.receive-button { flex: none; padding-right: 20px; }
.receive-draft { order: 3; flex-basis: 100%; padding: 0 20px 12px; }
@media (max-width: 575.98px) {
  .receive-row > .row-link { flex-basis: 100%; padding-bottom: 8px; }
  .receive-button { order: 4; flex-basis: 100%; padding: 0 20px 12px; }
}
/* On phones the badges go under the title, so the title and its line keep the width (BUILD-PLAN 8b notes). */
@media (max-width: 575.98px) {
  .row-link.badge-below { flex-wrap: wrap; justify-content: flex-start; row-gap: 6px; column-gap: 6px; }
  .row-link.badge-below > .row-main { flex-basis: 100%; }
}

/* Key facts of a document, side by side */
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px 20px; margin: 0; }
.facts > div { min-width: 0; }
.facts dt { font-size: 12px; font-weight: 700; color: var(--pm-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 2px; }
.facts dd { font-size: 15px; font-weight: 600; margin: 0; overflow-wrap: anywhere; }
.facts dd .small { font-weight: 400; }
@media (max-width: 575.98px) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; } .facts dd { font-size: 14px; } }
/* A long value (the DO's Deliver to and its address) across the card on a phone, beside Customer on wider screens
   (BUILD-PLAN 8b, 10 Nov 2026: an address in a half-width column took 5-6 short lines). */
@media (max-width: 575.98px) { .facts > .wide-phone { grid-column: 1 / -1; } }

/* Forms (finding 43): a locked field as plain text; on phones the form card drops its frame, so the
   boxes use the full width instead of sitting inside two margins. */
.locked-value { font-size: 15px; font-weight: 600; padding: 2px 0; overflow-wrap: anywhere; }
@media (max-width: 575.98px) {
  .form-card { border: 0; background: transparent; box-shadow: none !important; }
  .form-card > .card-body { padding: 0 !important; }
}

/* Signed DO files (owner, 13 Oct 2026): small pictures on the DO page, large ones on the check page. */
.signed-files { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.signed-files-large { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.signed-files li { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.signed-files li > a:first-child { display: block; border: 1px solid var(--bs-border-color); border-radius: 8px; overflow: hidden; background: #fff; }
.signed-files img { display: block; width: 100%; height: 160px; object-fit: contain; }
.signed-files-large img { height: auto; max-height: 70vh; }
.signed-pdf { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; height: 160px; font-weight: 700; color: var(--pm-muted); }
/* Withdraw file (owner, 3 Nov 2026): the file shown before it is withdrawn; withdrawn ones crossed out. */
.withdraw-preview { max-height: 240px; width: auto; }
.withdrawn-files { list-style: none; margin: 0; padding: 0; }
.withdrawn-files li + li { margin-top: 6px; }

/* --- Tables --- */
.table {
  --bs-table-bg: transparent;
  --bs-table-border-color: var(--pm-line-soft);
  --bs-table-hover-bg: #FBFAF6;
  --bs-table-striped-bg: #FBFAF6;
  --bs-table-color: var(--pm-ink);
}
.table > thead th {
  background: var(--pm-surface-2); color: var(--pm-muted); font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 0; padding: 0.75rem 1rem; white-space: nowrap;
}
.table > tbody > tr > td, .table > tbody > tr > th { padding: 0.8rem 1rem; }
.table-sm > thead th { padding: 0.6rem 0.75rem; }
.table-sm > tbody > tr > td, .table-sm > tbody > tr > th { padding: 0.55rem 0.75rem; }
.table > :not(caption) > * > :first-child { padding-left: 1.25rem; }
.table > :not(caption) > * > :last-child { padding-right: 1.25rem; }
.table > tbody > tr:last-child > * { border-bottom: 0; }
.table td a:not(.btn) { font-weight: 700; text-decoration: none; }
.table td a.doc-link { font-weight: 800; }
.table-light { --bs-table-bg: var(--pm-surface-2); --bs-table-color: var(--pm-ink); --bs-table-border-color: var(--pm-line-soft); }
.table-warning { --bs-table-bg: var(--pm-butter-soft); --bs-table-color: #5C4300; --bs-table-border-color: #F4E6B8; }
.table-danger { --bs-table-bg: var(--pm-bad-bg); --bs-table-color: var(--pm-bad); }
/* A line's warning under a wide table of lines (GRN, transfer, adjustment, opening stock): wrapped to
   the width that shows, and kept in view while the table scrolls sideways on a phone (browser check,
   15 Oct 2026: it was as wide as the whole table). */
.line-table { container-type: inline-size; }
.line-table .row-warning { position: sticky; left: 1.25rem; max-width: calc(100cqi - 4.5rem); }
/* The stock overview (piece 6): the item column stays in view while the areas scroll sideways on a
   phone, and an opened item's details wrap to the width that shows. */
.overview-table td.item-cell, .overview-table thead th:first-child { position: sticky; left: 0; z-index: 1; }
.overview-table td.item-cell { background: var(--pm-surface); min-width: 9rem; max-width: 16rem; }
.overview-toggle { display: block; padding: 0; border: 0; text-align: left; color: var(--pm-navy); text-decoration: none; white-space: normal; }
.overview-toggle[aria-expanded="true"] { text-decoration: underline; }
/* A card folded on phones (Home's Recent documents): its header is the button, with an arrow. */
.fold-toggle { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 8px; padding: 0; border: 0; color: inherit; font: inherit; text-decoration: none; text-align: left; }
.fold-toggle::after { content: "▾"; color: var(--pm-muted); transition: transform 0.2s; }
.fold-toggle[aria-expanded="true"]::after { transform: rotate(180deg); }
/* The DO page by step (piece C): a short "More details" link, and a folded card's header buttons wait
   until it is opened (one tap away), so the folded card is one line. */
.fold-toggle.fold-inline { width: auto; justify-content: flex-start; gap: 4px; color: var(--pm-navy); font-size: 0.875rem; }
@media (max-width: 767.98px) {
  .card:has(> .collapse:not(.show)) .fold-hide { display: none !important; }
}
.line-table .row-detail { position: sticky; left: 1.25rem; max-width: calc(100cqi - 2.5rem); }
.overview-lot { padding: 2px 0; }
/* The Stock cost page (the picture of 23 Nov 2026): the total, then items opening to their batches. */
.cost-total { font-size: 26px; font-weight: 800; color: var(--pm-navy); line-height: 1.2; margin-top: 2px; }
.cost-split { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--pm-line); }
/* The total again under the list (the boss, 1 Dec 2026, finding 108): a navy rule above it. */
.cost-foot > * { border-top: 2px solid var(--pm-navy); border-bottom: 0; color: var(--pm-navy); }
.cost-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
/* An "Expired: IDR 217,930,708" badge may wrap after its label, or it pushes the table past a 360 px phone (23 Nov 2026). */
.cost-badges .badge { white-space: normal; text-align: left; }
/* On a phone the Where box gets its own line, so "All cold rooms" isn't cut; the date and Show (its magnifier, as
   on Stock on hand, below) share the next. */
@media (max-width: 575.98px) { .filter-bar .filter-select.cost-where { flex-basis: 100%; } }
.cost-batch { padding: 8px 0; border-top: 1px solid var(--pm-line); }
.cost-batch:first-child { border-top: 0; padding-top: 0; }
.cost-figures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 12px; margin: 4px 0; }
.cost-figures > span > .figure-label { display: block; }
.cost-from { margin-top: 6px; padding: 6px 8px; border-radius: 10px; background: var(--pm-line-soft); }
.cost-receipt + .cost-receipt { margin-top: 4px; padding-top: 4px; border-top: 1px dashed var(--pm-line-strong); }

/* Lists of documents become cards on phones and on tablets held upright, which also have the bottom tab
   bar (owner, 19 Oct 2026: nothing scrolls sideways there): each cell says what it is (data-label). */
@media (max-width: 991.98px) {
  .table-cards thead { display: none; }
  .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
  .table-cards tbody { padding: 8px; }
  .table-cards tbody tr { border: 1px solid var(--pm-line); border-radius: 14px; background: var(--pm-surface); margin-bottom: 8px; padding: 10px 14px; }
  .table-cards.table > tbody > tr > td { border: 0; padding: 2px 0 !important; text-align: left !important; }
  .table-cards td[data-label]:not([data-label=""])::before { content: attr(data-label) ": "; color: var(--pm-muted); font-size: 13px; }
  .table-cards td.card-title-cell { font-size: 15px; }
  .table-cards td.card-title-cell::before { content: none !important; }
  .table-cards tr.empty-row { border: 0; background: transparent; }
  .card:has(> .table-responsive > .table-cards) { background: transparent; border: 0; }
  /* The whole card opens the document (trial run finding 12, 20 Oct 2026: only its number did): the
     number's link covers the card, with an arrow; a tick box on the card stays on top of it. */
  .table-cards tbody tr:has(a.doc-link) { position: relative; }
  .table-cards tbody tr:has(a.doc-link):active { background: var(--pm-surface-2); }
  .table-cards a.doc-link::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: 14px; }
  .table-cards td.card-title-cell:has(a.doc-link) { padding-right: 24px !important; }
  .table-cards td.card-title-cell:has(a.doc-link)::after { content: "›"; position: absolute; right: 14px; top: 6px; font-size: 22px; color: var(--pm-muted); }
  .table-cards tbody tr input, .table-cards tbody tr button { position: relative; z-index: 2; }
  /* The DO list's tick (trial run finding 60): the card's whole left edge is the tick area. */
  .table-cards tbody tr:has(.tick-area) { padding-left: 52px; }
  .table-cards .tick-area { position: absolute; left: 0; top: 0; bottom: 0; width: 48px; z-index: 2; display: flex; align-items: center; justify-content: center; border-right: 1px solid var(--pm-line-soft); border-radius: 14px 0 0 14px; cursor: pointer; }
  .table-cards .tick-area .form-check-input { width: 22px; height: 22px; margin: 0 !important; }
  .table-cards tbody tr:has(.tick-area input:checked) { border-color: var(--pm-navy); background: var(--pm-navy-soft); }
  /* Only what tells the cards apart (finding 59): no empty rows, the status in one line. */
  .table-cards td.card-if-filled:has(> .empty-value) { display: none; }
  /* The audit log's card (overnight piece 16): the time small on top, then who and the action on one line. */
  .table-cards td.card-when { font-size: 13px; color: var(--pm-muted); }
  .table-cards.table > tbody > tr > td.card-inline { display: inline-block; width: auto; margin-right: 8px; }
}
.choose-count { font-size: 13px; color: var(--pm-muted); flex-basis: 100%; }
.mobile-action-bar:has(.choose-count) { flex-wrap: wrap; row-gap: 6px; }
/* The several-DOs bar shows once a DO is ticked (finding 60). */
form:not(:has(input[name="ids"]:checked)) .choose-bar { display: none; }

/* Lines of a GRN, transfer, adjustment or opening stock, and Stock on hand's items, become cards on
   phones (simplify pass piece B, 16 Oct 2026): one card per <tbody> (a line with its warnings, or an
   item with its lots). The item and quantity come first, the details flow on a line or two, the
   buttons last. Computers keep the table; tablets held upright get the cards too (19 Oct 2026). */
@media (max-width: 991.98px) {
  .group-cards thead { display: none; }
  .group-cards, .group-cards > tbody { display: block; width: 100%; }
  .group-cards > tbody { border: 1px solid var(--pm-line); border-radius: 14px; background: var(--pm-surface); margin-bottom: 8px; padding: 10px 14px; }
  .group-cards > tbody.empty-group { border: 0; background: transparent; }
  .group-cards > tbody.card-warn { border-color: var(--pm-butter); background: var(--pm-butter-soft); }
  .group-cards > tbody > tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; }
  .group-cards > tbody > tr + tr { margin-top: 6px; }
  .group-cards.table > tbody > tr > td { display: block; width: auto; max-width: 100%; border: 0; padding: 0 !important; text-align: left !important; background: transparent; box-shadow: none; }
  .group-cards.table > tbody > tr > td:empty { display: none; }
  .group-cards td[data-label]:not([data-label=""])::before { content: attr(data-label) ": "; color: var(--pm-muted); font-size: 13px; }
  .group-cards td.card-title-cell { order: -2; flex: 1 1 0; min-width: 50%; font-size: 15px; }
  .group-cards td.card-title-cell.card-full { flex-basis: 100%; }
  .group-cards.table > tbody > tr > td.card-qty { margin-left: auto; text-align: right !important; font-weight: 700; }
  .group-cards td.card-qty.card-top { order: -1; }
  .group-cards td.card-actions { flex-basis: 100%; padding-top: 4px !important; }
  .group-cards td.card-actions .card-button { width: 100%; }
  .group-cards.table > tbody > tr.table-warning > td { flex-basis: 100%; padding: 6px 10px !important; border-radius: 10px; background: var(--pm-butter-soft); color: #5C4300; }
  .group-cards .row-warning { position: static; max-width: none; }
  .group-cards tr.lot-row + tr.lot-row, .group-cards tr.table-light { border-top: 1px solid var(--pm-line-soft); padding-top: 6px; }
  .group-cards tr.table-light { flex-wrap: nowrap; background: transparent; }
  .group-cards > tbody > tr.table-light:only-child { border-top: 0; padding-top: 0; }
  .group-cards tr.table-light > td:first-child { flex: 1 1 0; }
  .card:has(> .table-responsive > .group-cards) { background: transparent; border: 0; }
  .card:has(> .table-responsive > .group-cards) > .card-header { background: transparent; border: 0; padding: 0 0 8px; }
  /* A list after the cards (the PO page's goods received) keeps a card of its own. */
  .card:has(> .table-responsive > .group-cards) > .row-list { background: var(--pm-surface); border: 1px solid var(--pm-line) !important; border-radius: 14px; }
}
/* Stock on hand on phones and tablets (owner, 19 Oct 2026): each item is one line, its stock by status,
   and a tap opens its lots; computers show every lot. */
.stock-table .item-summary .fold-toggle { gap: 12px; align-items: flex-start; }
/* The item code stays whole and the figures take the rest of the line (at most half): a long one ("2 CTN disimpan
   untuk pesanan") wraps there instead of squeezing the code into pieces ("PMS- / GRT- / 1KG"; 360 px look,
   29 Nov 2026). The main figure stays whole too. */
.stock-table .item-summary .stock-name { flex: 1 1 0%; }
.stock-table .item-summary .stock-figures { flex: 0 1 auto; max-width: 50%; }
.stock-table .item-summary .stock-figures > .fw-bold { white-space: nowrap; }
@media (max-width: 991.98px) {
  .stock-table tr.item-summary + tr.lot-row { border-top: 1px solid var(--pm-line-soft); padding-top: 6px; }
}
@media (min-width: 992px) {
  .stock-table > tbody > tr.lot-row.collapse:not(.show) { display: table-row; }
}
/* Stock on hand and the DO list beside the side menu (overnight piece 16, 24 Oct 2026): on narrower computer
   screens their headings and buttons wrap and the cells sit closer, instead of the table scrolling sideways. */
@media (min-width: 992px) and (max-width: 1399.98px) {
  .fit-beside-menu > thead th { white-space: normal; }
  .fit-beside-menu > thead th, .fit-beside-menu > tbody > tr > td { padding-left: 0.5rem; padding-right: 0.5rem; }
  .fit-beside-menu td.card-actions { white-space: normal !important; }
  .fit-beside-menu td.card-actions .btn { margin: 1px 0; }
  /* 24 Oct 2026 browser check: the DO list still scrolled up to 1,280 px; its status badges wrap and its
     Warehouse column waits for 1,200 px (do_list.html). */
  .fit-beside-menu > tbody > tr > td .badge { white-space: normal; text-align: start; }
}
/* A long heading over short figures wraps at any width, leaving the room to the item (opening stock's expiry
   and cost, 22 Nov 2026: in Indonesian they pushed Edit and Delete line off the screen). */
.table > thead th.th-wrap { white-space: normal; }
/* Below 1,100 px even that isn't enough: the customer PO and invoice no. may break inside (only here, as it
   lets the browser squeeze them on wider screens too). */
@media (min-width: 992px) and (max-width: 1099.98px) {
  .fit-beside-menu td.break-codes { overflow-wrap: anywhere; }
}

/* --- Status pills --- */
.badge { --bs-badge-padding-x: 0.75em; --bs-badge-padding-y: 0.42em; --bs-badge-font-size: 0.75rem; --bs-badge-font-weight: 700; --bs-badge-border-radius: 999px; vertical-align: middle; }
.badge.text-bg-success { background-color: var(--pm-ok-bg) !important; color: var(--pm-ok) !important; }
.badge.text-bg-secondary { background-color: var(--pm-draft-bg) !important; color: var(--pm-draft) !important; }
.badge.text-bg-danger { background-color: var(--pm-bad-bg) !important; color: var(--pm-bad) !important; }
.badge.text-bg-warning { background-color: var(--pm-warn-bg) !important; color: var(--pm-warn) !important; }
.badge.text-bg-info, .badge.text-bg-primary { background-color: var(--pm-navy-soft) !important; color: var(--pm-navy) !important; }
.badge.text-bg-light { background-color: var(--pm-surface-2) !important; color: var(--pm-ink-2) !important; }
.badge.text-bg-dark { background-color: var(--pm-navy) !important; color: #FFFFFF !important; }
h1 .badge { font-size: 13px; letter-spacing: 0; }

/* Zone tags and the pick list on a DO */
.zone-tag { display: inline-block; font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 6px; background: var(--pm-ambient-bg); color: var(--pm-ambient); }
.zone-tag.frozen { background: var(--pm-frozen-bg); color: var(--pm-frozen); }
.zone-tag.chilled { background: var(--pm-chilled-bg); color: var(--pm-chilled); }
.pick-zone { border-radius: 14px; background: var(--pm-ambient-bg); color: var(--pm-ambient); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.pick-zone.frozen { background: var(--pm-frozen-bg); color: var(--pm-frozen); }
.pick-zone.chilled { background: var(--pm-chilled-bg); color: var(--pm-chilled); }
.pick-zone-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-weight: 800; }
.pick-zone-head .small { font-weight: 700; }
.pick-row { background: var(--pm-surface); color: var(--pm-ink); border-radius: 10px; padding: 9px 12px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pick-row .row-main { min-width: 0; }
.pick-qty { font-size: 17px; font-weight: 800; color: var(--pm-navy); white-space: nowrap; }
.pick-row.flagged { box-shadow: inset 4px 0 0 var(--pm-bad-text); }
.pick-flag { font-size: 12px; font-weight: 700; color: var(--pm-bad); }
.pick-zone.short { background: var(--pm-bad-bg); color: var(--pm-bad); }

/* DO lines as cards */
.line-card { background: var(--pm-surface); border: 1px solid var(--pm-line); border-radius: var(--pm-radius-card); overflow: hidden; }
.line-card + .line-card { margin-top: 12px; }
.line-head { padding: 14px 20px; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.line-code { font-size: 12px; font-weight: 700; color: var(--pm-muted); }
.line-name { font-size: 17px; font-weight: 800; }
.line-qty { text-align: right; white-space: nowrap; }
.line-qty-main { font-size: 22px; font-weight: 800; color: var(--pm-navy); line-height: 1.2; }
.line-qty-base { font-size: 12px; color: var(--pm-muted); }
/* The selling price (owner, 20 Oct 2026): label above value, as on the approval pages. */
.line-price { padding: 0 20px 12px; display: flex; flex-wrap: wrap; gap: 8px 28px; }
.line-price > span { display: flex; flex-direction: column; }
.do-total { margin-top: 12px; padding: 14px 20px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; font-weight: 800; background: var(--pm-surface); border: 1px solid var(--pm-line); border-radius: var(--pm-radius-card); }
/* Plan a delivery, "What goes on this truck" (step 7c-ii): one block per line of the sales order. */
.plan-line { padding: 12px 0; border-top: 1px solid var(--pm-line-soft); }
.plan-line:last-of-type { border-bottom: 1px solid var(--pm-line-soft); margin-bottom: 12px; }
.plan-unit { flex: 0 0 110px; }
.line-batches-wrap { overflow-x: auto; }
.line-batches td.batch-no { white-space: nowrap; }
.line-batches { width: 100%; border-collapse: collapse; font-size: 14px; }
.line-batches th { background: var(--pm-surface-2); color: var(--pm-muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 8px 12px; white-space: nowrap; }
.line-batches td { border-top: 1px solid var(--pm-line-soft); padding: 10px 12px; }
.line-batches th:first-child, .line-batches td:first-child { padding-left: 20px; }
.line-batches th:last-child, .line-batches td:last-child { padding-right: 20px; }
.line-note { margin: 10px 20px 0; padding: 10px 14px; border-radius: 12px; font-size: 13px; }
.line-note.warn { background: var(--pm-bad-bg); color: #8A1A24; }
.line-note.caution { background: var(--pm-butter-soft); color: #5C4300; } /* worth a look, never blocks: the price warnings (owner, 23 Oct 2026) */
.line-note.info { background: var(--pm-surface-2); color: var(--pm-ink-2); }
.line-actions { padding: 12px 20px 14px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.line-actions form { margin: 0; }
.days-pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--pm-ok-bg); color: var(--pm-ok); white-space: nowrap; }
.days-pill.short { background: var(--pm-bad-bg); color: var(--pm-bad); }
@media (max-width: 575.98px) {
  .line-head { padding: 12px 14px; }
  .line-price { padding: 0 14px 10px; }
  .do-total { padding: 12px 14px; }
  .line-note { margin: 8px 14px 0; }
  .line-actions { padding: 10px 14px 12px; }
}
/* The batches as the phone's lines up to 767 px: the five columns are about 700 px wide and scrolled sideways on an
   opened folding phone (Galaxy Z Fold 4, about 690 px; 30 Nov 2026). */
@media (max-width: 767.98px) {
  .line-batches thead { display: none; }
  .line-batches, .line-batches tbody, .line-batches tr { display: block; }
  .line-batches tr { border-top: 1px solid var(--pm-line-soft); padding: 8px 20px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
  .line-batches td { border: 0; padding: 0 !important; }
  /* The batch on one line: batch, expiry, zone, days left (picture A5, owner 23 Oct 2026). */
  .line-batches td.batch-no { font-weight: 700; }
  .line-batches td.qty-once { display: none; }
  /* Once the goods have left (picture C4): the days left no longer matter. */
  .goods-left .line-batches td.days-left { display: none; }
}
@media (max-width: 575.98px) {
  .line-batches tr { padding: 8px 14px; }
}

/* --- Alerts --- */
.alert { --bs-alert-border-radius: 14px; --bs-alert-padding-x: 1rem; --bs-alert-padding-y: 0.75rem; font-size: 14px; }
.alert-info { --bs-alert-bg: var(--pm-navy-soft); --bs-alert-color: var(--pm-navy); --bs-alert-border-color: #C9D7EA; --bs-alert-link-color: var(--pm-navy-dark); }
.alert-secondary { --bs-alert-bg: var(--pm-surface-2); --bs-alert-color: var(--pm-ink-2); --bs-alert-border-color: var(--pm-line); }
.alert-warning { --bs-alert-bg: var(--pm-butter-soft); --bs-alert-color: #5C4300; --bs-alert-border-color: #F1DB98; --bs-alert-link-color: #5C4300; }
.alert-danger { --bs-alert-bg: var(--pm-bad-bg); --bs-alert-color: #8A1A24; --bs-alert-border-color: #F2C2C6; }
.alert-success { --bs-alert-bg: var(--pm-ok-bg); --bs-alert-color: #134F30; --bs-alert-border-color: #BFE0CB; }

/* --- Forms --- */
.form-label { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.required-mark { color: var(--pm-bad-text); font-weight: 700; margin-left: 3px; }
.form-control, .form-select {
  border-color: var(--pm-line-strong); border-radius: var(--pm-radius); min-height: 46px; background-color: var(--pm-surface);
}
.form-control-sm, .form-select-sm { min-height: 36px; border-radius: 9px; }
textarea.form-control { min-height: 0; }
.form-control:focus, .form-select:focus, .form-check-input:focus {
  border-color: var(--pm-navy); box-shadow: 0 0 0 0.2rem rgba(var(--pm-navy-rgb), 0.18);
}
/* Tick boxes and round choices with a clear dark outline (trial run finding 22, 20 Oct 2026: the thin
   light-grey one couldn't be seen on the cream background). */
.form-check-input { border: 2px solid var(--pm-ink-2); }
.form-check-input:checked { background-color: var(--pm-navy); border-color: var(--pm-navy); }
.form-text { color: var(--pm-muted); }
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.filter-bar .filter-search { flex: 1 1 260px; max-width: 420px; }
.filter-bar .filter-select { flex: 0 1 200px; }
@media (max-width: 575.98px) { .filter-bar .filter-search { max-width: none; flex-basis: 100%; } .filter-bar .filter-select { flex: 1 1 140px; } }
/* Document lists on phones (trial run findings 14 and 59, overnight piece 9): the search box and Search stay,
   the other filters one "Filter" tap away (open when one is in use); computers and tablets show them all. */
.filter-bar .filter-toggle { display: none; }
@media (max-width: 767.98px) {
  .filter-bar:has(.filter-more) .filter-search { flex: 1 1 0; min-width: 0; }
  .filter-bar .filter-toggle { display: inline-flex; }
  .filter-bar .filter-more { flex-basis: 100%; }
  .filter-bar .filter-more.show, .filter-bar .filter-more.collapsing { display: flex; flex-wrap: wrap; gap: 10px; }
  .filter-bar .filter-more .filter-select { flex: 1 1 140px; }
}
/* Small phones: Search (Stock on hand's Show) is its magnifier only, so the search box isn't squeezed to a few
   letters beside "Cari"/"Tampilkan" and "Saring" (24 Oct 2026 browser check: 75 px on Stock on hand). The word
   stays for screen readers. */
@media (max-width: 575.98px) {
  .filter-bar:has(.filter-more) .filter-submit-label, .filter-bar:has(.cost-where) .filter-submit-label {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
  }
}
@media (min-width: 768px) {
  .filter-bar .filter-more, .filter-bar .filter-more.collapse:not(.show) { display: contents; }
  .filter-bar .filter-submit { order: 1; }  /* Search last, after the filters, as before */
}
/* Stock on hand's lots on phones and tablets (the owner's try, 4 Dec 2026, finding 11): every lot on the same fixed
   lines, so the eye finds each figure in one place: the batch with its quantity on the right; the expiry with the
   base units; warehouse / zone and the status; its notes ("on draft transfer", "reserved for DO-… (customer)",
   "kept for …") whole, wrapping, on a line of their own (no longer cut short with "…"); then the buttons. Only an
   opened lot (.show): a closed one stays hidden. */
@media (max-width: 991.98px) {
  .stock-table > tbody > tr.lot-row.show {
    display: grid; grid-template-columns: max-content minmax(0, 1fr) auto; column-gap: 12px; row-gap: 2px;
    align-items: baseline;
  }
  .stock-table tr.lot-row > td.lot-batch { grid-column: 1 / 3; grid-row: 1; }
  .stock-table tr.lot-row > td.lot-expiry { grid-column: 1 / 3; grid-row: 2; }
  .stock-table tr.lot-row > td.card-qty { grid-column: 3; grid-row: 1 / 3; margin-left: 0; }
  .stock-table tr.lot-row > td.lot-place { grid-column: 1; grid-row: 3; }
  .stock-table tr.lot-row > td.lot-status { grid-column: 2; grid-row: 3; }
  .stock-table tr.lot-row > td.lot-notes { grid-column: 1 / -1; }
  .stock-table tr.lot-row > td.card-actions { grid-column: 1 / -1; }
  /* The expiry report's cards the same way: the item and quantity; the batch; the expiry and days left; warehouse /
     zone and the status (the badges one above the other). */
  .expiry-table > tbody > tr.lot-line {
    display: grid; grid-template-columns: max-content minmax(0, 1fr) auto; column-gap: 12px; row-gap: 2px;
    align-items: baseline;
  }
  .expiry-table tr.lot-line > td.card-title-cell { grid-column: 1 / 3; grid-row: 1; min-width: 0; }
  .expiry-table tr.lot-line > td.card-qty { grid-column: 3; grid-row: 1; margin-left: 0; }
  .expiry-table tr.lot-line > td.lot-batch { grid-column: 1 / -1; grid-row: 2; }
  .expiry-table tr.lot-line > td.lot-expiry { grid-column: 1; grid-row: 3; }
  .expiry-table tr.lot-line > td.lot-days { grid-column: 2 / -1; grid-row: 3; }
  .expiry-table tr.lot-line > td.lot-place { grid-column: 1; grid-row: 4; }
  .expiry-table tr.lot-line > td.lot-status { grid-column: 2 / -1; grid-row: 4; }
}

/* --- Pagination --- */
.pagination {
  --bs-pagination-color: var(--pm-navy); --bs-pagination-border-color: var(--pm-line-strong);
  --bs-pagination-hover-bg: var(--pm-navy-soft); --bs-pagination-hover-color: var(--pm-navy);
  --bs-pagination-active-bg: var(--pm-navy); --bs-pagination-active-border-color: var(--pm-navy);
  --bs-pagination-disabled-color: var(--pm-muted); --bs-pagination-disabled-bg: var(--pm-surface);
  --bs-pagination-border-radius: 10px; font-weight: 600;
  /* "Previous · page 2 of 9 · Next" is about 320 px in Indonesian: it wraps on a folded phone (344 px, 30 Nov 2026). */
  flex-wrap: wrap; row-gap: 6px;
}

/* --- Dropdowns --- */
.dropdown-menu { --bs-dropdown-border-color: var(--pm-line); --bs-dropdown-border-radius: 12px; --bs-dropdown-link-active-bg: var(--pm-navy); box-shadow: 0 8px 24px rgba(14, 36, 66, 0.12); }

/* --- Pages without the menu (log in, two-step, errors) --- */
.plain-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px; max-width: 1240px; margin: 0 auto; width: 100%; }
.plain-top .brand { color: var(--pm-ink); }
.plain-top .brand-sub { color: var(--pm-muted); opacity: 1; }
.plain-account { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.plain-account form { margin: 0; }
/* These pages are already a narrow column: their own column sizes would make them narrower still. */
.plain-main .row > * { flex: 0 0 auto; width: 100%; max-width: 100%; }
.plain-main .card-body { padding: 1.75rem !important; }

/* A heading inside a form card is smaller than a page title. */
.app-main .card h1, .plain-main .card h1 { font-size: 1.5rem; }

/* --- Approval (owner, 7 Oct 2026): waiting label, the approval page's lines and stock chips --- */
.badge-waiting { background: var(--pm-butter-soft); color: var(--pm-warn); border: 1px solid var(--pm-butter); font-weight: 700; }
.approval-line { padding: 12px 0; border-bottom: 1px solid var(--pm-line-soft); }
.approval-line:first-child { padding-top: 0; }
.approval-line-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; }
.approval-figures { display: flex; gap: 16px; text-align: right; }
.approval-figures > span { display: flex; flex-direction: column; }
.figure-label { font-size: 11px; color: var(--pm-muted); font-weight: 600; }
.price-up { color: var(--pm-warn); font-weight: 700; }
.stock-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.stk { background: var(--pm-line-soft); color: var(--pm-ink); border-radius: 8px; padding: 3px 8px; font-size: 12.5px; }
.stk-warn { background: var(--pm-warn-bg); color: var(--pm-warn); }
.stk-note { color: var(--pm-muted); }
.approval-total { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; padding-top: 12px; font-weight: 700; }
.approval-row { display: flex; align-items: center; gap: 12px; }
.approval-row-icon { color: var(--pm-muted); }
.approval-row .row-main { flex: 1; min-width: 0; }
.approval-row-who { min-width: 84px; }
.po-total th, .po-total td { border-bottom: 0; }
@media (max-width: 575.98px) {
  /* Five figures (quantity, batch, expiry, zone, status) don't fit one phone row: wrap them whole. */
  .approval-figures { width: 100%; flex-wrap: wrap; justify-content: flex-start; gap: 8px 20px; text-align: left; }
  .approval-figures > span { white-space: nowrap; }
  /* Trial run finding 6 (20 Oct 2026): the title was squeezed letter by letter beside the badges. On a
     phone it takes the whole line beside the icon (20 px + the 12 px gap); the badges and who sent it go
     below, under the title. */
  .approval-row { flex-wrap: wrap; row-gap: 6px; }
  .approval-row .row-main { flex-basis: calc(100% - 32px); }
  .approval-row .row-main + .badge { margin-left: 32px; }
  .approval-row-who { margin-left: auto; }
  /* The same on Home's rows with who sent it: the title on its own line, "name · time" below it. */
  .row-link:has(> .row-who) { flex-wrap: wrap; row-gap: 2px; }
  .row-link:has(> .row-who) > .row-main { flex-basis: 100%; }
  .row-link > .row-who { text-align: left !important; font-size: 13px; }
  .row-link > .row-who > .d-block { display: inline !important; }
  .row-link > .row-who > .d-block::before { content: " · "; }
}

/* The Help page (step 9 piece 6, owner, 19 Oct 2026): each task one line, tapped open to its steps. */
.help-rule { padding: 10px 14px; margin-bottom: 20px; border-left: 4px solid var(--pm-butter); border-radius: 6px; background: var(--pm-butter-soft); font-weight: 600; }
.help-page { margin-bottom: 28px; }
.help-intro { color: var(--pm-muted); margin-bottom: 8px; }
.help-task { border-bottom: 1px solid var(--pm-line); background: var(--pm-surface); }
.help-task:first-of-type { border-top: 1px solid var(--pm-line); }
.help-task > summary { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 4px; font-weight: 600; cursor: pointer; list-style: none; }
.help-task > summary::-webkit-details-marker { display: none; }
.help-task > summary::after { content: "▾"; color: var(--pm-muted); transition: transform 0.2s; }
.help-task[open] > summary::after { transform: rotate(180deg); }
.help-steps { padding: 0 4px 14px; }
.help-steps ol, .help-steps ul { padding-left: 1.3rem; margin-bottom: 8px; }
.help-steps li { margin-bottom: 6px; }
.help-steps p { margin-bottom: 8px; }
.help-steps p:last-child, .help-steps ol:last-child, .help-steps ul:last-child { margin-bottom: 0; }
.help-others { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 0; list-style: none; }