/* =====================================================================
   MPS WAREHOUSE INVENTORY — APPLICATION DESIGN SYSTEM
   ---------------------------------------------------------------------
   Loaded after Bootstrap 5.3.3 on every signed-in page.
   1. Tokens          6. Forms            11. Status & badges
   2. Base            7. Buttons          12. Modals & toasts
   3. Shell/sidebar   8. Tables           13. Page-specific
   4. Top bar         9. Workflow boxes   14. Dashboard
   5. Page header    10. Alerts           15. Motion / responsive
   ===================================================================== */

/* ---------------------------------------------------------------------
   1. TOKENS
--------------------------------------------------------------------- */
:root {
    --mps-blue: #202d88;
    --mps-blue-600: #1a2575;
    --mps-blue-700: #151d5f;
    --mps-blue-050: #eef0fa;
    --mps-blue-100: #dde1f4;
    --mps-navy: #121850;
    --mps-navy-2: #0c1140;
    --mps-red: #962527;
    --mps-red-600: #7f1d20;
    --mps-red-050: #fbeeee;
    --mps-black: #111111;
    --mps-silver: #b8bcc7;
    --mps-white: #ffffff;

    --ink: #15171f;
    --ink-2: #3b4152;
    --muted: #646b7d;
    --line: #e2e5ec;
    --line-2: #d3d7e1;
    --surface: #f2f3f7;
    --surface-2: #f8f9fb;
    --card: #ffffff;

    --ok: #1f7a4d;
    --ok-050: #e8f5ee;
    --warn: #9a6200;
    --warn-050: #fdf4e3;
    --info: #1d5e9e;
    --info-050: #e9f2fb;

    --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --font-display: "Archivo", "Inter", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;

    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;
    --shadow-1: 0 1px 2px rgba(17, 24, 64, .06), 0 1px 1px rgba(17, 24, 64, .04);
    --shadow-2: 0 6px 18px -8px rgba(17, 24, 64, .18), 0 2px 4px rgba(17, 24, 64, .05);
    --shadow-3: 0 24px 60px -20px rgba(12, 17, 64, .35);

    --sbw: 264px;
    --sbw-collapsed: 78px;
    --topbar-h: 68px;
    --ease: cubic-bezier(.2, .7, .2, 1);
}

html.mps-sb-collapsed { --sbw: var(--sbw-collapsed); }

/* ---------------------------------------------------------------------
   2. BASE
--------------------------------------------------------------------- */
html { scroll-padding-top: calc(var(--topbar-h) + 16px); }

body.mps-app {
    margin: 0;
    min-height: 100vh;
    background: var(--surface);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 14.5px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

body.mps-app h1, body.mps-app h2, body.mps-app h3,
body.mps-app h4, body.mps-app h5, body.mps-app h6 {
    font-family: var(--font-display);
    color: var(--ink);
    letter-spacing: -.01em;
}

body.mps-app a { color: var(--mps-blue); text-underline-offset: 3px; }
body.mps-app a:hover { color: var(--mps-blue-700); }
body.mps-app .text-muted { color: var(--muted) !important; }
body.mps-app hr { border-color: var(--line-2); opacity: 1; }
body.mps-app ::selection { background: var(--mps-blue-100); }

body.mps-app :focus-visible {
    outline: 3px solid rgba(32, 45, 136, .45);
    outline-offset: 2px;
}

.mps-num, .stat-number, .mps-ledger__value {
    font-family: var(--font-display);
    font-variant-numeric: tabular-nums;
}

.mps-skip {
    position: fixed;
    left: 12px;
    top: -60px;
    z-index: 2000;
    background: var(--mps-blue);
    color: #fff !important;
    padding: 10px 14px;
    border-radius: var(--r-sm);
    font-weight: 600;
    text-decoration: none;
    transition: top .2s var(--ease);
}
.mps-skip:focus { top: 12px; }

/* ---------------------------------------------------------------------
   3. SHELL — SIDEBAR
--------------------------------------------------------------------- */
.mps-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sbw);
    z-index: 1040;
    display: flex;
    flex-direction: column;
    color: #e7e9f6;
    background:
        radial-gradient(120% 60% at 0% 0%, rgba(80, 96, 210, .28), transparent 60%),
        linear-gradient(180deg, var(--mps-navy) 0%, var(--mps-navy-2) 100%);
    border-right: 1px solid rgba(255, 255, 255, .06);
    transition: width .28s var(--ease), transform .3s var(--ease);
}

.mps-sidebar__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 18px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    min-height: var(--topbar-h);
}
.mps-sidebar__logo {
    width: 50px;
    height: 50px;
    flex: 0 0 44px;
    border-radius: 50%;
    background: #fff;
    padding: 2px;
    object-fit: contain;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .08);
}
.mps-sidebar__brandtext { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; white-space: nowrap; }
.mps-sidebar__brandtext strong { font-family: var(--font-display); font-size: 16px; color: #fff; letter-spacing: -.01em; }
.mps-sidebar__brandtext span { font-size: 12px; color: var(--mps-silver); }
.mps-sidebar__close {
    display: none;
    margin-left: auto;
    width: 36px; height: 36px;
    border-radius: var(--r-sm);
    border: 1px solid rgba(255, 255, 255, .18);
    background: transparent;
    color: #fff;
}

.mps-nav {
    position: relative;
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px 12px 16px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .2) transparent;
}
.mps-nav__group + .mps-nav__group { margin-top: 10px; }
.mps-nav__label {
    font-size: 11.5px;
    font-weight: 600;
    color: rgba(184, 188, 199, .75);
    padding: 10px 12px 6px;
    white-space: nowrap;
}

.mps-nav__link {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    height: 42px;
    padding: 0 12px;
    margin: 2px 0;
    border-radius: 10px;
    color: #d6d9ec !important;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
    transition: background-color .18s ease, color .18s ease;
}
.mps-nav__link i { font-size: 18px; width: 22px; text-align: center; flex: 0 0 22px; transition: transform .2s var(--ease); }
.mps-nav__link span { overflow: hidden; text-overflow: ellipsis; }
.mps-nav__link:hover { background: rgba(255, 255, 255, .07); color: #fff !important; }
.mps-nav__link:hover i { transform: translateX(2px); }
.mps-nav__link.is-active { color: #fff !important; background: rgba(255, 255, 255, .11); font-weight: 600; }

/* gliding active indicator (positioned by JS; falls back to the bar below) */
.mps-nav__indicator {
    position: absolute;
    left: 4px;
    width: 4px;
    height: 24px;
    border-radius: 4px;
    background: #e0474a;
    box-shadow: 0 0 12px rgba(224, 71, 74, .65);
    opacity: 0;
    transform: translateY(0);
    transition: transform .35s var(--ease), opacity .2s ease;
    z-index: 2;
    pointer-events: none;
}
.mps-nav.has-indicator .mps-nav__indicator { opacity: 1; }
html:not(.mps-js) .mps-nav__link.is-active::before {
    content: "";
    position: absolute;
    left: -8px; top: 9px; bottom: 9px;
    width: 4px;
    border-radius: 4px;
    background: #e0474a;
}

.mps-sidebar__foot {
    padding: 12px;
    border-top: 1px solid rgba(255, 255, 255, .08);
}
.mps-sidebar__user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .05);
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
}
.mps-sidebar__who { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.mps-sidebar__who strong { color: #fff; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; }
.mps-sidebar__who span { color: var(--mps-silver); font-size: 12px; }
.mps-nav__link--logout:hover { background: rgba(150, 37, 39, .35); }

.mps-avatar {
    display: inline-grid;
    place-items: center;
    width: 34px; height: 34px;
    flex: 0 0 34px;
    border-radius: 50%;
    background: linear-gradient(140deg, #3a49b8, var(--mps-blue));
    color: #fff;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: .02em;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .18);
}

/* collapsed (desktop) */
html.mps-sb-collapsed .mps-sidebar__brandtext,
html.mps-sb-collapsed .mps-nav__label,
html.mps-sb-collapsed .mps-nav__link span,
html.mps-sb-collapsed .mps-sidebar__who { opacity: 0; width: 0; pointer-events: none; }
html.mps-sb-collapsed .mps-nav__label { height: 10px; padding: 0; overflow: hidden; }
html.mps-sb-collapsed .mps-nav__group + .mps-nav__group { border-top: 1px solid rgba(255, 255, 255, .08); padding-top: 8px; }
html.mps-sb-collapsed .mps-sidebar__brand { padding-left: 17px; }
html.mps-sb-collapsed .mps-nav__link { justify-content: center; padding: 0; gap: 0; }
html.mps-sb-collapsed .mps-sidebar__user { justify-content: center; padding: 8px 0; background: transparent; }

.mps-tip {
    position: fixed;
    z-index: 2100;
    background: var(--ink);
    color: #fff;
    font-size: 12.5px;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: 6px;
    pointer-events: none;
    white-space: nowrap;
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity .15s ease, transform .15s ease;
    box-shadow: var(--shadow-2);
}
.mps-tip.is-on { opacity: 1; transform: translateX(0); }

.mps-scrim {
    position: fixed;
    inset: 0;
    z-index: 1035;
    background: rgba(12, 17, 64, .45);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
}

/* ---------------------------------------------------------------------
   4. TOP BAR
--------------------------------------------------------------------- */
.mps-topbar {
    position: fixed;
    top: 0;
    right: 0;
    left: var(--sbw);
    height: var(--topbar-h);
    z-index: 1030;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 24px 0 16px;
    background: rgba(255, 255, 255, .86);
    backdrop-filter: saturate(160%) blur(10px);
    -webkit-backdrop-filter: saturate(160%) blur(10px);
    border-bottom: 1px solid var(--line);
    transition: left .28s var(--ease), box-shadow .2s ease;
}
.mps-topbar.is-scrolled { box-shadow: 0 6px 20px -14px rgba(17, 24, 64, .45); }

.mps-iconbtn {
    display: inline-grid;
    place-items: center;
    width: 40px; height: 40px;
    flex: 0 0 40px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink-2);
    font-size: 18px;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.mps-iconbtn:hover { background: var(--mps-blue-050); border-color: var(--mps-blue-100); color: var(--mps-blue); }

.mps-topbar__titles { min-width: 0; flex: 1 1 auto; }
.mps-crumbs { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.mps-crumbs a { color: var(--muted) !important; text-decoration: none; }
.mps-crumbs a:hover { color: var(--mps-blue) !important; }
.mps-crumbs i { font-size: 10px; opacity: .7; }
.mps-topbar__title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 18px;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
}

.mps-quicksearch {
    position: relative;
    display: flex;
    align-items: center;
    width: min(320px, 28vw);
    margin: 0;
}
.mps-quicksearch > i { position: absolute; left: 12px; color: var(--muted); font-size: 14px; pointer-events: none; }
.mps-quicksearch input[type="search"] {
    width: 100%;
    height: 40px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    border-radius: 10px;
    padding: 0 38px 0 36px;
    font-size: 14px;
    color: var(--ink);
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.mps-quicksearch input[type="search"]:focus { outline: none; background: #fff; border-color: var(--mps-blue); box-shadow: 0 0 0 4px rgba(32, 45, 136, .12); }
.mps-quicksearch kbd {
    position: absolute;
    right: 9px;
    font-family: var(--font-body);
    font-size: 11px;
    color: var(--muted);
    background: #fff;
    border: 1px solid var(--line-2);
    border-radius: 5px;
    padding: 1px 6px;
    box-shadow: none;
}

.mps-clock { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; white-space: nowrap; }
.mps-clock span { font-size: 12px; color: var(--muted); }
.mps-clock strong { font-family: var(--font-display); font-size: 14px; font-variant-numeric: tabular-nums; color: var(--ink); }

.mps-usermenu { position: relative; }
.mps-usermenu__btn {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 12px;
    padding: 5px 8px 5px 5px;
    color: var(--ink);
    transition: background-color .15s ease, border-color .15s ease;
}
.mps-usermenu__btn:hover, .mps-usermenu.is-open .mps-usermenu__btn { background: #fff; border-color: var(--line); }
.mps-usermenu__who { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.mps-usermenu__who strong { font-size: 13.5px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mps-usermenu__who span { font-size: 12px; color: var(--muted); }
.mps-usermenu__btn > i { font-size: 12px; color: var(--muted); transition: transform .2s var(--ease); }
.mps-usermenu.is-open .mps-usermenu__btn > i { transform: rotate(180deg); }

.mps-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 240px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-3);
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px) scale(.98);
    transform-origin: top right;
    transition: opacity .16s ease, transform .18s var(--ease), visibility .16s;
    z-index: 1100;
}
.mps-usermenu.is-open .mps-menu { opacity: 1; visibility: visible; transform: none; }
.mps-menu__head { padding: 10px 12px 12px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.mps-menu__head strong { color: var(--ink); }
.mps-menu__head .mps-role { margin-top: 6px; }
.mps-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--ink-2) !important;
    text-decoration: none;
    font-weight: 500;
}
.mps-menu a:hover, .mps-menu a:focus-visible { background: var(--surface); color: var(--ink) !important; }
.mps-menu a.mps-menu__danger { color: var(--mps-red) !important; }
.mps-menu a.mps-menu__danger:hover { background: var(--mps-red-050); }

.mps-role {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    background: var(--surface);
    color: var(--ink-2);
}
.mps-role--admin { background: var(--mps-red-050); color: var(--mps-red); }
.mps-role--engineer { background: var(--info-050); color: var(--info); }
.mps-role--viewer { background: var(--mps-blue-050); color: var(--mps-blue); }

/* ---------------------------------------------------------------------
   MAIN CONTENT AREA
--------------------------------------------------------------------- */
body.mps-app .content {
    margin-left: var(--sbw);
    padding: calc(var(--topbar-h) + 28px) 32px 48px;
    min-height: 100vh;
    width: auto;
    max-width: none;
    color: var(--ink);
    transition: margin-left .28s var(--ease);
    animation: mps-page-in .45s var(--ease) both;
}
body.mps-app .content > * { max-width: 1480px; margin-left: auto; margin-right: auto; }

@keyframes mps-page-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------------
   5. PAGE HEADER + PANELS
--------------------------------------------------------------------- */
.mps-page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px 24px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}
.mps-page-head__text { display: flex; align-items: center; gap: 16px; min-width: 0; }
.mps-page-head__icon {
    display: grid;
    place-items: center;
    width: 48px; height: 48px;
    flex: 0 0 48px;
    border-radius: 14px;
    background: var(--mps-blue);
    color: #fff;
    font-size: 22px;
    box-shadow: 0 10px 20px -10px rgba(32, 45, 136, .7);
}
body.mps-app .mps-page-head__title { font-size: 26px; font-weight: 800; margin: 0; line-height: 1.15; }
.mps-page-head__sub { margin: 4px 0 0; color: var(--muted); max-width: 70ch; }
.mps-page-head__actions { display: flex; gap: 10px; flex-wrap: wrap; }

body.mps-app .container-box,
.mps-panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-1);
    padding: 26px 28px;
    margin-top: 0;
    margin-bottom: 24px;
    color: var(--ink);
    width: auto;
}
/* Pages render their own <h2> as the panel title */
body.mps-app .container-box > h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 18px;
}

.mps-section {
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 20px 22px;
    margin-bottom: 20px;
    background: #fff;
}
.mps-section__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.mps-section__title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 16.5px;
    margin: 0;
    color: var(--ink);
}
.mps-step {
    display: inline-grid;
    place-items: center;
    width: 26px; height: 26px;
    border-radius: 50%;
    background: var(--mps-blue);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}
.mps-section__hint { font-size: 13px; color: var(--muted); margin: 0; }

/* Filter toolbar (row of selects / search above tables) */
.mps-toolbar {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 14px 16px 6px;
    margin-bottom: 16px;
}
.mps-toolbar .form-label { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }

/* ---------------------------------------------------------------------
   6. FORMS
--------------------------------------------------------------------- */
body.mps-app .form-label { font-weight: 600; font-size: 13.5px; color: var(--ink-2); margin-bottom: 6px; }
body.mps-app .form-label .req,
.mps-req::after { color: var(--mps-red); font-weight: 700; }
.mps-req::after { content: " *"; }

body.mps-app .form-control,
body.mps-app .form-select {
    border: 1px solid var(--line-2);
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 14.5px;
    color: var(--ink);
    background-color: #fff;
    min-height: 42px;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
body.mps-app .form-select { padding-right: 36px; }
body.mps-app .form-control-sm { min-height: 34px; padding: 5px 10px; font-size: 13.5px; border-radius: 8px; }
body.mps-app textarea.form-control { min-height: 84px; }
body.mps-app .form-control::placeholder { color: #9aa0ae; }
body.mps-app .form-control:hover:not(:disabled):not([readonly]),
body.mps-app .form-select:hover:not(:disabled) { border-color: #b4bacb; }
body.mps-app .form-control:focus,
body.mps-app .form-select:focus {
    border-color: var(--mps-blue);
    box-shadow: 0 0 0 4px rgba(32, 45, 136, .12);
    outline: none;
}
body.mps-app .form-control:disabled,
body.mps-app .form-select:disabled,
body.mps-app .form-control[readonly] { background-color: var(--surface-2); color: var(--ink-2); }
body.mps-app .form-text, body.mps-app small.text-muted { font-size: 12.5px; }

body.mps-app .was-validated .form-control:invalid,
body.mps-app .form-control.is-invalid { border-color: #c23b3e; background-image: none; padding-right: 12px; }
body.mps-app .was-validated .form-select:invalid,
body.mps-app .form-select.is-invalid { border-color: #c23b3e; --bs-form-select-bg-icon: none; padding-right: 36px; }
body.mps-app .was-validated .form-control:invalid:focus,
body.mps-app .form-control.is-invalid:focus { box-shadow: 0 0 0 4px rgba(194, 59, 62, .14); }
body.mps-app .was-validated .form-control:valid { border-color: var(--line-2); background-image: none; padding-right: 12px; }
body.mps-app .was-validated .form-select:valid { border-color: var(--line-2); --bs-form-select-bg-icon: none; padding-right: 36px; }
.mps-field-error { display: none; color: #b0302f; font-size: 12.5px; margin-top: 5px; }
.mps-field-error i { margin-right: 4px; }
.was-validated :invalid ~ .mps-field-error,
.is-invalid ~ .mps-field-error { display: block; }

body.mps-app .input-group > .form-control { border-top-right-radius: 0; border-bottom-right-radius: 0; }
body.mps-app .input-group > .btn { border-top-left-radius: 0; border-bottom-left-radius: 0; }

body.mps-app input[type="radio"], body.mps-app input[type="checkbox"] { accent-color: var(--mps-blue); }
body.mps-app input[type="radio"] { width: 17px; height: 17px; cursor: pointer; vertical-align: middle; }

/* Stock availability chip near quantity inputs */
.mps-stockhint {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    font-size: 12.5px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
}
.mps-stockhint.is-ok { background: var(--ok-050); color: var(--ok); }
.mps-stockhint.is-low { background: var(--warn-050); color: var(--warn); }
.mps-stockhint.is-over { background: var(--mps-red-050); color: var(--mps-red); }

/* File upload drop zone */
.mps-drop {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border: 1.5px dashed #b9bfd0;
    border-radius: var(--r-md);
    background: var(--surface-2);
    transition: border-color .15s ease, background-color .15s ease;
    cursor: pointer;
}
.mps-drop:hover, .mps-drop.is-drag { border-color: var(--mps-blue); background: var(--mps-blue-050); }
.mps-drop input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}
.mps-drop__icon {
    display: grid; place-items: center;
    width: 48px; height: 48px; flex: 0 0 48px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid var(--line);
    color: var(--mps-blue);
    font-size: 22px;
}
.mps-drop__text strong { display: block; color: var(--ink); }
.mps-drop__text span { font-size: 12.5px; color: var(--muted); }
.mps-drop input[type="file"]:focus-visible ~ .mps-drop__icon { outline: 3px solid rgba(32, 45, 136, .45); outline-offset: 2px; }

.mps-files { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-top: 12px; }
.mps-file {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    min-width: 0;
    animation: mps-pop .25s var(--ease) both;
}
.mps-file__thumb {
    width: 44px; height: 44px; flex: 0 0 44px;
    border-radius: 8px;
    background: var(--surface) center / cover no-repeat;
    display: grid; place-items: center;
    color: var(--mps-blue);
    font-size: 20px;
}
.mps-file__meta { min-width: 0; line-height: 1.3; }
.mps-file__meta strong { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mps-file__meta span { font-size: 12px; color: var(--muted); }
.mps-file.is-too-big { border-color: #e2a3a4; background: var(--mps-red-050); }
.mps-file.is-too-big .mps-file__meta span { color: var(--mps-red); font-weight: 600; }

@keyframes mps-pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------------
   7. BUTTONS
--------------------------------------------------------------------- */
body.mps-app .btn {
    --bs-btn-font-weight: 600;
    border-radius: 10px;
    font-size: 14px;
    padding: 9px 16px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: .005em;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, transform .12s ease;
}
body.mps-app .btn:active:not(:disabled) { transform: translateY(1px); }
body.mps-app .btn:disabled, body.mps-app .btn.disabled { opacity: .5; cursor: not-allowed; }
body.mps-app .btn-sm { min-height: 32px; padding: 5px 11px; font-size: 13px; border-radius: 8px; gap: 6px; }
body.mps-app .btn-lg { min-height: 48px; padding: 12px 22px; font-size: 15px; border-radius: 12px; }
body.mps-app .btn .bi { font-size: 1.05em; line-height: 1; }

body.mps-app .btn-primary,
body.mps-app .btn-release,
body.mps-app .btn-add,
body.mps-app .btn-login,
body.mps-app .action-btn {
    background: var(--mps-blue);
    border: 1px solid var(--mps-blue);
    color: #fff;
    box-shadow: 0 1px 0 rgba(255, 255, 255, .15) inset, 0 4px 10px -6px rgba(32, 45, 136, .7);
}
body.mps-app .btn-primary:hover, body.mps-app .btn-release:hover, body.mps-app .btn-add:hover,
body.mps-app .btn-login:hover, body.mps-app .action-btn:hover,
body.mps-app .btn-primary:focus-visible, body.mps-app .btn-release:focus-visible, body.mps-app .btn-add:focus-visible {
    background: var(--mps-blue-700);
    border-color: var(--mps-blue-700);
    color: #fff;
}

body.mps-app .btn-danger {
    background: var(--mps-red);
    border: 1px solid var(--mps-red);
    color: #fff;
    box-shadow: 0 1px 0 rgba(255, 255, 255, .15) inset, 0 4px 10px -6px rgba(150, 37, 39, .7);
}
body.mps-app .btn-danger:hover, body.mps-app .btn-danger:focus-visible { background: var(--mps-red-600); border-color: var(--mps-red-600); color: #fff; }

body.mps-app .btn-warning {
    background: #fff;
    border: 1px solid var(--line-2);
    color: var(--ink);
}
body.mps-app .btn-warning:hover { background: var(--warn-050); border-color: #e8c98a; color: #6b4500; }
body.mps-app .btn-warning .bi { color: var(--warn); }

body.mps-app .btn-success { background: var(--ok); border-color: var(--ok); color: #fff; }
body.mps-app .btn-success:hover { background: #17623d; border-color: #17623d; color: #fff; }

body.mps-app .btn-secondary,
body.mps-app .btn-light {
    background: #fff;
    border: 1px solid var(--line-2);
    color: var(--ink-2);
}
body.mps-app .btn-secondary:hover, body.mps-app .btn-light:hover { background: var(--surface); border-color: #c4c9d6; color: var(--ink); }

body.mps-app .btn-outline-primary { border-color: var(--mps-blue-100); color: var(--mps-blue); background: #fff; }
body.mps-app .btn-outline-primary:hover,
body.mps-app .btn-outline-primary.active { background: var(--mps-blue); border-color: var(--mps-blue); color: #fff; }

body.mps-app .btn-outline-secondary { border-color: var(--line-2); color: var(--ink-2); background: #fff; }
body.mps-app .btn-outline-secondary:hover { background: var(--surface); border-color: #c4c9d6; color: var(--ink); }

body.mps-app .btn-outline-danger { border-color: #e7c2c3; color: var(--mps-red); background: #fff; }
body.mps-app .btn-outline-danger:hover { background: var(--mps-red); border-color: var(--mps-red); color: #fff; }

body.mps-app .btn-outline-dark { border-color: var(--line-2); color: var(--ink); background: #fff; }
body.mps-app .btn-outline-dark:hover { background: var(--ink); border-color: var(--ink); color: #fff; }

/* directional arrow that nudges on hover */
.mps-arrow { transition: transform .2s var(--ease); }
.btn:hover .mps-arrow, a:hover .mps-arrow { transform: translateX(3px); }

/* loading state (added by JS only while a real request is in flight) */
body.mps-app .btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
body.mps-app .btn.is-loading > * { visibility: hidden; }
body.mps-app .btn.is-loading::after {
    content: "";
    position: absolute;
    left: 50%; top: 50%;
    width: 18px; height: 18px;
    margin: -9px 0 0 -9px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    animation: mps-spin .7s linear infinite;
}
body.mps-app .btn-secondary.is-loading::after, body.mps-app .btn-light.is-loading::after,
body.mps-app .btn-warning.is-loading::after, body.mps-app [class*="btn-outline"].is-loading::after {
    border-color: rgba(32, 45, 136, .25);
    border-top-color: var(--mps-blue);
}
@keyframes mps-spin { to { transform: rotate(360deg); } }

/* sort / segmented buttons */
.mps-seg { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.mps-seg__label { font-size: 13px; color: var(--muted); font-weight: 600; margin-right: 2px; }
body.mps-app .mps-seg .btn { margin: 0 !important; }

/* ---------------------------------------------------------------------
   8. TABLES
--------------------------------------------------------------------- */
body.mps-app .table-box {
    position: relative;
    width: 100%;
    max-height: min(64vh, 680px);
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: #fff;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #c5cad6 transparent;
}
body.mps-app .table-box .table-responsive,
body.mps-app .table-box .table-scroll { overflow: visible; }

body.mps-app .table {
    --bs-table-bg: transparent;
    --bs-table-hover-bg: rgba(32, 45, 136, .045);
    --bs-table-striped-bg: var(--surface-2);
    margin-bottom: 0;
    color: var(--ink);
    font-size: 14px;
    border-color: var(--line);
}
body.mps-app .table > :not(caption) > * > * {
    padding: 11px 14px;
    border-bottom-color: var(--line);
    vertical-align: middle;
}
body.mps-app .table-bordered > :not(caption) > * > * { border-width: 0 0 1px 0; }
body.mps-app .table-bordered > :not(caption) > * { border-width: 0; }
body.mps-app .table thead th,
body.mps-app .table thead.table-dark th,
body.mps-app .table thead.table-light th,
body.mps-app .table-dark th {
    background: #f4f5f9 !important;
    color: var(--ink-2) !important;
    font-weight: 600;
    font-size: 12.5px;
    white-space: nowrap;
    border-bottom: 1px solid var(--line-2) !important;
    box-shadow: none;
}
body.mps-app .table-box thead th {
    position: sticky;
    top: 0;
    z-index: 5;
}
body.mps-app .table tbody tr { transition: background-color .12s ease; }
body.mps-app .table-hover > tbody > tr:hover > * { --bs-table-bg-state: rgba(32, 45, 136, .045); }
body.mps-app .table tbody tr:last-child > * { border-bottom: 0; }
body.mps-app .table tbody tr:has(input[type="radio"]:checked) > * {
    background: var(--mps-blue-050) !important;
    box-shadow: inset 0 0 0 0 transparent;
}
body.mps-app .table tbody tr:has(input[type="radio"]:checked) > td:first-child { box-shadow: inset 3px 0 0 var(--mps-blue); }
body.mps-app .table-box table td,
body.mps-app .table-box table th { white-space: nowrap; }
body.mps-app .table-box table td.mps-wrap,
body.mps-app .table-box table td.mr-wrap { white-space: normal; }

/* clickable selection rows */
body.mps-app .table tbody tr.mps-selectable { cursor: pointer; }

/* in-table qty emphasis */
.mps-qty { font-family: var(--font-display); font-weight: 700; font-variant-numeric: tabular-nums; }
.mps-qty.is-zero { color: var(--mps-red); }
.mps-qty.is-low { color: var(--warn); }

.mps-catbadge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px 3px 8px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 600;
    background: var(--surface);
    color: var(--ink-2);
    white-space: nowrap;
}
.mps-catbadge::before {
    content: "";
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--cat, var(--mps-silver));
}

.mps-empty {
    text-align: center;
    padding: 44px 16px !important;
    color: var(--muted);
    white-space: normal !important;
}
.mps-empty i { display: block; font-size: 30px; color: var(--mps-silver); margin-bottom: 8px; }
.mps-empty strong { display: block; color: var(--ink); font-size: 15px; margin-bottom: 2px; }

.mps-tablemeta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--muted);
    margin: -4px 0 10px;
}
.mps-filterbox { position: relative; }
.mps-filterbox i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; pointer-events: none; }
body.mps-app .mps-filterbox input { min-height: 34px; padding: 4px 10px 4px 30px; font-size: 13.5px; width: 240px; max-width: 100%; }

/* action bar under selectable tables */
.mps-actionsbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: var(--surface-2);
}
.mps-actionsbar__hint { font-size: 13px; color: var(--muted); display: inline-flex; gap: 8px; align-items: center; }
.mps-actionsbar__btns { display: flex; gap: 8px; flex-wrap: wrap; }
body.mps-app .mps-actionsbar__btns .btn { margin: 0 !important; }

/* flash after a row/section changes */
.mps-flash { animation: mps-flash 1.6s ease-out 1; }
@keyframes mps-flash { 0% { background-color: rgba(31, 122, 77, .16); } 100% { background-color: transparent; } }

/* attachments */
.attachment-list { display: flex; flex-direction: column; gap: 4px; }
.attachment-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
}
.attachment-link:hover { text-decoration: underline; }
.attachment-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; background: var(--surface-2); }
.attachment-remove-btn { border: 1px solid #e7c2c3; color: var(--mps-red); background: #fff; border-radius: 8px; padding: 3px 10px; font-size: 12.5px; font-weight: 600; }
.attachment-remove-btn:hover { background: var(--mps-red); color: #fff; }

/* ---------------------------------------------------------------------
   9. WORKFLOW BOXES (release / return / material request)
--------------------------------------------------------------------- */
body.mps-app .cart-box,
body.mps-app .dr-box,
body.mps-app .mrf-box {
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 20px 22px;
    background: #fff;
    margin-bottom: 20px;
    overflow: visible;
}
body.mps-app .cart-box { background: linear-gradient(180deg, #fbfbfd, #fff 60px); }
body.mps-app .dr-box { border-color: #e9d3d4; background: linear-gradient(180deg, #fdf8f8, #fff 80px); }
body.mps-app .mrf-box { background: var(--info-050); border-color: #cfe0f2; }
body.mps-app .mrf-box-loaded { background: #fff8e6; border-color: #f0d9a2; }
body.mps-app .cart-title,
body.mps-app .dr-title,
body.mps-app .mrf-title {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 700;
    color: var(--ink);
}
body.mps-app .cart-title .bi, body.mps-app .dr-title .bi, body.mps-app .mrf-title .bi { color: var(--mps-blue); }
body.mps-app .dr-title .bi { color: var(--mps-red); }
body.mps-app .cart-box .table { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
body.mps-app .cart-box .table thead th { background: #f4f5f9 !important; }
body.mps-app .empty-cart {
    text-align: center;
    padding: 28px 16px;
    color: var(--muted);
    border: 1.5px dashed var(--line-2);
    border-radius: 10px;
    background: #fff;
}
body.mps-app .empty-cart::before {
    content: "\F244";
    font-family: "bootstrap-icons";
    display: block;
    font-size: 26px;
    color: var(--mps-silver);
    margin-bottom: 4px;
}
body.mps-app .cart-qty-input { width: 86px; }
body.mps-app .cart-remarks { max-width: 260px; white-space: normal !important; overflow-wrap: anywhere; }
body.mps-app .project-row > [class*="col-"] { min-width: 0; }

/* add-to-cart strip */
.mps-addstrip {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    flex-wrap: wrap;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: var(--surface-2);
    margin-bottom: 20px;
}
.mps-addstrip__item { flex: 1 1 260px; min-width: 0; }
.mps-addstrip__item .mps-addstrip__label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.mps-addstrip__item .mps-addstrip__name { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mps-addstrip__qty { flex: 0 1 220px; }

/* ---------------------------------------------------------------------
   10. ALERTS
--------------------------------------------------------------------- */
body.mps-app .alert {
    border-radius: var(--r-md);
    border: 1px solid transparent;
    padding: 13px 16px 13px 46px;
    position: relative;
    font-size: 14px;
    line-height: 1.5;
    animation: mps-page-in .35s var(--ease) both;
}
body.mps-app .alert::before {
    font-family: "bootstrap-icons";
    position: absolute;
    left: 16px;
    top: 12px;
    font-size: 17px;
    line-height: 1.3;
}
body.mps-app .alert-success { background: var(--ok-050); border-color: #bfe0cd; color: #155c39; }
body.mps-app .alert-success::before { content: "\F26A"; color: var(--ok); }
body.mps-app .alert-danger { background: var(--mps-red-050); border-color: #ecc5c6; color: #7a1c1e; }
body.mps-app .alert-danger::before { content: "\F336"; color: var(--mps-red); }
body.mps-app .alert-warning { background: var(--warn-050); border-color: #f0d9a2; color: #6b4500; }
body.mps-app .alert-warning::before { content: "\F33A"; color: var(--warn); }
body.mps-app .alert-info { background: var(--info-050); border-color: #cfe0f2; color: #174b7e; }
body.mps-app .alert-info::before { content: "\F430"; color: var(--info); }
body.mps-app .alert .bi:first-child { display: none; }
body.mps-app .alert.d-flex .btn { flex: 0 0 auto; }

/* ---------------------------------------------------------------------
   11. STATUS & BADGES
--------------------------------------------------------------------- */
body.mps-app .badge {
    font-weight: 600;
    font-size: 12px;
    padding: 4px 9px;
    border-radius: 999px;
    letter-spacing: .01em;
}
body.mps-app .badge.bg-primary { background: var(--mps-blue-050) !important; color: var(--mps-blue) !important; }
body.mps-app .badge.bg-danger { background: var(--mps-red-050) !important; color: var(--mps-red) !important; }
body.mps-app .badge.bg-success { background: var(--ok-050) !important; color: var(--ok) !important; }
body.mps-app .badge.bg-warning { background: var(--warn-050) !important; color: var(--warn) !important; }
body.mps-app .badge.bg-secondary { background: var(--surface) !important; color: var(--ink-2) !important; }
body.mps-app .badge.bg-info { background: var(--info-050) !important; color: var(--info) !important; }

body.mps-app .status-badge,
.mps-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
    background: var(--surface);
    color: var(--ink-2);
}
body.mps-app .status-badge::before, .mps-status::before {
    content: "";
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
}
body.mps-app .status-released, .mps-status--release { background: var(--mps-blue-050); color: var(--mps-blue); }
body.mps-app .status-partial, .mps-status--partial { background: var(--warn-050); color: var(--warn); }
body.mps-app .status-returned, .mps-status--return { background: var(--ok-050); color: var(--ok); }
body.mps-app .status-voided, .mps-status--void { background: var(--mps-red-050); color: var(--mps-red); }

body.mps-app .btn-view-dr {
    background: #fff;
    border: 1px solid var(--line-2);
    color: var(--mps-blue);
    border-radius: 8px;
    padding: 4px 10px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}
body.mps-app .btn-view-dr:hover { background: var(--mps-blue); border-color: var(--mps-blue); color: #fff; }
body.mps-app .receipt-cell { white-space: nowrap; }

/* ---------------------------------------------------------------------
   12. MODALS & TOASTS
--------------------------------------------------------------------- */
.mps-modal {
    position: fixed;
    inset: 0;
    z-index: 1990;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(12, 17, 64, .5);
    backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity .2s ease;
}
.mps-modal[hidden] { display: none; }
.mps-modal.is-open { opacity: 1; }
.mps-modal__box {
    width: 440px;
    max-width: 100%;
    background: #fff;
    border-radius: 18px;
    padding: 26px;
    box-shadow: var(--shadow-3);
    transform: translateY(12px) scale(.98);
    transition: transform .25s var(--ease);
    color: var(--ink);
}
.mps-modal.is-open .mps-modal__box { transform: none; }
.mps-modal__icon {
    display: grid; place-items: center;
    width: 46px; height: 46px;
    border-radius: 12px;
    font-size: 22px;
    margin-bottom: 14px;
    background: var(--mps-blue-050);
    color: var(--mps-blue);
}
.mps-modal__icon--danger { background: var(--mps-red-050); color: var(--mps-red); }
.mps-modal__icon--neutral { background: var(--surface); color: var(--ink-2); }
body.mps-app .mps-modal__title, .mps-modal__title { font-family: var(--font-display); font-size: 19px; font-weight: 700; margin: 0 0 6px; }
.mps-modal__text { color: var(--ink-2); margin: 0 0 18px; white-space: pre-line; }
.mps-modal__field { margin: -4px 0 18px; }
.mps-modal__field textarea { width: 100%; }
.mps-modal__actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

.mps-toasts {
    position: fixed;
    top: calc(var(--topbar-h) + 12px);
    right: 16px;
    z-index: 2050;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 380px;
    max-width: calc(100vw - 32px);
    pointer-events: none;
}
.mps-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #fff;
    border: 1px solid var(--line);
    border-left: 4px solid var(--mps-blue);
    border-radius: 12px;
    padding: 13px 12px 13px 14px;
    box-shadow: var(--shadow-3);
    color: var(--ink);
    font-size: 14px;
    position: relative;
    overflow: hidden;
    animation: mps-toast-in .35s var(--ease) both;
}
.mps-toast.is-leaving { animation: mps-toast-out .25s ease both; }
.mps-toast__icon { font-size: 19px; line-height: 1.2; color: var(--mps-blue); }
.mps-toast__body { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.mps-toast__body strong { display: block; font-size: 14px; margin-bottom: 1px; }
.mps-toast__close { border: 0; background: transparent; color: var(--muted); font-size: 15px; padding: 2px 4px; border-radius: 6px; }
.mps-toast__close:hover { background: var(--surface); color: var(--ink); }
.mps-toast__timer { position: absolute; left: 0; bottom: 0; height: 3px; background: currentColor; opacity: .18; width: 100%; transform-origin: left; }
.mps-toast--success { border-left-color: var(--ok); }
.mps-toast--success .mps-toast__icon, .mps-toast--success .mps-toast__timer { color: var(--ok); }
.mps-toast--error { border-left-color: var(--mps-red); }
.mps-toast--error .mps-toast__icon, .mps-toast--error .mps-toast__timer { color: var(--mps-red); }
.mps-toast--warning { border-left-color: #c98500; }
.mps-toast--warning .mps-toast__icon, .mps-toast--warning .mps-toast__timer { color: var(--warn); }

@keyframes mps-toast-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes mps-toast-out { to { opacity: 0; transform: translateX(24px); } }

/* ---------------------------------------------------------------------
   13. PAGE-SPECIFIC PIECES
--------------------------------------------------------------------- */
/* Add item form */
.mps-formgrid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px 18px; }
.mps-formgrid > .mps-col-12 { grid-column: span 12; }
.mps-formgrid > .mps-col-8 { grid-column: span 8; }
.mps-formgrid > .mps-col-6 { grid-column: span 6; }
.mps-formgrid > .mps-col-4 { grid-column: span 4; }
.mps-formgrid > .mps-col-3 { grid-column: span 3; }
.mps-formgrid .mb-3 { margin-bottom: 0 !important; }

body.mps-app .dynamic-section:empty { display: none; }
body.mps-app .dynamic-section h4 { font-size: 16px; font-weight: 700; margin: 0 0 14px; }
body.mps-app .dynamic-section hr { display: none; }

.mps-formfoot {
    position: sticky;
    bottom: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 6px -28px -26px;
    padding: 14px 28px;
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(6px);
    border-top: 1px solid var(--line);
    border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.mps-formfoot__note { font-size: 13px; color: var(--muted); }

/* View items update panel */
body.mps-app #updateSection .card {
    border: 1px solid var(--mps-blue-100);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-2);
    padding: 24px !important;
}
body.mps-app .update-title { font-family: var(--font-display); font-weight: 700; font-size: 18px; margin-bottom: 18px; display: flex; gap: 10px; align-items: center; }
body.mps-app .update-title .bi { color: var(--warn); }
body.mps-app .update-field, body.mps-app .database-field { margin-bottom: 14px; }
body.mps-app .update-field label { font-weight: 600; font-size: 13.5px; color: var(--ink-2); margin-bottom: 6px; display: block; }
#dynamicUpdateFields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }

/* Transactions summary cards */
body.mps-app .summary-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 16px 18px;
    height: 100%;
}
body.mps-app .summary-card .summary-label { font-size: 13px; color: var(--muted); font-weight: 600; }
body.mps-app .summary-card .summary-number { font-family: var(--font-display); font-size: 26px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
body.mps-app .toggle-btn { white-space: nowrap; }
body.mps-app .detail-row > td { background: var(--surface-2) !important; padding: 12px 16px !important; }
body.mps-app .detail-row table { background: #fff; border: 1px solid var(--line); border-radius: 8px; }

/* Material request history */
body.mps-app .mr-history-box { max-height: 640px; }
body.mps-app .mr-actions { display: flex; flex-wrap: wrap; gap: 6px; }
body.mps-app .mr-actions form { margin: 0; }
body.mps-app .mr-details-row > td { background: var(--surface-2) !important; }
body.mps-app .mr-details-row table { background: #fff; }
body.mps-app .mr-details-row table th { background: #f4f5f9 !important; }
body.mps-app .mr-filter-row > [class*="col-"] { min-width: 0; }

/* Accounts */
body.mps-app .account-message {
    display: flex;
    gap: 12px;
    align-items: center;
    border-radius: var(--r-md);
    padding: 12px 14px;
    margin-bottom: 18px;
    border: 1px solid transparent;
}
body.mps-app .account-message.success { background: var(--ok-050); border-color: #bfe0cd; color: #155c39; }
body.mps-app .account-message.error { background: var(--mps-red-050); border-color: #ecc5c6; color: #7a1c1e; }
body.mps-app .message-icon { display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%; color: #fff; }
body.mps-app .account-message.success .message-icon { background: var(--ok); }
body.mps-app .account-message.error .message-icon { background: var(--mps-red); }

.mps-userlist { display: flex; flex-direction: column; }
.mps-userrow { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--line); }
.mps-userrow:last-child { border-bottom: 0; }
.mps-userrow .mps-avatar { width: 32px; height: 32px; flex-basis: 32px; font-size: 12px; }
.mps-userrow__name { flex: 1 1 auto; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* ---------------------------------------------------------------------
   14. DASHBOARD
--------------------------------------------------------------------- */
.mps-hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--r-lg);
    padding: 28px 30px;
    margin-bottom: 22px;
    color: #fff;
    background:
        radial-gradient(90% 140% at 100% 0%, rgba(150, 37, 39, .55), transparent 55%),
        linear-gradient(120deg, var(--mps-navy) 0%, var(--mps-blue) 100%);
    box-shadow: var(--shadow-2);
}
.mps-hero::after {
    /* subtle transmission-line motif */
    content: "";
    position: absolute;
    inset: auto -40px -60px auto;
    width: 420px; height: 220px;
    background:
        repeating-linear-gradient(-12deg, transparent 0 34px, rgba(255, 255, 255, .07) 34px 35px);
    border-radius: 50%;
    pointer-events: none;
}
.mps-hero__grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px; align-items: end; }
.mps-hero__greet { font-size: 14px; color: rgba(255, 255, 255, .78); margin: 0 0 4px; }
body.mps-app .mps-hero h1 { color: #fff; font-size: 30px; font-weight: 800; margin: 0 0 6px; line-height: 1.1; }
.mps-hero__sub { color: rgba(255, 255, 255, .82); margin: 0; max-width: 54ch; }
.mps-hero__big { text-align: right; }
.mps-hero__big .mps-num { color: #fff; display: block; font-size: clamp(40px, 5vw, 60px); font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.mps-hero__big span:not(.mps-num) { font-size: 13.5px; color: rgba(255, 255, 255, .78); }
.mps-hero__actions { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.mps-hero__actions .btn {
    background: rgba(255, 255, 255, .12) !important;
    border: 1px solid rgba(255, 255, 255, .22) !important;
    color: #fff !important;
    box-shadow: none !important;
    backdrop-filter: blur(4px);
}
.mps-hero__actions .btn:hover { background: #fff !important; color: var(--mps-blue) !important; }
.mps-hero__actions .btn.mps-hero__primary { background: #fff !important; color: var(--mps-blue) !important; }
.mps-hero__actions .btn.mps-hero__primary:hover { background: var(--mps-blue-050) !important; }

.mps-ledger {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-1);
    margin-bottom: 22px;
    overflow: hidden;
}
.mps-ledger__cell { padding: 18px 20px; position: relative; text-decoration: none !important; color: inherit !important; transition: background-color .15s ease; }
.mps-ledger__cell + .mps-ledger__cell { border-left: 1px solid var(--line); }
a.mps-ledger__cell:hover { background: var(--surface-2); }
.mps-ledger__label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); font-weight: 600; }
.mps-ledger__label i { font-size: 15px; color: var(--mps-blue); }
.mps-ledger__value { display: block; font-size: 28px; font-weight: 800; color: var(--ink); margin-top: 6px; line-height: 1.1; }
.mps-ledger__foot { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.mps-ledger__cell--alert .mps-ledger__label i { color: var(--mps-red); }
.mps-ledger__cell--alert .mps-ledger__value { color: var(--mps-red); }

.mps-dash { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.mps-dash > * { min-width: 0; }
.mps-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-1);
    padding: 20px 22px;
    margin-bottom: 22px;
}
.mps-card__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
body.mps-app .mps-card__title { font-size: 16.5px; font-weight: 700; margin: 0; }
.mps-card__meta { font-size: 12.5px; color: var(--muted); }
.mps-card__link { font-size: 13px; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }

/* category bin levels */
.mps-bins { display: flex; flex-direction: column; gap: 4px; }
.mps-bin {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr) 92px;
    align-items: center;
    gap: 14px;
    padding: 7px 8px;
    border-radius: 8px;
    text-decoration: none !important;
    color: var(--ink) !important;
    transition: background-color .15s ease;
}
.mps-bin:hover { background: var(--surface-2); }
.mps-bin__name { font-weight: 600; font-size: 13.5px; display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.mps-bin__name small { color: var(--muted); font-weight: 500; font-size: 12px; }
.mps-bin__track { height: 10px; border-radius: 6px; background: var(--surface); overflow: hidden; }
.mps-bin__fill {
    display: block;
    height: 100%;
    width: var(--w, 0%);
    border-radius: 6px;
    background: linear-gradient(90deg, var(--mps-blue), #4553c4);
    transform-origin: left;
    transition: transform 1s var(--ease);
}
html.mps-js .mps-bins:not(.is-in) .mps-bin__fill { transform: scaleX(0); }
.mps-bin__qty { text-align: right; font-family: var(--font-display); font-weight: 700; font-variant-numeric: tabular-nums; }
.mps-bin__qty small { display: block; font-family: var(--font-body); font-weight: 500; font-size: 11.5px; color: var(--muted); }
.mps-bin__qty small.is-warn { color: var(--warn); }

/* movement chart */
.mps-chart { width: 100%; height: auto; display: block; }
.mps-chart text { font-family: var(--font-body); font-size: 11.5px; fill: var(--muted); }
.mps-chart .mps-chart__bar { transition: opacity .15s ease; transform-box: fill-box; transform-origin: bottom; }
html.mps-js .mps-chart:not(.is-in) .mps-chart__bar { transform: scaleY(0); }
.mps-chart.is-in .mps-chart__bar { transition: transform .8s var(--ease), opacity .15s ease; }
.mps-chart .mps-chart__bar:hover { opacity: .8; }
.mps-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.mps-legend span { display: inline-flex; align-items: center; gap: 6px; }
.mps-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* warehouse split */
.mps-split { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--surface); margin: 6px 0 14px; }
.mps-split span { display: block; height: 100%; }
.mps-split span + span { box-shadow: -2px 0 0 #fff; }
.mps-splitlist { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.mps-splitlist li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.mps-splitlist i { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 10px; }
.mps-splitlist b { margin-left: auto; font-family: var(--font-display); font-variant-numeric: tabular-nums; }
.mps-splitlist em { font-style: normal; color: var(--muted); font-size: 12.5px; width: 44px; text-align: right; }

/* activity feed */
.mps-feed { list-style: none; margin: 0; padding: 0; }
.mps-feed li { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.mps-feed li:last-child { border-bottom: 0; }
.mps-feed__icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 15px; }
.mps-feed__icon--out { background: var(--mps-blue-050); color: var(--mps-blue); }
.mps-feed__icon--in { background: var(--ok-050); color: var(--ok); }
.mps-feed__main { min-width: 0; line-height: 1.35; }
.mps-feed__main strong { display: block; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mps-feed__main span { font-size: 12.5px; color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mps-feed__qty { text-align: right; font-family: var(--font-display); font-weight: 700; font-variant-numeric: tabular-nums; font-size: 14px; line-height: 1.3; }
.mps-feed__qty small { display: block; font-family: var(--font-body); font-weight: 500; font-size: 11.5px; color: var(--muted); }
.mps-feed__qty.is-out { color: var(--mps-blue); }
.mps-feed__qty.is-in { color: var(--ok); }

/* DR list */
.mps-drlist { list-style: none; margin: 0; padding: 0; }
.mps-drlist li { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.mps-drlist li:last-child { border-bottom: 0; }
.mps-drlist strong { font-size: 13.5px; display: block; }
.mps-drlist li > span:first-child { min-width: 0; }
.mps-drlist span.mps-drlist__to { font-size: 12.5px; color: var(--muted); display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* dashboard entrance (one orchestrated sequence) */
html.mps-js .mps-reveal { opacity: 0; transform: translateY(14px); }
html.mps-js .mps-reveal.is-in { opacity: 1; transform: none; transition: opacity .55s var(--ease), transform .55s var(--ease); transition-delay: var(--d, 0ms); }

/* ---------------------------------------------------------------------
   PUBLIC PAGES (login / selector)
--------------------------------------------------------------------- */
body.mps-auth {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--surface);
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
}
.mps-auth__art {
    position: relative;
    overflow: hidden;
    color: #fff;
    padding: 48px 56px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background:
        radial-gradient(70% 60% at 100% 100%, rgba(150, 37, 39, .65), transparent 60%),
        radial-gradient(80% 70% at 0% 0%, rgba(80, 96, 210, .35), transparent 60%),
        linear-gradient(160deg, var(--mps-navy) 0%, var(--mps-blue) 100%);
}
.mps-auth__art::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(-14deg, transparent 0 46px, rgba(255, 255, 255, .055) 46px 47px);
    mask-image: linear-gradient(180deg, transparent, #000 40%, #000 70%, transparent);
    pointer-events: none;
}
.mps-auth__brand { position: relative; display: flex; align-items: center; gap: 14px; }
.mps-auth__brand img { width: 56px; height: 56px; border-radius: 50%; background: #fff; padding: 3px; }
.mps-auth__brand strong { font-family: var(--font-display); font-size: 18px; display: block; }
.mps-auth__brand span { font-size: 13px; color: rgba(255, 255, 255, .75); }
.mps-auth__copy { position: relative; max-width: 30ch; }
.mps-auth__copy h1 { font-family: var(--font-display); font-weight: 800; font-size: clamp(34px, 4vw, 52px); line-height: 1.04; letter-spacing: -.02em; margin: 0 0 16px; color: #fff; }
.mps-auth__copy p { color: rgba(255, 255, 255, .8); font-size: 16px; margin: 0; max-width: 42ch; }
.mps-auth__facts { position: relative; display: flex; gap: 28px; flex-wrap: wrap; font-size: 13px; color: rgba(255, 255, 255, .78); }
.mps-auth__facts span { display: inline-flex; align-items: center; gap: 8px; }

.mps-auth__panel { display: grid; place-items: center; padding: 40px 24px; }
.mps-auth__card {
    width: 420px;
    max-width: 100%;
    animation: mps-page-in .5s var(--ease) both;
}
.mps-auth__card h2 { font-family: var(--font-display); font-weight: 800; font-size: 28px; margin: 0 0 6px; color: var(--ink); }
.mps-auth__card > p { color: var(--muted); margin: 0 0 26px; }
.mps-auth__card .form-label { font-weight: 600; font-size: 13.5px; color: var(--ink-2); }
.mps-auth__card .form-control {
    min-height: 48px;
    border-radius: 12px;
    border: 1px solid var(--line-2);
    padding: 10px 14px;
    font-size: 15px;
}
.mps-auth__card .form-control:focus { border-color: var(--mps-blue); box-shadow: 0 0 0 4px rgba(32, 45, 136, .12); }
.mps-pw { position: relative; }
.mps-pw .form-control { padding-right: 48px; }
.mps-pw button {
    position: absolute;
    right: 6px; top: 50%;
    transform: translateY(-50%);
    width: 38px; height: 38px;
    border: 0;
    background: transparent;
    color: var(--muted);
    border-radius: 8px;
}
.mps-pw button:hover { background: var(--surface); color: var(--ink); }
.mps-auth__submit {
    width: 100%;
    min-height: 50px;
    border-radius: 12px;
    border: 0;
    background: var(--mps-blue);
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 10px 22px -12px rgba(32, 45, 136, .9);
    transition: background-color .15s ease, transform .12s ease;
    position: relative;
}
.mps-auth__submit:hover { background: var(--mps-blue-700); }
.mps-auth__submit:active { transform: translateY(1px); }
.mps-auth__submit:hover .mps-arrow { transform: translateX(3px); }
.mps-auth__submit.is-loading { color: transparent; pointer-events: none; }
.mps-auth__submit.is-loading > * { visibility: hidden; }
.mps-auth__submit.is-loading::after {
    content: ""; position: absolute; left: 50%; top: 50%;
    width: 20px; height: 20px; margin: -10px 0 0 -10px;
    border-radius: 50%; border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff;
    animation: mps-spin .7s linear infinite;
}
.mps-auth__error {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: var(--mps-red-050);
    border: 1px solid #ecc5c6;
    color: #7a1c1e;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 18px;
    font-size: 14px;
    animation: mps-shake .4s ease 1;
}
.mps-auth__error i { color: var(--mps-red); font-size: 17px; line-height: 1.3; }
@keyframes mps-shake { 0%, 100% { transform: none; } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.mps-auth__back { display: inline-flex; align-items: center; gap: 6px; margin-top: 20px; font-size: 14px; font-weight: 600; color: var(--mps-blue); text-decoration: none; }
.mps-auth__back:hover .bi { transform: translateX(-3px); }
.mps-auth__back .bi { transition: transform .2s var(--ease); }
.mps-auth__foot { margin-top: 32px; font-size: 12px; color: var(--muted); }
.mps-auth__mobilebrand { display: none; }

/* ---------------------------------------------------------------------
   15. RESPONSIVE
--------------------------------------------------------------------- */
@media (max-width: 1280px) {
    .mps-clock { display: none; }
    .mps-ledger { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .mps-ledger__cell:nth-child(4) { border-left: 0; }
    .mps-ledger__cell:nth-child(n+4) { border-top: 1px solid var(--line); }
}

@media (max-width: 1100px) {
    .mps-dash { grid-template-columns: minmax(0, 1fr); }
    .mps-usermenu__who { display: none; }
}

@media (max-width: 991.98px) {
    :root { --sbw: 0px; --topbar-h: 62px; }
    html.mps-sb-collapsed { --sbw: 0px; }

    .mps-sidebar {
        width: 288px;
        max-width: 86vw;
        transform: translateX(-102%);
        box-shadow: var(--shadow-3);
    }
    html.mps-sb-collapsed .mps-sidebar__brandtext,
    html.mps-sb-collapsed .mps-nav__label,
    html.mps-sb-collapsed .mps-nav__link span,
    html.mps-sb-collapsed .mps-sidebar__who { opacity: 1; width: auto; pointer-events: auto; }
    html.mps-sb-collapsed .mps-nav__label { height: auto; padding: 10px 12px 6px; }
    html.mps-sb-collapsed .mps-nav__link { justify-content: flex-start; padding: 0 12px; gap: 12px; }
    html.mps-sb-collapsed .mps-sidebar__user { justify-content: flex-start; padding: 8px 10px; background: rgba(255, 255, 255, .05); }
    html.mps-sb-collapsed .mps-nav__group + .mps-nav__group { border-top: 0; padding-top: 0; }

    html.mps-nav-open .mps-sidebar { transform: none; }
    html.mps-nav-open .mps-scrim { opacity: 1; visibility: visible; }
    html.mps-nav-open, html.mps-nav-open body { overflow: hidden; }
    .mps-sidebar__close { display: grid; place-items: center; }

    .mps-topbar { padding: 0 14px; gap: 10px; }
    .mps-quicksearch { width: 40px; }
    .mps-quicksearch input[type="search"] { padding: 0; width: 40px; color: transparent; cursor: pointer; background: #fff; }
    .mps-quicksearch input[type="search"]::placeholder { color: transparent; }
    .mps-quicksearch > i { left: 13px; }
    .mps-quicksearch kbd { display: none; }
    .mps-quicksearch:focus-within {
        position: absolute;
        left: 12px; right: 12px; top: 11px;
        width: auto;
        z-index: 5;
    }
    .mps-quicksearch:focus-within input[type="search"] { width: 100%; padding: 0 12px 0 36px; color: var(--ink); cursor: text; box-shadow: var(--shadow-2); }
    .mps-quicksearch:focus-within input[type="search"]::placeholder { color: #9aa0ae; }

    body.mps-app .content { padding: calc(var(--topbar-h) + 20px) 18px 40px; }
    .mps-hero__grid { grid-template-columns: minmax(0, 1fr); }
    .mps-hero__big { text-align: left; }
}

@media (max-width: 767.98px) {
    body.mps-app { font-size: 14px; }
    body.mps-app .content { padding: calc(var(--topbar-h) + 14px) 12px 32px; }
    body.mps-app .container-box, .mps-panel { padding: 18px 16px; border-radius: 14px; }
    .mps-formfoot { margin: 6px -16px -18px; padding: 12px 16px; }
    body.mps-app .mps-page-head__title { font-size: 21px; }
    .mps-page-head__icon { width: 40px; height: 40px; flex-basis: 40px; font-size: 18px; border-radius: 12px; }
    .mps-page-head__actions { width: 100%; }
    .mps-crumbs { display: none; }
    .mps-topbar__title { font-size: 16.5px; }

    .mps-formgrid { grid-template-columns: minmax(0, 1fr); }
    .mps-formgrid > [class*="mps-col-"] { grid-column: auto; }
    #dynamicUpdateFields { grid-template-columns: minmax(0, 1fr); }

    .mps-ledger { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mps-ledger__cell { padding: 14px 16px; }
    .mps-ledger__cell:nth-child(n) { border-left: 0; border-top: 1px solid var(--line); }
    .mps-ledger__cell:nth-child(-n+2) { border-top: 0; }
    .mps-ledger__cell:nth-child(even) { border-left: 1px solid var(--line); }
    .mps-ledger__cell:last-child:nth-child(odd) { grid-column: span 2; }
    .mps-ledger__value { font-size: 23px; }
    .mps-hero { padding: 22px 20px; }
    body.mps-app .mps-hero h1 { font-size: 24px; }
    .mps-bin { grid-template-columns: 110px minmax(0, 1fr) 70px; gap: 10px; }
    .mps-card { padding: 16px; }

    body.mps-app .table-box { max-height: 70vh; }
    body.mps-app .table > :not(caption) > * > * { padding: 9px 11px; }
    body.mps-app .cart-box, body.mps-app .dr-box, body.mps-app .mrf-box, .mps-section { padding: 16px 14px; }
    body.mps-app .btn-lg { width: 100%; }
    .mps-toolbar { padding: 12px 12px 2px; }
    .mps-toasts { left: 12px; right: 12px; width: auto; max-width: none; }

    body.mps-auth { grid-template-columns: minmax(0, 1fr); }
    .mps-auth__art { display: none; }
    .mps-auth__mobilebrand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
    .mps-auth__mobilebrand img { width: 48px; height: 48px; }
    .mps-auth__mobilebrand strong { font-family: var(--font-display); display: block; color: var(--mps-blue); }
    .mps-auth__mobilebrand span { font-size: 12.5px; color: var(--muted); }
}

@media (max-width: 420px) {
    .mps-usermenu__btn > i { display: none; }
    .mps-bin { grid-template-columns: minmax(0, 1fr) 70px; }
    .mps-bin__track { grid-column: 1 / -1; grid-row: 2; }
}

/* ---------------------------------------------------------------------
   REDUCED MOTION
--------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }
    html.mps-js .mps-reveal { opacity: 1; transform: none; }
    html.mps-js .mps-bins:not(.is-in) .mps-bin__fill,
    html.mps-js .mps-chart:not(.is-in) .mps-chart__bar { transform: none; }
}

/* ---------------------------------------------------------------------
   PRINT
--------------------------------------------------------------------- */
@media print {
    .mps-sidebar, .mps-topbar, .mps-scrim, .mps-toasts, .mps-modal { display: none !important; }
    body.mps-app .content { margin: 0; padding: 0; animation: none; }
    body.mps-app .table-box { max-height: none; overflow: visible; }
}

/* voided records stay visible but recede */
body.mps-app .table tr.mps-row-void > * { color: var(--muted); background: repeating-linear-gradient(-45deg, transparent 0 10px, rgba(150, 37, 39, .025) 10px 20px); }
body.mps-app .table tr.mps-row-void .mps-qty { text-decoration: line-through; text-decoration-color: rgba(150, 37, 39, .5); }
body.mps-app .mps-tablemeta .form-control-sm,
body.mps-app .mps-tablemeta .form-select-sm { min-height: 34px; font-size: 13.5px; }

/* GET filter form used as a toolbar (material request history) */
body.mps-app form.mr-filter-row {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 14px 6px 4px;
    margin: 0 0 16px;
}
body.mps-app form.mr-filter-row .form-label { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }

/* inventory selector */
.mps-choice { display: flex; flex-direction: column; gap: 12px; }
.mps-choice__item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px;
    border: 1px solid var(--line-2);
    border-radius: 14px;
    background: #fff;
    color: var(--ink) !important;
    text-decoration: none;
    transition: border-color .15s ease, box-shadow .2s ease, transform .15s ease;
}
.mps-choice__item:hover { border-color: var(--mps-blue); box-shadow: var(--shadow-2); transform: translateY(-1px); }
.mps-choice__item:hover .mps-arrow { transform: translateX(4px); }
.mps-choice__item > .mps-arrow { margin-left: auto; color: var(--mps-blue); font-size: 18px; }
.mps-choice__icon { display: grid; place-items: center; width: 50px; height: 50px; flex: 0 0 50px; border-radius: 14px; background: var(--mps-blue); color: #fff; font-size: 22px; }
.mps-choice__item--office .mps-choice__icon { background: var(--mps-red); }
.mps-choice__item--office > .mps-arrow { color: var(--mps-red); }
.mps-choice__text { display: flex; flex-direction: column; min-width: 0; }
.mps-choice__text strong { font-family: var(--font-display); font-size: 17px; }
.mps-choice__text span { font-size: 13.5px; color: var(--muted); }
.mps-ledger__cell--warn .mps-ledger__label i { color: var(--warn); }
.mps-ledger__cell--warn .mps-ledger__value { color: var(--warn); }

/* Office system: red identity accents, same structure */
body.mps-app.mps-office .mps-page-head__icon { background: var(--mps-red); box-shadow: 0 10px 20px -10px rgba(150, 37, 39, .7); }
body.mps-app.mps-office .mps-hero {
    background:
        radial-gradient(90% 140% at 100% 0%, rgba(32, 45, 136, .55), transparent 55%),
        linear-gradient(120deg, #5a1517 0%, var(--mps-red) 100%);
}
body.mps-app.mps-office .mps-hero__actions .btn:hover,
body.mps-app.mps-office .mps-hero__actions .btn.mps-hero__primary { color: var(--mps-red) !important; }

/* ---------------------------------------------------------------------
   OFFICE INVENTORY COMPONENTS (existing class names, new look)
--------------------------------------------------------------------- */
body.mps-app .filter-area,
body.mps-app .filter-card {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 14px 16px;
    margin-bottom: 16px;
}
body.mps-app .filter-card .form-label,
body.mps-app .filter-area label { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-bottom: 4px; display: block; }
body.mps-app .filter-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.3fr); gap: 14px; }
body.mps-app .filter-group { min-width: 0; }
body.mps-app .search-wrap { display: flex; }
body.mps-app .search-wrap .form-control { border-top-right-radius: 0; border-bottom-right-radius: 0; }
body.mps-app .search-button,
body.mps-app .sort-button,
body.mps-app .clear-button {
    border: 1px solid var(--line-2);
    background: #fff;
    color: var(--ink-2);
    font-weight: 600;
    font-size: 14px;
    border-radius: 10px;
    padding: 0 16px;
    min-height: 42px;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
body.mps-app .search-button { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: -1px; }
body.mps-app .search-button:hover, body.mps-app .clear-button:hover { background: var(--surface); color: var(--ink); }
body.mps-app .sort-row,
body.mps-app .sort-buttons { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
body.mps-app .sort-label { font-size: 13px; color: var(--muted); font-weight: 600; }
body.mps-app .sort-button { min-height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; border-color: var(--mps-blue-100); color: var(--mps-blue); }
body.mps-app .sort-button:hover,
body.mps-app .sort-button.active-sort { background: var(--mps-blue); border-color: var(--mps-blue); color: #fff; }
body.mps-app .clear-button { min-height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; color: var(--mps-red); border-color: #e7c2c3; }
body.mps-app .empty-message,
body.mps-app .empty-history { text-align: center; padding: 40px 16px !important; color: var(--muted); white-space: normal !important; }
body.mps-app .empty-message::before,
body.mps-app .empty-history::before { content: "\F1C7"; font-family: "bootstrap-icons"; display: block; font-size: 28px; color: var(--mps-silver); margin-bottom: 6px; }
body.mps-app .section-title {
    display: flex; align-items: center; gap: 10px;
    font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--ink);
    padding-top: 6px; margin: 8px 0 14px;
}
body.mps-app .update-card { border: 1px solid var(--mps-blue-100) !important; border-radius: var(--r-md) !important; box-shadow: var(--shadow-2); margin-top: 20px; }
@media (max-width: 767.98px) {
    body.mps-app .filter-row { grid-template-columns: minmax(0, 1fr); }
}
.mps-auth--office .mps-auth__art {
    background:
        radial-gradient(70% 60% at 100% 100%, rgba(32, 45, 136, .7), transparent 60%),
        radial-gradient(80% 70% at 0% 0%, rgba(210, 80, 82, .35), transparent 60%),
        linear-gradient(160deg, #4a1012 0%, var(--mps-red) 100%);
}
.mps-auth--office .mps-auth__submit { background: var(--mps-red); box-shadow: 0 10px 22px -12px rgba(150, 37, 39, .9); }
.mps-auth--office .mps-auth__submit:hover { background: var(--mps-red-600); }
.mps-auth--office .mps-auth__mobilebrand strong { color: var(--mps-red); }
