/* =====================================================================
   Order Management System design standards
   Font: Inter (self-hosted in assets/fonts/inter, SIL Open Font License)
   Theme: blue
   ===================================================================== */

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url(../fonts/inter/inter-latin-ext-wght-normal.woff2) format('woff2-variations');
    unicode-range: U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url(../fonts/inter/inter-latin-wght-normal.woff2) format('woff2-variations');
    unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

/* ---------- 1. Design tokens ---------- */
:root {
    /* Blue theme */
    --primary: #1d4ed8;          /* buttons, links, active states */
    --primary-hover: #1e40af;
    --primary-soft: #eff4ff;     /* light tint backgrounds */
    --primary-border: #c7d7fe;
    --navy: #0b1f4d;             /* top menu bar */
    --navy-2: #12306f;

    /* Neutrals */
    --bg: #f4f6fb;               /* page background */
    --surface: #ffffff;          /* boxes */
    --border: #e3e8f2;
    --text: #0f172a;
    --text-2: #475569;           /* secondary text */
    --text-3: #94a3b8;           /* hints, placeholders */

    /* Status */
    --success: #15803d; --success-soft: #e8f7ee;
    --warning: #b45309; --warning-soft: #fff6e5;
    --danger:  #dc2626; --danger-soft:  #fdecec;
    --info:    #0369a1; --info-soft:    #e7f4fb;

    /* Shape */
    --radius: 10px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 2px 8px rgba(15, 23, 42, .04);

    /* Bootstrap overrides */
    --bs-body-font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    --bs-body-font-size: .875rem;      /* 14px */
    --bs-body-color: var(--text);
    --bs-body-bg: var(--bg);
    --bs-primary: var(--primary);
    --bs-primary-rgb: 29, 78, 216;
    --bs-link-color: var(--primary);
    --bs-link-color-rgb: 29, 78, 216;
    --bs-link-hover-color: var(--primary-hover);
    --bs-border-color: var(--border);
    --bs-border-radius: var(--radius-sm);
}

body {
    font-family: var(--bs-body-font-family);
    font-feature-settings: 'cv11', 'ss01';
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

/* ---------- 2. Typography scale ---------- */
h1, .h1 { font-size: 1.5rem;  font-weight: 700; letter-spacing: -.02em; }
h2, .h2 { font-size: 1.25rem; font-weight: 650; letter-spacing: -.01em; }
h3, .h3 { font-size: 1rem;    font-weight: 600; }
.text-secondary-2 { color: var(--text-2) !important; }
.text-hint { color: var(--text-3) !important; font-size: .8125rem; }
code { color: var(--primary); background: var(--primary-soft); padding: .1rem .35rem; border-radius: 4px; font-size: .8125rem; }

/* ---------- 3. App shell: top app bar with the menu ---------- */
.appbar { position: sticky; top: 0; z-index: 1030; background: linear-gradient(90deg, var(--navy) 0%, var(--navy-2) 100%); box-shadow: 0 2px 10px rgba(11, 31, 77, .18); }
.appbar .navbar { padding: 0; }
.appbar-inner { min-height: 60px; padding: 0 1.5rem; gap: 1rem; max-width: 1600px; }
.appbar .brand {
    display: flex; align-items: center; gap: .6rem; margin-right: 1.25rem;
    font-weight: 700; font-size: 1.05rem; color: #fff; text-decoration: none; letter-spacing: -.01em; white-space: nowrap;
}
.brand-mark {
    width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8); color: #fff; font-size: 1.05rem;
    box-shadow: 0 4px 12px rgba(29, 78, 216, .45);
}
.main-menu { gap: .25rem; }
.main-menu .nav-link {
    color: rgba(255, 255, 255, .78) !important; font-weight: 500; padding: .5rem .85rem !important; border-radius: var(--radius-sm);
    display: flex; align-items: center; gap: .5rem;
}
.main-menu .nav-link i { opacity: .85; }
.main-menu .nav-link:hover, .main-menu .nav-link.show { color: #fff !important; background: rgba(255, 255, 255, .08); }
.main-menu .nav-link.active { color: #fff !important; background: var(--primary); box-shadow: 0 4px 14px rgba(29, 78, 216, .35); }
.main-menu .dropdown-toggle::after { margin-left: .15rem; opacity: .7; }
.main-menu .dropdown-menu, .user-menu .dropdown-menu { border: 1px solid var(--border); border-radius: var(--radius); padding: .4rem; margin-top: .5rem; min-width: 230px; }
.dropdown-item { border-radius: 6px; padding: .5rem .7rem; display: flex; align-items: center; gap: .6rem; font-weight: 500; font-size: .875rem; }
.dropdown-item i { color: var(--text-3); }
.dropdown-item:hover { background: var(--primary-soft); color: var(--primary); }
.dropdown-item:hover i, .dropdown-item.active i { color: inherit; }
.dropdown-item.active, .dropdown-item:active { background: var(--primary); color: #fff; }
.main-menu .dropdown-divider { margin: .35rem .3rem; border-color: var(--border); opacity: 1; }
.dropdown-item.text-danger:hover { background: var(--danger-soft); color: var(--danger) !important; }

.navbar-toggler { border: 0; color: #fff; font-size: 1.5rem; padding: .25rem .5rem; margin-left: auto; }
.navbar-toggler:focus { box-shadow: 0 0 0 3px rgba(255, 255, 255, .2); }

.user-chip { display: flex; align-items: center; gap: .6rem; background: none; border: 0; padding: .3rem .55rem; border-radius: var(--radius-sm); color: #fff; }
.user-chip:hover, .user-chip[aria-expanded="true"] { background: rgba(255, 255, 255, .08); }
.user-chip .bi-chevron-down { opacity: .7; }
.avatar {
    width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
    background: var(--primary-soft); color: var(--primary); font-weight: 600; font-size: .8125rem;
}
.user-chip .avatar { background: rgba(255, 255, 255, .15); color: #fff; }
.user-chip .who { text-align: left; line-height: 1.15; }
.user-chip .who small { color: rgba(255, 255, 255, .6); font-size: .75rem; }

.content { padding: 1rem 1.5rem 1.5rem; max-width: 1600px; width: 100%; margin: 0 auto; }

/* ---------- 4. Page header (top of every page) ---------- */
.page-header {
    display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap;
    margin-bottom: .85rem;
}
.page-header .crumbs { font-size: .65rem; color: var(--text-3); margin-bottom: .1rem; line-height: 1.3; }
.page-header .crumbs a { color: var(--text-2); text-decoration: none; }
.page-header .crumbs a:hover { color: var(--primary); }
.page-header .crumbs .sep { margin: 0 .3rem; }
.page-header h1 { margin: 0; font-size: 1.2rem; line-height: 1.25; }
.page-header .subtitle { color: var(--text-2); margin: .1rem 0 0; font-size: .7rem; line-height: 1.35; }
.page-header .actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ---------- 5. Boxes (cards) and box headers ---------- */
.box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 1.25rem; }
.box-header {
    display: flex; align-items: center; justify-content: space-between; gap: .75rem;
    padding: .9rem 1.25rem; border-bottom: 1px solid var(--border);
}
.box-title {
    display: flex; align-items: center; gap: .55rem; margin: 0;
    font-size: .8125rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text);
}
.box-title .icon {
    width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center;
    background: var(--primary-soft); color: var(--primary); font-size: .95rem;
}
.box-subtitle { font-size: .8125rem; color: var(--text-2); margin: .15rem 0 0; text-transform: none; letter-spacing: 0; font-weight: 400; }
.box-body { padding: 1.25rem; }
.box-footer { padding: .9rem 1.25rem; border-top: 1px solid var(--border); background: #fafbfe; border-radius: 0 0 var(--radius) var(--radius); }

/* Keep older markup consistent */
.card { border-color: var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.form-section { padding: 1.25rem; border-bottom: 1px solid var(--border); }
.form-section:last-child { border-bottom: 0; }
.section-title {
    display: flex; align-items: center; gap: .55rem; margin-bottom: 1rem;
    font-size: .8125rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
}
.section-title::before { content: ''; width: 4px; height: 16px; border-radius: 2px; background: var(--primary); }

/* ---------- 6. Buttons ---------- */
.btn {
    --bs-btn-font-weight: 600; --bs-btn-font-size: .875rem; --bs-btn-padding-y: .5rem; --bs-btn-padding-x: 1rem;
    --bs-btn-border-radius: var(--radius-sm);
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem; line-height: 1.25;
    transition: background-color .15s, border-color .15s, box-shadow .15s, color .15s;
}
.btn-sm { --bs-btn-padding-y: .35rem; --bs-btn-padding-x: .7rem; --bs-btn-font-size: .8125rem; }
.btn-lg { --bs-btn-padding-y: .7rem; --bs-btn-padding-x: 1.4rem; --bs-btn-font-size: .9375rem; }
.btn:focus-visible { box-shadow: 0 0 0 3px rgba(29, 78, 216, .25); }

/* Primary: Save, Submit, Add, Sign in */
.btn-primary, .btn-save, .btn-add {
    --bs-btn-color: #fff; --bs-btn-bg: var(--primary); --bs-btn-border-color: var(--primary);
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--primary-hover); --bs-btn-hover-border-color: var(--primary-hover);
    --bs-btn-active-bg: #1e3a8a; --bs-btn-active-border-color: #1e3a8a; --bs-btn-active-color: #fff;
    --bs-btn-disabled-bg: #93b0f2; --bs-btn-disabled-border-color: #93b0f2;
    box-shadow: 0 1px 2px rgba(29, 78, 216, .25);
}
/* Secondary: Cancel, Back, Reset */
.btn-cancel, .btn-secondary-outline {
    --bs-btn-color: var(--text-2); --bs-btn-bg: #fff; --bs-btn-border-color: #cfd6e4;
    --bs-btn-hover-color: var(--text); --bs-btn-hover-bg: #f3f5f9; --bs-btn-hover-border-color: #b8c2d6;
    --bs-btn-active-bg: #e9edf4; --bs-btn-active-border-color: #b8c2d6; --bs-btn-active-color: var(--text);
}
/* Soft blue: Edit, Filter, Export */
.btn-soft, .btn-edit, .btn-filter {
    --bs-btn-color: var(--primary); --bs-btn-bg: var(--primary-soft); --bs-btn-border-color: var(--primary-soft);
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--primary); --bs-btn-hover-border-color: var(--primary);
    --bs-btn-active-bg: var(--primary-hover); --bs-btn-active-color: #fff;
}
/* Destructive: Delete, Deactivate */
.btn-delete {
    --bs-btn-color: var(--danger); --bs-btn-bg: #fff; --bs-btn-border-color: #f3c2c2;
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--danger); --bs-btn-hover-border-color: var(--danger);
    --bs-btn-active-bg: #b91c1c; --bs-btn-active-color: #fff;
}
.btn-danger { --bs-btn-bg: var(--danger); --bs-btn-border-color: var(--danger); --bs-btn-hover-bg: #b91c1c; --bs-btn-hover-border-color: #b91c1c; }
/* Positive confirmation: Approve, Receive, Confirm delivery */
.btn-confirm {
    --bs-btn-color: #fff; --bs-btn-bg: var(--success); --bs-btn-border-color: var(--success);
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #166534; --bs-btn-hover-border-color: #166534;
    --bs-btn-active-bg: #14532d; --bs-btn-active-color: #fff;
}
/* Square icon buttons in table rows */
.btn-icon { --bs-btn-padding-x: 0; --bs-btn-padding-y: 0; width: 32px; height: 32px; }
.btn-outline-primary { --bs-btn-color: var(--primary); --bs-btn-border-color: var(--primary-border); --bs-btn-hover-bg: var(--primary); --bs-btn-hover-border-color: var(--primary); }
.btn-outline-secondary { --bs-btn-color: var(--text-2); --bs-btn-border-color: #cfd6e4; --bs-btn-hover-bg: #f3f5f9; --bs-btn-hover-color: var(--text); --bs-btn-hover-border-color: #b8c2d6; }
.btn-outline-danger { --bs-btn-border-color: #f3c2c2; }

.form-actions { display: flex; gap: .6rem; align-items: center; justify-content: flex-end; }

/* ---------- 7. Forms ---------- */
.form-label { font-size: .8125rem; font-weight: 600; color: var(--text); margin-bottom: .35rem; }
.form-label .req, .req { color: var(--danger); margin-left: 2px; }
.form-control, .form-select {
    font-size: .875rem; border-color: #d5dbe7; border-radius: var(--radius-sm); min-height: 40px; padding: .5rem .8rem;
}
.form-control::placeholder { color: var(--text-3); }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(29, 78, 216, .15); }
.form-control:disabled, .form-select:disabled, .form-control[readonly] { background-color: #f1f4f9; color: var(--text-2); }
.form-text { font-size: .75rem; color: var(--text-3); }
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }
.form-check-input:focus { box-shadow: 0 0 0 3px rgba(29, 78, 216, .15); border-color: var(--primary); }
.input-group .btn { min-height: 40px; }

/* ---------- 8. Tables ---------- */
.table { --bs-table-hover-bg: #f7f9fe; margin-bottom: 0; }
.table > :not(caption) > * > * { padding: .75rem 1rem; border-bottom-color: #edf0f6; }
.table thead th {
    background: #f8fafd; font-size: .6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
    color: var(--text-2); white-space: nowrap; border-bottom: 1px solid var(--border);
}
.table-box { overflow-x: auto; }
.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--text-3); }
.empty-state i { font-size: 2rem; display: block; margin-bottom: .5rem; }

/* ---------- 9. Badges ---------- */
.badge { font-weight: 600; font-size: .6875rem; padding: .35em .65em; border-radius: 999px; letter-spacing: .02em; }
.badge-soft-success { background: var(--success-soft); color: var(--success); }
.badge-soft-warning { background: var(--warning-soft); color: var(--warning); }
.badge-soft-danger  { background: var(--danger-soft);  color: var(--danger); }
.badge-soft-info    { background: var(--info-soft);    color: var(--info); }
.badge-soft-primary { background: var(--primary-soft); color: var(--primary); }
.badge-soft-muted   { background: #eef1f6; color: var(--text-2); }
.badge-dot::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: .4em; vertical-align: middle; }

/* ---------- 10. Alerts ---------- */
.alert { border: 0; border-left: 4px solid; border-radius: var(--radius-sm); font-weight: 500; }
.alert-success { background: var(--success-soft); color: #14532d; border-left-color: var(--success); }
.alert-warning { background: var(--warning-soft); color: #78350f; border-left-color: #f59e0b; }
.alert-danger  { background: var(--danger-soft);  color: #7f1d1d; border-left-color: var(--danger); }
.alert-info    { background: var(--info-soft);    color: #0c4a6e; border-left-color: var(--info); }

/* ---------- 11. Dashboard ---------- */
.welcome {
    background: linear-gradient(120deg, #1d4ed8 0%, #2563eb 55%, #3b82f6 100%);
    color: #fff; border-radius: var(--radius); padding: 1.5rem 1.75rem; margin-bottom: 1.25rem;
    position: relative; overflow: hidden;
}
.welcome::after {
    content: ''; position: absolute; right: -60px; top: -80px; width: 260px; height: 260px; border-radius: 50%;
    background: rgba(255, 255, 255, .08);
}
.welcome h1 { font-size: 1.35rem; margin: 0 0 .25rem; color: #fff; }
.welcome p { margin: 0; opacity: .85; }
.welcome .btn-light { --bs-btn-color: var(--primary); --bs-btn-font-weight: 600; position: relative; z-index: 1; }

.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem 1.25rem; height: 100%; display: block; text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; }
a.kpi:hover { border-color: var(--primary-border); transform: translateY(-1px); color: inherit; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi-label { font-size: .8125rem; color: var(--text-2); font-weight: 500; }
.kpi-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 1.1rem; }
.kpi-value { font-size: 1.75rem; font-weight: 700; letter-spacing: -.02em; margin-top: .35rem; }
.kpi-foot { font-size: .75rem; color: var(--text-3); }
.tint-blue   { background: var(--primary-soft); color: var(--primary); }
.tint-green  { background: var(--success-soft); color: var(--success); }
.tint-amber  { background: var(--warning-soft); color: var(--warning); }
.tint-slate  { background: #eef1f6; color: var(--text-2); }

.bar-row { display: grid; grid-template-columns: 160px 1fr 40px; gap: .75rem; align-items: center; padding: .45rem 0; font-size: .8125rem; }
.bar-track { height: 8px; border-radius: 999px; background: #eef1f6; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: var(--primary); }

.quick-link { display: flex; align-items: center; gap: .8rem; padding: .75rem; border-radius: var(--radius-sm); text-decoration: none; color: var(--text); border: 1px solid transparent; }
.quick-link:hover { background: var(--primary-soft); border-color: var(--primary-border); color: var(--text); }
.quick-link .kpi-icon { width: 36px; height: 36px; flex-shrink: 0; }
.quick-link small { display: block; color: var(--text-2); font-size: .75rem; }

.module-tile { border: 1px dashed #cfd6e4; border-radius: var(--radius-sm); padding: .9rem 1rem; display: flex; gap: .75rem; align-items: center; color: var(--text-2); }
.module-tile i { font-size: 1.25rem; color: var(--text-3); }

/* ---------- 12. Login ---------- */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: var(--surface); }
.auth-hero {
    position: relative; overflow: hidden; color: #fff; padding: 3rem;
    background: radial-gradient(1200px 600px at -10% -20%, #3b82f6 0%, transparent 55%), linear-gradient(150deg, #0b1f4d 0%, #1d4ed8 100%);
    display: flex; flex-direction: column;
}
.auth-hero::before, .auth-hero::after { content: ''; position: absolute; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .12); }
.auth-hero::before { width: 520px; height: 520px; right: -180px; bottom: -160px; }
.auth-hero::after  { width: 340px; height: 340px; right: -90px; bottom: -70px; }
.auth-hero .brand { display: flex; align-items: center; gap: .65rem; font-weight: 700; font-size: 1.1rem; color: #fff; text-decoration: none; }
.auth-hero h2 { font-size: 2rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; margin: auto 0 1rem; max-width: 460px; color: #fff; }
.auth-hero p { opacity: .8; max-width: 440px; font-size: .9375rem; }
.auth-points { list-style: none; padding: 0; margin: 1.5rem 0 auto; display: grid; gap: .75rem; position: relative; z-index: 1; }
.auth-points li { display: flex; gap: .7rem; align-items: center; font-weight: 500; }
.auth-points i { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: rgba(255, 255, 255, .12); }
.auth-form-wrap { display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }
.auth-form { width: 100%; max-width: 380px; }
.auth-form h1 { font-size: 1.6rem; margin-bottom: .35rem; }
.auth-form .lead-sm { color: var(--text-2); margin-bottom: 1.75rem; }
.auth-form .form-control { min-height: 46px; }
.input-icon { position: relative; }
.input-icon > i { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.input-icon > .form-control { padding-left: 2.5rem; }
.input-icon .toggle-pass { position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--text-3); padding: .4rem .5rem; }
.input-icon .toggle-pass:hover { color: var(--primary); }
.auth-form .invalid-feedback { display: block; }
.auth-foot { margin-top: 2rem; font-size: .75rem; color: var(--text-3); text-align: center; }

/* ---------- 13. Home page ---------- */
.home-page { background: var(--bg); }
.home-nav { background: #fff; border-bottom: 1px solid var(--border); }
.home-brand { display: flex; align-items: center; gap: .6rem; color: var(--text); font-weight: 700; font-size: 1.05rem; text-decoration: none; }
.home-brand:hover { color: var(--text); }
.home-hero { background: radial-gradient(900px 500px at 85% -10%, #3b82f6 0%, transparent 60%), linear-gradient(150deg, #0b1f4d 0%, #1d4ed8 100%); color: #fff; padding: 5rem 0; }
.home-hero h1 { font-weight: 700; font-size: clamp(1.9rem, 4vw, 2.75rem); letter-spacing: -.02em; }
.home-hero .lead { max-width: 640px; opacity: .85; }
.home-hero .btn-light { --bs-btn-color: var(--primary); }
.home-icon { width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-size: 1.25rem; }

/* ---------- 14. Style guide page ---------- */
.swatch { border-radius: var(--radius-sm); height: 64px; border: 1px solid var(--border); }
.swatch-label { font-size: .75rem; margin-top: .35rem; }
.swatch-label b { display: block; font-weight: 600; font-size: .8125rem; }

/* ---------- 15. Responsive ---------- */
@media (max-width: 991.98px) {
    .appbar-inner { padding: .5rem 1rem; }
    .navbar-collapse { padding: .5rem 0 .75rem; }
    .main-menu .dropdown-menu { background: rgba(255, 255, 255, .06); border: 0; margin: 0 0 .25rem; }
    .main-menu .dropdown-item { color: rgba(255, 255, 255, .8); }
    .main-menu .dropdown-divider { border-color: rgba(255, 255, 255, .15); }
    .main-menu .dropdown-item i { color: rgba(255, 255, 255, .5); }
    .user-menu { border-top: 1px solid rgba(255, 255, 255, .1); padding-top: .5rem; margin-top: .25rem; }
    .content { padding: 1rem; }
    .auth-page { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    .auth-form-wrap { align-items: flex-start; padding-top: 2.5rem; }
    .auth-hero { padding: 1.5rem; min-height: auto; }
    .auth-hero h2, .auth-hero p, .auth-points { display: none; }
}
@media (max-width: 575.98px) {
    .bar-row { grid-template-columns: 110px 1fr 32px; }
}

/* ---------- 16. Logo ---------- */
.brand-logo { width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0; box-shadow: 0 4px 12px rgba(29, 78, 216, .35); }

/* Read-only detail view (label above value, same grid as the form) */
.detail-list { row-gap: 1rem; }
.detail-list dt { font-size: .8rem; font-weight: 500; color: var(--text-2); margin-bottom: .2rem; }
.detail-list dd { margin: 0; font-weight: 500; color: var(--text); word-break: break-word; }

/* ---------- Compact density (agreed design standard v1.5) ---------- */
/* Lists: filter bar and table text 20% smaller than the base size */
.list-filters { padding: .6rem 1rem !important; }
.content .list-filters .form-control, .content .list-filters .form-select { font-size: .7rem; min-height: 32px; padding: .3rem .65rem; }
.content .list-filters .form-select { padding-right: 2rem; background-position: right .6rem center; }
.list-filters .btn { --bs-btn-font-size: .7rem; --bs-btn-padding-y: .38rem; --bs-btn-padding-x: .8rem; min-height: 32px; }
.box .table { font-size: .7rem; }
.box .table > :not(caption) > * > * { padding: .5rem .8rem; }
.box .table thead th { font-size: .625rem; }
.box .table code { font-size: .7rem; }
.box .table .badge { font-size: .625rem; }
.box .table .avatar { width: 26px; height: 26px; font-size: .65rem; }
.box .table .btn-icon { width: 28px; height: 28px; }
.box .table .small, .box .table small { font-size: .65rem; }
.empty-state { padding: 1.75rem 1rem; }

/* Entry screens: captions and text boxes 10% smaller */
.content .form-section { padding: 1rem 1.25rem; }
.content .section-title { margin-bottom: .8rem; }
.content .form-label { font-size: .73rem; margin-bottom: .25rem; }
.content .form-control, .content .form-select { font-size: .7875rem; min-height: 36px; padding: .4rem .72rem; }
.content .form-select { padding-right: 2.1rem; }
.content .input-group .btn { min-height: 36px; }
.content .form-text, .content .invalid-feedback { font-size: .675rem; }
.content .form-check-label { font-size: .7875rem; }
.content .row.g-3 { --bs-gutter-y: .8rem; }

/* View mode: text 10% smaller, tighter rows */
.detail-list { row-gap: .7rem; }
.detail-list dt { font-size: .72rem; margin-bottom: .1rem; }
.detail-list dd { font-size: .7875rem; }
.page-header .actions .btn { --bs-btn-font-size: .8rem; --bs-btn-padding-y: .4rem; --bs-btn-padding-x: .85rem; }

/* Split screen: record on the left (60%), related list on the right (40%) */
.split-view { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 1.25rem; align-items: start; }
/* The hub list is paged so it never grows taller than the record on the left */
.hub-pager { min-height: 42px; }
.hub-pager .pagination { --bs-pagination-font-size: .7rem; --bs-pagination-padding-x: .55rem; --bs-pagination-padding-y: .2rem; }
.input-icon-sm { position: relative; }
.input-icon-sm > i { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); color: var(--text-3); font-size: .75rem; }
.content .input-icon-sm > .form-control { padding-left: 2rem; }
@media (max-width: 1199.98px) {
    .split-view { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Popups (modals) ---------- */
.modal-content { border: 0; border-radius: var(--radius); box-shadow: 0 20px 50px rgba(15, 23, 42, .25); }
.modal-header { padding: .8rem 1.25rem; border-bottom: 1px solid var(--border); }
.modal-title { font-size: 1rem; font-weight: 700; margin: 0; }
.modal-subtitle { font-size: .7rem; color: var(--text-2); }
.modal-footer { padding: .7rem 1.25rem; border-top: 1px solid var(--border); background: #fafbfe; gap: .5rem; }
.modal-footer > * { margin: 0; }
.modal .form-section { padding: .9rem 1.25rem; }

/* Repeating contact rows: name / email / phone / remove */
.contact-grid { display: grid; grid-template-columns: 1.1fr 1.3fr 1fr 36px; gap: .6rem; align-items: start; margin-bottom: .6rem; }
.contact-head { margin-bottom: 0; }
@media (max-width: 767.98px) { .contact-grid { grid-template-columns: 1fr 36px; } .contact-grid > div:nth-child(2), .contact-grid > div:nth-child(3) { grid-column: 1; } }

/* Hub map */
.map-note { font-size: .72rem; color: var(--info, #0e7490); margin-bottom: .35rem; }
.map-note i { color: #dc2626; }
.hub-map { position: relative; min-height: 300px; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: #eef2f7; }
.hub-map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.hub-map-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem; color: var(--text-3); font-size: .75rem; }
.hub-map-empty i { font-size: 1.8rem; }
/* Keep the popup header and Save / Cancel bar fixed while the form scrolls */
.modal-dialog-scrollable .modal-content > form { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; overflow: hidden; }

/* Hub popup: hub details (60%) beside contact persons (40%) */
.popup-split { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); border-bottom: 1px solid var(--border); }
.popup-split > .form-section { border-bottom: 0; }
.popup-split > .contacts-side { border-left: 1px solid var(--border); background: #fafbfe; display: flex; flex-direction: column; }
/* The contact list is as tall as the hub details beside it and scrolls when there are more contacts */
.contacts-side .js-contacts { flex: 1 1 0; min-height: 150px; overflow-y: auto; padding-right: 4px; }
.contacts-side .section-title .btn { text-transform: none; letter-spacing: 0; }
.contact-card { display: grid; grid-template-columns: 1.5fr 1fr 32px; gap: .45rem; padding: .6rem; margin-bottom: .5rem; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.contact-card { position: relative; transition: box-shadow .3s, border-color .3s; }
.contact-card .cc-name { grid-column: 1 / 3; grid-row: 1; }
.contact-card .cc-star { grid-column: 3; grid-row: 1; }
.contact-card .cc-email { grid-column: 1; grid-row: 2; }
.contact-card .cc-phone { grid-column: 2; grid-row: 2; }
.contact-card .cc-del { grid-column: 3; grid-row: 2; }
.btn-star { --bs-btn-color: var(--text-3); --bs-btn-bg: #fff; --bs-btn-border-color: #d5dbe7; --bs-btn-hover-color: #d97706; --bs-btn-hover-bg: #fffbeb; --bs-btn-hover-border-color: #fcd34d; }
.contact-card.is-primary { border-color: #fcd34d; box-shadow: 0 0 0 1px #fde68a; }
.contact-card.is-primary::before { content: 'PRIMARY'; position: absolute; top: -.55rem; left: .6rem; font-size: .55rem; font-weight: 700; letter-spacing: .06em; color: #92400e; background: #fef3c7; border-radius: 999px; padding: .05rem .45rem; }
.contact-card.is-primary .btn-star { --bs-btn-color: #d97706; --bs-btn-border-color: #fcd34d; --bs-btn-bg: #fffbeb; }
.contact-card.flash { box-shadow: 0 0 0 3px rgba(217, 119, 6, .35); }
.contacts-side .js-contacts { padding-top: .6rem; }
.contact-card .btn-icon { width: 32px; height: 32px; }
.content .contact-card .form-control, .modal .contact-card .form-control { min-height: 32px; padding-top: .3rem; padding-bottom: .3rem; }
.input-group-icon .input-group-text { background: #fff; color: var(--text-3); font-size: .75rem; padding: 0 .55rem; border-color: #d5dbe7; }
.input-group-icon .form-control { border-left: 0; }
.input-group-icon .form-control:focus { border-left: 1px solid var(--primary); }
@media (max-width: 991.98px) {
    .popup-split { grid-template-columns: minmax(0, 1fr); }
    .popup-split > .contacts-side { border-left: 0; border-top: 1px solid var(--border); }
}
.contacts-side .section-title .badge { text-transform: none; letter-spacing: 0; font-size: .65rem; }
.hub-of { font-size: .75rem; color: var(--text-2); background: var(--primary-soft); border-radius: 999px; padding: .3rem .75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60%; }
.hub-of i { color: var(--primary); margin-right: .2rem; }
.hub-of b { color: var(--text); font-weight: 600; }
.hub-meta { font-size: .65rem; color: var(--text-2); white-space: nowrap; line-height: 1.5; }
.hub-meta i { color: var(--text-3); font-size: .6rem; margin-right: .3rem; }

/* Customer Company: warehouse companies picker */


.wh-pick-col { display: flex; flex-direction: column; }
.wh-pick-col .section-title .badge { text-transform: none; letter-spacing: 0; font-size: .65rem; }
.wh-pick { border: 1px solid #d5dbe7; border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; background: #fff; }
.wh-pick-search { position: relative; border-bottom: 1px solid var(--border); }
.wh-pick-search i { position: absolute; left: .6rem; top: 50%; transform: translateY(-50%); color: var(--text-3); font-size: .75rem; }
.wh-pick-search .form-control { border: 0; border-radius: 0; padding-left: 1.8rem; box-shadow: none; }
.wh-pick-list { overflow-y: auto; max-height: 132px; flex: 1 1 auto; }
.wh-pick-item { display: flex; align-items: center; gap: .55rem; padding: .32rem .65rem; margin: 0; cursor: pointer; font-size: .8rem; border-bottom: 1px solid #f0f2f7; }
.wh-pick-item:last-child { border-bottom: 0; }
.wh-pick-item:hover { background: #f7f9fc; }
.wh-pick-item.is-on { background: var(--primary-soft); }
.wh-pick-item .form-check-input { margin: 0; flex: 0 0 auto; }
.wh-pick-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wh-pick-code { font-size: .68rem; color: var(--text-3); font-weight: 600; }
@media (min-width: 992px) { .wh-pick-col { border-left: 1px solid var(--border); } }
.wh-badge { text-transform: none; letter-spacing: 0; font-size: .65rem; }
.wh-chip { display: inline-flex; align-items: center; gap: .35rem; padding: .28rem .6rem; margin: 0 .35rem .35rem 0; border: 1px solid var(--border); border-radius: 999px; font-size: .78rem; background: #f7f9fc; }
.wh-chip i { color: var(--primary); font-size: .75rem; }
.wh-chip small { color: var(--text-3); font-weight: 600; font-size: .68rem; }
.section-sub { margin: -.7rem 0 .75rem calc(4px + .55rem); font-size: .72rem; color: var(--text-3); }
/* Service centre popup: warehouse hub ticks */
.modal .section-sub { margin-top: -.6rem; }
.hub-group + .hub-group { margin-top: .75rem; }
.hub-group-name { font-size: .72rem; font-weight: 700; color: var(--text-2); margin-bottom: .4rem; }
.hub-group-name i { color: var(--primary); }
.hub-ticks { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .45rem; }
.hub-tick { display: flex; align-items: center; gap: .5rem; padding: .4rem .6rem; margin: 0; border: 1px solid #d5dbe7; border-radius: 8px; font-size: .8rem; cursor: pointer; background: #fff; }
.hub-tick:hover { border-color: var(--primary); }
.hub-tick.is-on { background: var(--primary-soft); border-color: var(--primary); }
.hub-tick .form-check-input { margin: 0; flex: 0 0 auto; }
.hub-tick-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hub-tick-code { font-size: .68rem; color: var(--text-3); font-weight: 600; white-space: nowrap; }
.modal .section-title .js-hub-count { text-transform: none; letter-spacing: 0; font-size: .65rem; }
.hub-tick-dist { font-size: .66rem; font-weight: 700; border-radius: 999px; padding: .05rem .4rem; white-space: nowrap; }
.hub-tick-dist:empty { display: none; }
.hub-tick-dist.is-near { color: #15803d; background: #dcfce7; }
.hub-tick-dist.is-far { color: #b91c1c; background: #fee2e2; }

/* Service centre popup: warehouse hub map (Leaflet) */
.centre-map { min-height: 340px; z-index: 0; }
.centre-map-canvas { position: absolute; inset: 0; font-family: inherit; background: #eef2f7; }
.map-legend { display: flex; flex-wrap: wrap; gap: .25rem .9rem; font-size: .72rem; color: var(--text-2); margin-bottom: .4rem; }
.map-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.map-legend b { font-weight: 600; color: var(--text-3); }
.pin-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(15, 23, 42, .12); }
.pin-blue { background: #1d4ed8; } .pin-green { background: #16a34a; } .pin-red { background: #dc2626; }
.co-legend:empty { display: none; }
.co-legend { margin-top: -.15rem; }
.co-key { display: inline-flex; align-items: center; gap: .2rem; }
.co-key + .co-key { margin-left: .2rem; }
.co-swatch { display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; border-radius: 50%; color: #fff; font-style: normal; font-size: .5rem; font-weight: 700; }
.co-key .co-swatch:last-of-type { margin-right: .15rem; }
.map-foot { font-size: .7rem; color: var(--text-3); margin-top: .4rem; line-height: 1.5; }
.map-foot i { margin-right: .2rem; }
.map-pin { background: none; border: 0; }
.map-pin svg { display: block; filter: drop-shadow(0 1px 2px rgba(15, 23, 42, .35)); }
.centre-map .leaflet-popup-content { margin: .65rem .8rem; font-size: .78rem; line-height: 1.4; }
.centre-map .leaflet-popup-content-wrapper { border-radius: 10px; }
.pin-pop-name { font-weight: 700; color: var(--text); }
.pin-pop-name span { font-size: .68rem; color: var(--text-3); font-weight: 600; margin-left: .2rem; }
.pin-pop-meta { color: var(--text-2); font-size: .72rem; }
.pin-pop-dist { margin-top: .3rem; font-size: .72rem; font-weight: 600; color: var(--text-3); }
.pin-pop-dist.is-near { color: #15803d; } .pin-pop-dist.is-far { color: #b91c1c; }
.centre-map .leaflet-control-attribution { font-size: .6rem; }

/* Save / Delete confirmation (standard) */
.app-confirm { position: fixed; inset: 0; z-index: 2000; display: none; align-items: center; justify-content: center; background: rgba(15, 23, 42, .45); padding: 16px; }
.app-confirm.show { display: flex; }
.app-confirm-card { background: #fff; border-radius: 12px; box-shadow: 0 20px 50px rgba(15, 23, 42, .25); width: 100%; max-width: 400px; padding: 1.4rem 1.4rem 1.1rem; text-align: center; }
.app-confirm-icon { width: 48px; height: 48px; margin: 0 auto .75rem; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; background: var(--primary-soft); color: var(--primary); }
.app-confirm.is-danger .app-confirm-icon { background: var(--danger-soft); color: var(--danger); }
.app-confirm-title { font-weight: 700; font-size: 1rem; margin-bottom: .35rem; }
.app-confirm-msg { font-size: .85rem; color: var(--text-2); margin-bottom: 1.1rem; }
.app-confirm-actions { display: flex; gap: .5rem; justify-content: center; }
.btn-delete-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-delete-solid:hover, .btn-delete-solid:focus { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.page-bottom-actions { display: flex; align-items: center; gap: .5rem; margin-top: 1rem; }

/* Error Solving */
.err-table .err-msg { max-width: 520px; }
.err-table .err-msg div { font-size: .78rem; margin-top: .2rem; word-break: break-word; }
.err-table .err-url { font-size: .75rem; color: var(--text-2); word-break: break-all; max-width: 260px; }
.err-message { font-weight: 600; color: var(--danger); word-break: break-word; }
.err-report { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .74rem; line-height: 1.45; background: #f8fafc; }
.btn.copied { background: var(--success-soft) !important; color: var(--success) !important; border-color: var(--success) !important; }

/* Product Master */
@media (min-width: 1200px) { .prod-group + .prod-group { border-left: 1px solid var(--border); } }
.calc-section { background: #fafbfe; }
/* Product Master v1.59: Active switch on the Product Details title line, stacking rule options */
.section-title .section-switch { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: .75rem; margin: 0; min-height: 0; }
.section-title .section-switch .form-check-input { margin-top: .1rem; }
.stack-opts { display: flex; flex-direction: column; gap: .6rem; }
.stack-opt { display: flex; align-items: flex-start; gap: .7rem; padding: .7rem .8rem; border: 1px solid var(--border); border-radius: 10px; background: #fff; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
.stack-opt:hover { border-color: #b7c4e0; }
.stack-opt.is-on { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 1px var(--primary) inset; }
.stack-opt .form-check-input { flex: 0 0 auto; margin-top: .55rem; }
.stack-opt .stack-ico { flex: 0 0 34px; height: 34px; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: #eef2f8; color: var(--text-2); font-size: 1rem; }
.stack-opt.is-on .stack-ico { background: var(--primary); color: #fff; }
.stack-opt b { display: block; font-size: .8rem; }
.vw-stack-rule { display: flex; align-items: flex-start; gap: .7rem; padding: .75rem .85rem; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.vw-stack-rule .stack-ico { flex: 0 0 34px; height: 34px; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: var(--primary); color: #fff; font-size: 1rem; }
.vw-stack-rule b { display: block; font-size: .85rem; }
.vw-stack-rule small { display: block; font-size: .74rem; color: var(--text-2); line-height: 1.4; margin-top: .15rem; }
.stack-opt small { display: block; font-size: .72rem; color: var(--text-2); line-height: 1.35; margin-top: .1rem; }
.calc-badge { text-transform: none; letter-spacing: 0; font-size: .65rem; }
.calc-out[readonly] { background: #eef2f8; color: var(--text); font-weight: 600; }
.is-custom { background: #fffbea; border-color: #f2c94c; }
.calc-unit { max-width: 90px; }
.img-slots { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .75rem; }
@media (max-width: 991.98px) { .img-slots { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.img-slot { position: relative; aspect-ratio: 1 / 1; max-height: 150px; border: 2px dashed #cfd6e4; border-radius: 10px; background: #fafbfe; cursor: pointer; overflow: hidden; margin: 0; display: flex; align-items: center; justify-content: center; transition: border-color .15s, background .15s; }
.img-slot:hover { border-color: var(--primary); background: var(--primary-soft); }
.img-slot.has-img { border-style: solid; border-color: var(--border); background: #fff; }
.img-empty { display: flex; flex-direction: column; align-items: center; color: var(--text-3); position: relative; }
.img-empty .bi-image { font-size: 2rem; }
.img-empty .plus { position: absolute; top: 1.15rem; right: -.35rem; font-size: .85rem; color: var(--primary); background: #fff; border-radius: 50%; }
.img-empty small { font-size: .7rem; margin-top: .2rem; }
.img-slot img { width: 100%; height: 100%; object-fit: cover; }
.img-remove { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; padding: 0; border-radius: 50%; background: rgba(15,23,42,.7); color: #fff; font-size: .7rem; }
.img-remove:hover { background: var(--danger); color: #fff; }
.section-title .js-img-count { text-transform: none; letter-spacing: 0; font-size: .65rem; }
.js-product-form .input-group-text { font-size: .78rem; padding: 0 .6rem; color: var(--text-2); }
.js-product-form .calc-section .btn-soft { font-size: .78rem; }
.pallet-size { font-size: .7rem; color: var(--text-3); margin-top: .35rem; }
.pallet-size i { color: var(--primary); }
@media (min-width: 768px) { .calc-section .prod-group + .prod-group { border-left: 1px solid var(--border); } }
.calc-section .form-label .calc-badge { font-size: .6rem; }
.calc-section .pallet-cell + .pallet-cell { border-left: 0 !important; }
.pallet-view { height: 230px; border: 1px solid var(--border); border-radius: 10px; background: linear-gradient(#fff, #f3f6fb); display: flex; align-items: center; justify-content: center; padding: 8px; }
.pallet-view svg { width: 100%; height: 100%; }
.pallet-view-empty { color: var(--text-3); font-size: .78rem; text-align: center; }
.pallet-view-empty i { display: block; font-size: 1.8rem; margin-bottom: .3rem; }
.pallet-view .cse-t { fill: #e9c99a; stroke: #9a7346; stroke-width: .35; }
.pallet-view .cse-l { fill: #d4a96c; stroke: #9a7346; stroke-width: .35; }
.pallet-view .cse-r { fill: #c0925a; stroke: #9a7346; stroke-width: .35; }
.pallet-view .plt-t { fill: #b98a5b; stroke: #7a5532; stroke-width: .4; }
.pallet-view .plt-l { fill: #a0744a; stroke: #7a5532; stroke-width: .4; }
.pallet-view .plt-r { fill: #8c623c; stroke: #7a5532; stroke-width: .4; }
.pallet-view .plt-max { fill: none; stroke: var(--primary); stroke-width: .8; stroke-dasharray: 4 3; }

/* Product Master list + view */
.prod-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center; background: var(--surface-2, #f6f7f9); color: var(--text-3); }
.img-gallery { display: flex; flex-wrap: wrap; gap: .5rem; }
.img-gallery img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.img-gallery a:hover img { border-color: var(--primary, #2563eb); }
.pallet-view-title { font-size: .72rem; font-weight: 600; color: var(--text-2, #475569); margin-bottom: .25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pallet-view-title span { font-weight: 400; color: var(--text-3); }
.dp-stack .dp-stack-note { align-self: start; margin: 0; padding: .2rem .1rem; font-size: .62rem; line-height: 1.3; }
.dp-stack .dp-stack-note small { font-size: .56rem; line-height: 1.35; margin-top: .2rem; }
.dp-pallet:nth-child(even) + .dp-stack-note { grid-column: 1 / -1; padding-top: .2rem; }
.dp-stack-normal { font-size: .74rem; padding: .4rem .6rem; border: 1px solid var(--border); border-radius: 8px; background: #f8fafc; color: var(--text-2); }
.dp-stack-normal b { color: var(--text); font-size: .86rem; }
.dp-empty { margin-top: .2rem; color: #b45309; }
.dp-empty b { color: #b45309; }
.dp-empty small { display: block; color: var(--text-3); font-size: .58rem; }
.dp-empty-bar { display: block; height: 5px; border-radius: 3px; background: #fde68a; margin-bottom: .15rem; overflow: hidden; }
.dp-empty-bar i { display: block; height: 100%; background: #16a34a; }
.pallet-view.pallet-view-sm { height: 210px; }
.input-group-dims .form-control { padding-left: .4rem; padding-right: .4rem; min-width: 0; }
.fit-info { font-size: .49rem; color: var(--text-2, #475569); background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: .5rem .65rem; display: grid; gap: .3rem; }
.fit-info .fit-tag { display: inline-block; min-width: 98px; font-weight: 600; color: var(--text-1, #1e293b); }
.fit-unused:empty { display: none; }
.fit-unused { display: flex; gap: .45rem; color: #8b5a2b; background: #fbf4ec; border: 1px solid #ecd9c3; border-radius: 6px; padding: .4rem .55rem; margin-top: .15rem; }
.fit-unused > i { color: #a0692f; margin-top: 1px; }
.fit-unused div + div { margin-top: .2rem; }
.calc-section .js-pallet-size { font-size: .476rem; }
.calc-section .fit-small { font-size: .49rem; }
@media (min-width: 1200px) {
  .pallet-draw-col { display: flex; flex-direction: column; }
  .pallet-draw-row { flex: 1 1 auto; }
  .pallet-draw-row > div { display: flex; flex-direction: column; }
  .pallet-draw-row .pallet-view.pallet-view-sm { flex: 1 1 auto; height: auto; min-height: 210px; }
}
@media (min-width: 1200px) {
  .pallet-draw-row .pallet-view.pallet-view-sm { position: relative; min-height: 0; }
  .pallet-draw-row .pallet-view.pallet-view-sm svg { position: absolute; inset: 8px; width: calc(100% - 16px); height: calc(100% - 16px); }
  .pallet-draw-col { min-height: 0; }
  .pallet-draw-row { min-height: 210px; }
}

/* Container Master (v1.18) */
.input-group > .form-select.unit-select { flex: 0 0 5rem; width: 5rem; background-color: #f1f4f9; color: var(--text-2); }
.input-group > .input-group-text.unit-text { flex: 0 0 5rem; justify-content: center; font-size: inherit; color: var(--text-2); }
.js-code-upper { text-transform: uppercase; }
.js-code-upper::placeholder { text-transform: none; }
.img-slot.container-photo { max-height: none; width: 100%; max-width: 150px; }
.container-photo-view { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; max-width: 150px; aspect-ratio: 1 / 1; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #fafbfe; color: var(--text-3); }
.container-photo-view img { width: 100%; height: 100%; object-fit: cover; }
.container-photo-view.empty .bi { font-size: 1.8rem; }
.container-photo-view.empty small { font-size: .7rem; }
a.container-photo-view:hover { border-color: var(--primary); }
@media (min-width: 992px) {
    .col-lg-w20 { flex: 0 0 auto; width: 20%; }
    .col-lg-w30 { flex: 0 0 auto; width: 30%; }
    .col-lg-w50 { flex: 0 0 auto; width: 50%; }
}
.container-photo-col { width: 170px; }
@media (min-width: 992px) { .container-photo-col { width: 200px; border-left: 1px solid var(--border); padding-left: 1.5rem; margin-left: .75rem; } }
.container-photo-col .img-slot.container-photo { max-width: none; }
@media (max-width: 767.98px) { .container-photo-col { width: 100%; } .container-photo-col .img-slot.container-photo { max-width: 150px; } }
@media (min-width: 992px) { .container-split-right { border-left: 1px solid var(--border); } .container-split .form-section { height: 100%; } }
.container-split .form-section + .form-section { border-top: 0; }
@media (max-width: 991.98px) { .container-split-right .form-section { border-top: 1px solid var(--border); } }
.container-split .input-group > .form-select.unit-select, .container-split .input-group > .input-group-text.unit-text { flex-basis: 4rem; width: 4rem; }

/* ---------- View screens: standard layout (v1.23, Yash 24 Nov 2026) ----------
   Components: x-view.header, x-view.rows, x-view.address, x-view.history (resources/views/components/view). */
.vw { overflow: hidden; }
.vw .form-section { padding: 1rem 1.25rem; }
.vw .section-title { margin-bottom: .6rem; }
.vw .section-title .badge { text-transform: none; letter-spacing: 0; font-size: .65rem; }
.vw-ico { width: 28px; height: 28px; flex: 0 0 28px; border-radius: 7px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-size: .85rem; }
.vw-code { display: inline-block; padding: .1rem .45rem; border-radius: 6px; background: #eef1f6; color: var(--text-2); font-size: .68rem; font-weight: 700; letter-spacing: .04em; }

/* Identity header: initials, name, status, ID, quick facts */
.vw-hero { display: flex; gap: 1rem; align-items: flex-start; padding: 1.15rem 1.25rem; background: linear-gradient(180deg, var(--primary-soft), #fff); border-bottom: 1px solid var(--border); }
.vw-avatar { width: 52px; height: 52px; flex: 0 0 52px; border-radius: 12px; display: grid; place-items: center; background: var(--primary); color: #fff; font-weight: 700; font-size: 1.05rem; letter-spacing: .02em; box-shadow: 0 4px 10px rgba(29, 78, 216, .25); }
.vw-avatar.is-inactive { background: #94a3b8; box-shadow: none; }
.vw-hero-main { min-width: 0; flex: 1; }
.vw-hero-title { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; font-size: 1rem; font-weight: 700; color: var(--text); line-height: 1.3; word-break: break-word; }
.vw-hero-sub { margin-top: .2rem; display: flex; align-items: center; gap: .5rem; font-size: .72rem; color: var(--text-2); }
.vw-facts { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; margin-top: .65rem; font-size: .75rem; }
.vw-facts span, .vw-facts a { display: inline-flex; align-items: center; gap: .4rem; color: var(--text); text-decoration: none; min-width: 0; word-break: break-all; }
.vw-facts a:hover { color: var(--primary); }
.vw-facts i { color: var(--primary); font-size: .8rem; }

/* Two sections side by side */
.vw-cols { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--border); }
.vw-cols > .form-section { border-bottom: 0; }
.vw-cols > .form-section + .form-section { border-left: 1px solid var(--border); }
/* A column with sections stacked (e.g. contacts + hubs) next to a map */
.vw-cols > .vw-stack > .form-section + .form-section { border-top: 1px solid var(--border); }
.vw-cols > .vw-stack + .form-section { border-left: 1px solid var(--border); }
.vw-cols > .form-section + .vw-stack { border-left: 1px solid var(--border); }
.vw-cols > .vw-stack > .form-section { border-bottom: 0; }
.vw-map-col { display: flex; flex-direction: column; }
.vw-map-col .centre-map { flex: 1 1 auto; min-height: 380px; }

.vw-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.vw-cols-photo { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 210px; }
.vw .container-photo-view { max-width: 170px; }
.vw-avatar .bi { font-size: 1.5rem; }
.vw-hero-title .badge .bi { font-size: .6rem; }

/* Label / value rows */
.vw-rows { margin: 0; }
.vw-rows > div { display: grid; grid-template-columns: minmax(96px, min(38%, 170px)) 1fr; gap: .75rem; padding: .45rem 0; border-bottom: 1px dashed var(--border); font-size: .7875rem; }
.vw-rows > div:last-child { border-bottom: 0; }
.vw-rows dt { font-weight: 500; color: var(--text-2); font-size: .72rem; align-self: center; }
.vw-rows > div.vw-pair { grid-template-columns: minmax(96px, min(38%, 170px)) minmax(0, 1fr) 145px minmax(0, .7fr); }
@media (max-width: 575.98px) { .vw-rows > div.vw-pair { grid-template-columns: minmax(96px, 38%) 1fr; } }
.vw-rows dd { margin: 0; font-weight: 500; color: var(--text); word-break: break-word; }

/* Value in the entered unit (black) + the other unit (grey), e.g. 25.59 in | 65 cm */
.vw-rows dd.vw-dual { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.vw-alt { color: var(--text-3); font-weight: 500; }
.vw-note { display: flex; gap: .35rem; align-items: flex-start; margin-top: 0; padding-top: .45rem; border-top: 1px dashed var(--border); font-size: .62rem; line-height: 1.45; color: var(--text-2); }
.vw-explain { margin-top: .6rem; padding: .6rem .8rem; border: 1px solid var(--primary-border); border-radius: var(--radius-sm); background: var(--primary-soft); font-size: .578rem; line-height: 1.45; color: var(--text-2); }
.vw-explain-title { display: flex; align-items: center; gap: .4rem; margin-bottom: .35rem; font-weight: 700; color: var(--text); font-size: .72rem; }
.vw-explain-title i { color: var(--primary); }
.vw-explain p { margin: 0 0 .25rem; }
.vw-explain b { color: var(--text); font-weight: 600; }
.vw-explain .bi { color: var(--primary); }
.vw-note i { color: var(--primary); font-size: .66rem; margin-top: .05rem; }

/* Address block */
.vw-address { display: flex; gap: .75rem; align-items: flex-start; font-size: .7875rem; line-height: 1.55; font-weight: 500; }
.vw-address small { display: block; color: var(--text-2); font-weight: 400; font-size: .72rem; }

/* Record history: one line at the bottom of the card */
.vw-history { display: flex; flex-wrap: wrap; gap: .35rem 1.5rem; padding: .7rem 1.25rem; border-top: 1px solid var(--border); background: #fafbfe; font-size: .68rem; color: var(--text-2); }
.vw-history i { color: var(--text-3); margin-right: .3rem; }
.vw-history b { font-weight: 600; color: var(--text); }
.vw > .form-section:last-of-type { border-bottom: 0; }

@media (max-width: 767.98px) {
    .vw-cols, .vw-cols-3, .vw-cols-photo { grid-template-columns: 1fr; }
    .vw-cols > .form-section + .form-section { border-left: 0; border-top: 1px solid var(--border); }
    .vw-cols > .vw-stack + .form-section { border-left: 0; border-top: 1px solid var(--border); }
    .vw-cols > .form-section + .vw-stack { border-left: 0; border-top: 1px solid var(--border); }
    .vw-hero { padding: 1rem; gap: .75rem; }
    .vw-avatar { width: 44px; height: 44px; flex-basis: 44px; font-size: .9rem; }
}

/* v1.30 Customer Company form: Location under the company details, Default Container under Warehouse Companies */
.cust-loc .form-section { padding: 1.1rem 0 0; margin-top: 1.1rem; border-top: 1px solid var(--border); border-bottom: 0; }
.ct-pick-col { margin-top: 1.1rem; padding-top: 1.1rem; border-top: 1px solid var(--border); }
.ct-pick-col .section-title .badge { text-transform: none; letter-spacing: 0; font-size: .65rem; }
.ct-pick.is-invalid { border-color: var(--bs-form-invalid-border-color, #dc3545); }
.ct-pick-list { max-height: 248px; }
.wh-pick-col .wh-pick { flex: 0 0 auto; }
.ct-pick-item { align-items: center; padding: .4rem .65rem; }
.ct-pick-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.ct-pick-meta { font-size: .66rem; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-pick-cap { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; }
.ct-pick-cap b { font-size: .74rem; font-weight: 600; color: var(--text); }
.ct-pick-cap small { font-size: .64rem; color: var(--text-3); }
.ct-pick-item.is-on .ct-pick-cap b { color: var(--primary); }

/* Customer Company view: default container card */
.ct-card { display: flex; align-items: center; gap: .85rem; padding: .7rem .85rem; border: 1px solid var(--border); border-radius: var(--radius-sm, 8px); background: #fafbfe; }
.ct-card-icon { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 9px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-size: 1.05rem; }
.ct-card-main { flex: 1 1 auto; min-width: 0; }
.ct-card-name { font-weight: 600; font-size: .8rem; color: var(--text); }
.ct-card-name a { color: inherit; text-decoration: none; }
.ct-card-name a:hover { color: var(--primary); }
.ct-card-name small { color: var(--text-3); font-weight: 600; font-size: .66rem; margin-left: .35rem; }
.ct-card-meta { font-size: .7rem; color: var(--text-2); }
.ct-card-cap { text-align: right; line-height: 1.25; }
.ct-card-cap b { display: block; font-size: .85rem; color: var(--text); }
.ct-card-cap small { font-size: .66rem; color: var(--text-3); }
.cust-note { margin-top: 1.25rem; padding-top: 1.1rem; border-top: 1px solid var(--border); }
.cust-note-title { display: flex; align-items: center; gap: .4rem; margin-bottom: .6rem; font-size: .74rem; font-weight: 700; color: var(--text); }
.cust-note-title i { color: var(--primary); }
.cust-note-row { display: flex; gap: .7rem; align-items: flex-start; padding: .6rem .8rem; margin-bottom: .5rem; border: 1px solid var(--primary-border); border-radius: var(--radius-sm); background: var(--primary-soft); }
.cust-note-row:last-child { margin-bottom: 0; }
.cust-note-icon { width: 28px; height: 28px; flex: 0 0 28px; border-radius: 7px; display: grid; place-items: center; background: #fff; color: var(--primary); font-size: .85rem; }
.cust-note-row p { margin: 0; font-size: .72rem; line-height: 1.5; color: var(--text-2); }
.cust-note-row b { color: var(--text); font-weight: 600; }

/* ---------- v1.31 Orders (step 1: creation and submission) and the bell ---------- */
/* Greeting box: the round decoration is drawn in the background so the bell menu is not cut off */
.welcome { overflow: visible; background: radial-gradient(circle at calc(100% - 70px) 50px, rgba(255, 255, 255, .08) 130px, transparent 131px), linear-gradient(120deg, #1d4ed8 0%, #2563eb 55%, #3b82f6 100%); }
.welcome::after { display: none; }
.welcome-actions { position: relative; z-index: 2; }

.bell-btn { position: relative; width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .14); color: #fff; display: grid; place-items: center; font-size: 1.1rem; transition: background .15s; }
.bell-btn:hover, .bell-btn[aria-expanded="true"] { background: rgba(255, 255, 255, .26); }
.bell-count { position: absolute; top: -4px; right: -4px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: #ef4444; color: #fff; font-size: .65rem; font-weight: 700; line-height: 19px; text-align: center; box-shadow: 0 0 0 2px #2563eb; }
.bell-menu { width: 360px; max-width: calc(100vw - 24px); padding: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-top: .4rem !important; }
.bell-head { display: flex; align-items: center; gap: .5rem; padding: .7rem .9rem; border-bottom: 1px solid var(--border); font-size: .8rem; color: var(--text); }
.bell-link { background: none; border: 0; padding: 0; color: var(--primary); font-size: .72rem; font-weight: 600; }
.bell-list { max-height: 360px; overflow-y: auto; }
.bell-list-page { max-height: none; }
.bell-item { display: flex; gap: .7rem; padding: .7rem .9rem; border-bottom: 1px solid var(--border); text-decoration: none; color: var(--text); }
.bell-item:last-child { border-bottom: 0; }
.bell-item:hover { background: var(--primary-soft); color: var(--text); }
.bell-item.is-new { background: #f5f8ff; }
.bell-item.is-new b::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); margin-right: .4rem; vertical-align: middle; }
.bell-item .kpi-icon { width: 32px; height: 32px; flex: 0 0 32px; font-size: .9rem; border-radius: 8px; }
.bell-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.bell-text b { font-size: .78rem; font-weight: 600; }
.bell-text small { font-size: .72rem; color: var(--text-2); }
.bell-text em { font-style: normal; font-size: .66rem; color: var(--text-3); margin-top: .15rem; }
.bell-empty { padding: 1.5rem 1rem; text-align: center; color: var(--text-3); font-size: .75rem; }
.bell-empty i { display: block; font-size: 1.4rem; margin-bottom: .3rem; }
.bell-all { display: block; padding: .6rem .9rem; text-align: center; border-top: 1px solid var(--border); font-size: .74rem; font-weight: 600; text-decoration: none; background: #fafbfe; }

/* Order list: status tabs */
.ord-tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .8rem; }
.ord-tabs a { display: inline-flex; align-items: center; gap: .45rem; padding: .35rem .8rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: .74rem; font-weight: 600; text-decoration: none; }
.ord-tabs a span { min-width: 20px; padding: 0 .35rem; border-radius: 999px; background: #eef1f6; color: var(--text-2); font-size: .66rem; text-align: center; }
.ord-tabs a:hover { border-color: var(--primary-border); color: var(--primary); }
.ord-tabs a.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.ord-tabs a.active span { background: rgba(255, 255, 255, .22); color: #fff; }

/* Order form: details on the left, container check on the right */
.ord-head { display: grid; grid-template-columns: minmax(0, 1fr) 360px; border-bottom: 1px solid var(--border); }
.ord-head > .form-section { border-bottom: 0; }
.ord-head > .form-section + .form-section { border-left: 1px solid var(--border); }
@media (max-width: 991.98px) { .ord-head { grid-template-columns: 1fr; } .ord-head > .form-section + .form-section { border-left: 0; border-top: 1px solid var(--border); } }
.js-hub-meta i { color: var(--primary); }

/* Order lines */
.ord-lines { margin-bottom: 0; }
.ord-lines thead th { font-size: .68rem; }
.ord-lines td { font-size: .78rem; }
.ord-lines .form-select, .ord-lines .form-control { font-size: .78rem; }
.ord-lines .js-product { min-width: 240px; }
.ord-lines .hub-meta { white-space: normal; }
.ord-total td { font-weight: 700; background: #fafbfe; border-top: 2px solid var(--border); font-size: .8rem; }
.ord-total .hub-meta { font-weight: 500; }
.ord-lines-view .prod-thumb { width: 36px; height: 36px; }

/* Container check */
.ord-fit { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .75rem .85rem; background: #fafbfe; }
.ord-fit-head { display: flex; align-items: center; gap: .7rem; }
.ord-fit-icon { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 8px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.ord-fit-name { font-weight: 600; font-size: .8rem; }
.ord-fit-name small { color: var(--text-3); font-weight: 600; font-size: .66rem; margin-left: .3rem; }
.ord-fit-meta { font-size: .68rem; color: var(--text-2); }
.ord-fit-pct { font-size: 1.15rem; font-weight: 700; color: var(--success); }
.ord-fit-track { height: 10px; border-radius: 999px; background: #e7ebf3; overflow: hidden; margin: .65rem 0 .45rem; }
.ord-fit-bar { height: 100%; border-radius: 999px; background: var(--success); transition: width .2s; }
.ord-fit-foot { display: flex; justify-content: space-between; font-size: .7rem; color: var(--text-2); }
.ord-fit-msg { margin-top: .5rem; font-size: .7rem; font-weight: 600; color: var(--success); display: flex; gap: .35rem; align-items: center; }
.ord-fit.is-warn .ord-fit-pct, .ord-fit.is-warn .ord-fit-msg { color: var(--warning); }
.ord-fit.is-warn .ord-fit-bar { background: #f59e0b; }
.ord-fit.is-over { border-color: #fca5a5; background: var(--danger-soft); }
.ord-fit.is-over .ord-fit-pct, .ord-fit.is-over .ord-fit-msg { color: var(--danger); }
.ord-fit.is-over .ord-fit-bar { background: var(--danger); }

/* Create New PO: product list with a cases box per product (about 15 rows, then it scrolls) */
.po-search { width: 260px; max-width: 100%; }
.po-scroll { max-height: 790px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.po-table { margin: 0; }
.po-table thead th { position: sticky; top: 0; z-index: 1; background: #f6f8fc; font-size: .66rem; box-shadow: inset 0 -1px 0 var(--border); }
.po-table td { font-size: .76rem; padding-top: .35rem; padding-bottom: .35rem; }
.po-table .hub-meta { white-space: normal; }
.po-table .js-qty { max-width: 110px; margin-left: auto; font-weight: 600; }
.po-table tr.is-on td { background: #f5f8ff; }
.po-table tr.is-on .js-qty { border-color: var(--primary-border); color: var(--primary); }
.po-total-row td { position: sticky; bottom: 0; z-index: 1; background: #eef3ff; border-top: 2px solid var(--primary-border); font-size: .78rem; font-weight: 600; }
.po-total-row b { font-size: .9rem; }
/* Container utilisation on the left under the list (Yash, 24 Nov 2026) */
.po-fit-row, .ord-under { display: grid; grid-template-columns: minmax(0, 30%); gap: 1rem; margin-top: .85rem; }
@media (max-width: 1199.98px) { .po-fit-row, .ord-under { grid-template-columns: minmax(0, 50%); } }
.po-fit-title, .ord-fit-title { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); margin-bottom: .4rem; }
@media (max-width: 767.98px) { .po-fit-row, .ord-under { grid-template-columns: 1fr; } }

/* v1.33 Order: Confirm Order / Edit Order on the right of the order title box; admin Edit Order header (read only) */
.vw-hero-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-left: auto; align-self: center; }
.ord-ro { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.ord-ro dt { font-size: .72rem; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .03em; margin-bottom: .2rem; }
.ord-ro dd { margin: 0; font-size: .875rem; font-weight: 600; color: var(--text); }
.ord-ro dd small { display: block; font-weight: 400; color: var(--text-2); font-size: .75rem; }
@media (max-width: 991.98px) { .ord-ro { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767.98px) {
    .vw-hero:has(.vw-hero-actions) { flex-wrap: wrap; }
    .vw-hero-actions { width: 100%; margin-left: 0; }
    .vw-hero-actions .btn { flex: 1 1 auto; }
    .ord-ro { grid-template-columns: 1fr; }
}

/* v1.34 Order: Container & Shipping box next to Container Utilisation */
.badge-soft-ready { background: #f1ecfe; color: #6d28d9; }
.ord-under.has-ship { grid-template-columns: minmax(0, 30%) minmax(0, 1fr); align-items: start; }
.ship-box { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .75rem .85rem; background: #fafbfe; }
.ship-head { display: flex; align-items: center; gap: .7rem; margin-bottom: .75rem; }
.ship-ro { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem 1rem; margin: 0; }
.ship-ro dt { font-size: .68rem; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .03em; margin-bottom: .15rem; }
.ship-ro dd { margin: 0; font-size: .85rem; font-weight: 600; color: var(--text); min-width: 0; }
.ship-ro .ship-wide { grid-column: 1 / -1; }
.ship-note { white-space: pre-line; font-weight: 400 !important; }
.ship-file { display: inline-flex; align-items: center; gap: .35rem; max-width: 100%; }
.ship-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ship-file .bi-file-earmark-pdf { color: var(--danger); }
.ship-foot { margin-top: .7rem; padding-top: .55rem; border-top: 1px dashed var(--border); font-size: .72rem; color: var(--text-3); }
.ship-form .form-label { font-size: .75rem; }
.ship-actions { display: flex; align-items: center; justify-content: flex-end; gap: .5rem; margin-top: .75rem; flex-wrap: wrap; }
.ship-hint { margin-right: auto; font-size: .75rem; font-weight: 600; color: var(--text-2); display: inline-flex; gap: .35rem; align-items: center; }
@media (max-width: 1199.98px) { .ord-under.has-ship { grid-template-columns: minmax(0, 40%) minmax(0, 1fr); } .ship-ro { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 991.98px) { .ord-under.has-ship { grid-template-columns: 1fr; } }
.ship-form input.text-uppercase::placeholder { text-transform: none; }

/* v1.35 Toasts: messages after a save, top right over the page */
.toast-stack { position: fixed; top: 76px; right: 20px; z-index: 1085; display: flex; flex-direction: column; gap: .6rem; width: min(400px, calc(100vw - 32px)); pointer-events: none; }
.app-toast { pointer-events: auto; position: relative; overflow: hidden; display: flex; align-items: flex-start; gap: .7rem; padding: .8rem .8rem .9rem .9rem;
    background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--t, var(--primary)); border-radius: var(--radius-sm);
    box-shadow: 0 10px 30px rgba(15, 23, 42, .14), 0 2px 6px rgba(15, 23, 42, .06); animation: toastIn .28s ease-out; }
.app-toast.is-success { --t: var(--success); }
.app-toast.is-info { --t: var(--primary); }
.app-toast.is-warning { --t: #d97706; }
.app-toast.is-error { --t: var(--danger); }
.app-toast-icon { color: var(--t); font-size: 1.15rem; line-height: 1.2; }
.app-toast-body { flex: 1; min-width: 0; }
.app-toast-text { font-size: .875rem; font-weight: 600; color: var(--text); line-height: 1.4; }
.app-toast-sub { margin-top: .3rem; font-size: .8rem; color: var(--text-2); display: flex; gap: .35rem; align-items: baseline; }
.app-toast-close { border: 0; background: none; color: var(--text-3); padding: .1rem .25rem; line-height: 1; border-radius: 6px; }
.app-toast-close:hover { color: var(--text); background: #f1f4f9; }
.app-toast-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--t); opacity: .55; transform-origin: left; animation: toastBar 5s linear forwards; }
.app-toast.is-paused .app-toast-bar { animation-play-state: paused; }
.app-toast.is-leaving { animation: toastOut .25s ease-in forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(24px); } }
@keyframes toastBar { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (max-width: 767.98px) { .toast-stack { top: 68px; right: 16px; left: 16px; width: auto; } }
@media (prefers-reduced-motion: reduce) { .app-toast, .app-toast.is-leaving { animation: none; } }

/* v1.37 Order top: Order Details · Deliver To · Order Status */
.ord-phone { display: inline-flex; align-items: center; gap: .35rem; margin-top: .35rem; font-size: .8125rem; color: var(--text); text-decoration: none; }
.ord-phone .bi { color: var(--primary); }
.ord-phone:hover { color: var(--primary); }
@media (max-width: 1199.98px) and (min-width: 768px) { .ord-top { grid-template-columns: 1fr 1fr; } .ord-top > .form-section:last-child { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--border); } }
.ord-mini { list-style: none; margin: 0; padding: 0; }
.ord-mini li { display: grid; grid-template-columns: 10px 96px 1fr; align-items: center; gap: .55rem; padding: .32rem 0; font-size: .8125rem; border-bottom: 1px dashed var(--border); }
.ord-mini li:last-child { border-bottom: 0; }
.ord-mini-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--success); }
.ord-mini b { font-weight: 600; color: var(--text); }
.ord-mini span:last-child { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ord-mini li.is-pending .ord-mini-dot { background: #d5dbe7; }
.ord-mini li.is-pending b, .ord-mini li.is-pending span:last-child { color: var(--text-3); font-weight: 500; }
@media (max-width: 575.98px) { .ord-mini li { grid-template-columns: 10px 84px 1fr; } .ord-mini span:last-child { white-space: normal; } }

/* v1.38 Order: Delivery box (warehouse / hub) under Shipping Details */
.ord-right { display: flex; flex-direction: column; gap: .85rem; min-width: 0; }
.ship-ro .ship-span2 { grid-column: span 2; }
.ord-fit-icon.is-done { background: var(--success-soft); color: var(--success); }

/* v1.38 - warehouse / hub order page: Shipping Details and Delivery side by side (no container utilisation) */
.ord-wh-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; margin-top: .85rem; }
.ord-wh-row.is-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
.ord-wh-col { display: flex; flex-direction: column; min-width: 0; }
.ord-wh-col > .ship-box { flex: 1 1 auto; }
.ord-wh-row.is-pair .ship-ro { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 991.98px) { .ord-wh-row.is-pair { grid-template-columns: minmax(0, 1fr); } }

/* v1.40 - dashboard: tile split (warehouse orders) and the customer's orders-by-status graph */
div.kpi { cursor: default; }
.kpi-split { display: flex; flex-wrap: wrap; gap: .35rem .9rem; font-size: .75rem; color: var(--text-2); margin-top: .15rem; }
.kpi-split .badge { font-size: .72rem; min-width: 1.6rem; }
.ord-chart { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .75rem; align-items: end; padding: .25rem .25rem 0; border-bottom: 1px solid var(--border); }
.ord-chart-col { display: flex; flex-direction: column; align-items: center; gap: .35rem; text-decoration: none; color: inherit; padding-top: .25rem; border-radius: 8px; }
.ord-chart-col:hover { background: var(--primary-soft); color: inherit; }
.ord-chart-val { font-size: .95rem; font-weight: 700; color: var(--text); }
.ord-chart-track { position: relative; width: 100%; max-width: 56px; height: 180px; display: flex; align-items: flex-end; }
.ord-chart-bar { width: 100%; background: var(--primary); border-radius: 4px 4px 0 0; transition: background .15s; }
.ord-chart-col:hover .ord-chart-bar { background: #1d4ed8; }
.ord-chart-label { font-size: .75rem; color: var(--text-2); text-align: center; padding: .35rem 0 .5rem; line-height: 1.2; }
@media (max-width: 575.98px) { .ord-chart { gap: .3rem; } .ord-chart-track { height: 140px; } .ord-chart-label { font-size: .68rem; } }
.list-filters .filter-label { display: block; font-size: .66rem; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .03em; margin-bottom: .2rem; }
.filter-range { display: flex; align-items: center; gap: .35rem; }
.filter-range span { font-size: .7rem; color: var(--text-3); }
.filter-range .form-control { min-width: 0; }
.list-filters .btn.disabled { opacity: .55; }
.section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .35rem 1rem; margin-bottom: .8rem; }
.content .section-head .section-title { margin-bottom: 0; }
.section-hint { font-size: .75rem; color: var(--text-3); display: inline-flex; align-items: center; gap: .35rem; }
.section-hint[hidden] { display: none; }

/* v1.40 - container fill bands: orange (space left) -> blue (well filled) -> green (near the best use) -> red (over) */
.ord-fit { --fit: var(--success); }
.ord-fit.is-low  { --fit: #ea580c; }
.ord-fit.is-near { --fit: var(--primary); }
.ord-fit.is-full { --fit: var(--success); }
.ord-fit.is-over { --fit: var(--danger); }
.ord-fit .ord-fit-pct, .ord-fit .ord-fit-msg, .ord-fit .ord-fit-left { color: var(--fit); }
.ord-fit .ord-fit-left { font-weight: 600; }
.ord-fit .ord-fit-bar { background: var(--fit); }
.ord-fit.is-low .ord-fit-bar { background: #f97316; }
.ord-fit .ord-fit-msg { font-size: .62rem; }
@media (min-width: 1200px) { .ord-fit .ord-fit-msg { white-space: nowrap; } }
.ord-fit .ord-fit-msg .bi { flex: 0 0 auto; }

/* Product Master: save progress card (v1.41, design A) – assets/js/product-save.js */
.save-progress { position: fixed; inset: 0; z-index: 2100; display: none; align-items: center; justify-content: center; background: rgba(15, 23, 42, .45); padding: 16px; }
.save-progress.show { display: flex; }
.save-progress-card { background: #fff; border-radius: 14px; box-shadow: 0 20px 50px rgba(15, 23, 42, .25); width: 100%; max-width: 440px; padding: 1.6rem 1.7rem 1.3rem; text-align: center; }
.sp-ring { position: relative; width: 104px; height: 104px; margin: 0 auto .8rem; }
.sp-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.sp-ring circle { fill: none; stroke-width: 9; }
.sp-track { stroke: #e2e8f0; }
.sp-value { stroke: var(--primary); stroke-linecap: round; stroke-dasharray: 301.6; stroke-dashoffset: 301.6; transition: stroke-dashoffset .25s, stroke .2s; }
.sp-pct, .sp-done-icon, .sp-err-icon { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.sp-pct { font-size: 1.45rem; font-weight: 700; color: var(--primary); }
.sp-done-icon, .sp-err-icon { display: none; font-size: 2.6rem; }
.save-progress.is-done .sp-value { stroke: var(--success, #16a34a); }
.save-progress.is-done .sp-pct, .save-progress.is-error .sp-pct { display: none; }
.save-progress.is-done .sp-done-icon { display: flex; color: var(--success, #16a34a); }
.save-progress.is-error .sp-value { stroke: var(--danger, #dc2626); stroke-dashoffset: 0; }
.save-progress.is-error .sp-err-icon { display: flex; color: var(--danger, #dc2626); }
.sp-title { font-weight: 700; font-size: 1.05rem; margin-bottom: .2rem; }
.sp-sub { font-size: .8rem; color: var(--text-2); margin-bottom: 1rem; }
.sp-bar { height: 7px; background: #e2e8f0; border-radius: 99px; overflow: hidden; }
.sp-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--primary), #3b82f6); border-radius: 99px; transition: width .25s; }
.save-progress.is-done .sp-bar i { background: var(--success, #16a34a); }
.sp-meta { display: flex; justify-content: space-between; gap: .5rem; font-size: .72rem; color: var(--text-3); margin: .4rem 0 1rem; min-height: 1em; }
.sp-steps { list-style: none; margin: 0; padding: .8rem 0 0; border-top: 1px solid var(--border); text-align: left; }
.sp-steps li { display: flex; align-items: center; gap: .6rem; font-size: .82rem; padding: .22rem 0; color: var(--text-3); }
.sp-steps li small { margin-left: auto; font-size: .72rem; color: var(--text-3); }
.sp-ic { width: 20px; height: 20px; flex: none; border-radius: 50%; border: 2px solid #cbd5e1; display: flex; align-items: center; justify-content: center; }
.sp-steps li.now { color: var(--primary); font-weight: 600; }
.sp-steps li.now small { color: var(--primary); }
.sp-steps li.now .sp-ic { border: 2.5px solid #bfdbfe; border-top-color: var(--primary); animation: sp-spin .8s linear infinite; }
.sp-steps li.done { color: var(--text); }
.sp-steps li.done .sp-ic { border: 0; background: var(--success-soft, #dcfce7); color: var(--success, #16a34a); }
.sp-steps li.done .sp-ic::before { content: "\2713"; font-size: .7rem; font-weight: 700; }
@keyframes sp-spin { to { transform: rotate(360deg); } }
.sp-note { font-size: .7rem; color: var(--text-3); margin-top: .8rem; }
.sp-actions { display: none; justify-content: center; margin-top: 1rem; }
.save-progress.is-error .sp-actions { display: flex; }
.save-progress.is-error .sp-note, .save-progress.is-error .sp-steps, .save-progress.is-error .sp-bar, .save-progress.is-error .sp-meta { display: none; }

/* Photos show whole (not cropped) in the boxes – display only, the saved file is not changed (v1.41) */
.img-slot.has-img img { object-fit: contain; padding: 6px; background: #fff; }
.img-gallery { gap: .75rem; }
.img-gallery figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: .3rem; }
.img-gallery img { width: 120px; height: 120px; object-fit: contain; padding: 4px; background: #fff; }
.img-download { font-size: .7rem; padding: .15rem .55rem; border: 1px solid var(--border); border-radius: 6px; color: var(--text-2); background: #fff; text-decoration: none; display: inline-flex; align-items: center; gap: .25rem; }
.img-download:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

/* Product Master list (v1.42): serial number, sorting, rows per page, pager */
.col-sno { width: 48px; color: var(--text-3); text-align: right; padding-right: .75rem !important; }
th.col-sno { color: inherit; }
.col-case-size { padding-left: 2.75rem !important; }
.th-sort { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap; }
.th-sort i { font-size: .8em; color: var(--text-3); }
.th-sort:hover, .th-sort.is-on, .th-sort.is-on i { color: var(--primary); }
.per-page { display: flex; align-items: center; gap: .4rem; font-size: .78rem; color: var(--text-2); }
.per-page .form-select { width: auto; min-width: 72px; }
.list-pager { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: .75rem 1rem; border-top: 1px solid var(--border); font-size: .78rem; color: var(--text-2); }
.list-pager nav { margin-left: auto; }
.list-pager nav > .d-sm-flex > div:first-child, .list-pager nav > .d-flex.d-sm-none { display: none !important; }
.list-pager .pagination { margin: 0; }
.list-pager .page-link { font-size: .78rem; padding: .3rem .65rem; }
.th-sort i { font-size: .9em; }

/* Product: simple + optimised pallet stacking drawings (v1.43), each half the old height */
.pallet-draw-row .pallet-view.pallet-view-sm { height: 120px; padding: 4px; }
.pallet-draw-row .pallet-view-empty i { font-size: 1.2rem; margin-bottom: .15rem; }
.pallet-draw-row .opt-title { margin-top: .6rem; color: var(--success); }
.pallet-draw-row .pallet-view-opt { border-color: #bfe5cc; background: linear-gradient(#fff, #eef9f2); }
.opt-gain { display: inline-block; margin-left: .25rem; padding: 0 .4rem; border-radius: 99px; background: var(--success-soft); color: var(--success); font-weight: 700; }
.opt-same { color: var(--text-3); }
.opt-label, .opt-label i { color: var(--success); }
.calc-out.calc-opt[readonly] { background: #eef9f2; color: var(--success); border-color: #bfe5cc; }

/* Admin dashboard: order analytics (v1.45) – order flow + orders by stage, light colours, half width (next to Recent sign-ins) */
.dash-pair .box { margin-bottom: 0; }
.an-submitted { --c: #b45309; --s: #fff4e0; --m: #fde3b5; }
.an-confirmed { --c: #1d4ed8; --s: #eaf1ff; --m: #c9dafd; }
.an-ready_to_ship { --c: #6d28d9; --s: #f3eefe; --m: #ddd0fb; }
.an-shipped { --c: #0369a1; --s: #e6f4fb; --m: #c2e3f4; }
.an-delivered { --c: #15803d; --s: #e8f7ee; --m: #c6ead3; }
.an-sub { font-size: .6rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); margin-bottom: .45rem; }
.an-flow { display: flex; margin-bottom: .9rem; }
.an-step { flex: 1; position: relative; text-align: center; text-decoration: none; color: var(--text); padding: .15rem .2rem; border-radius: 8px; }
.an-step:hover { background: var(--s); }
.an-step:not(:last-child)::after { content: ""; position: absolute; top: 18px; left: calc(50% + 21px); right: calc(-50% + 21px); height: 2px; background: repeating-linear-gradient(90deg, #cfd6e4 0 5px, transparent 5px 9px); }
.an-dot { width: 32px; height: 32px; margin: 0 auto .25rem; border-radius: 50%; display: grid; place-items: center; background: var(--s); color: var(--c); border: 2px solid var(--m); font-size: .8rem; }
.an-step b { display: block; font-size: .9rem; line-height: 1.2; }
.an-step > span:last-child { font-size: .64rem; color: var(--text-2); white-space: nowrap; }
.an-bar { display: flex; height: 20px; border-radius: 6px; overflow: hidden; margin-bottom: .6rem; gap: 2px; }
.an-bar a { display: flex; align-items: center; justify-content: center; min-width: 28px; background: var(--m); color: var(--c); font-size: .6rem; font-weight: 700; text-decoration: none; }
.an-bar a:hover { filter: brightness(.96); }
.an-bar.an-empty { align-items: center; justify-content: center; background: #f1f4f9; color: var(--text-3); font-size: .64rem; }
.an-legend { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .4rem; }
.an-legend a { display: block; padding: .35rem .5rem; border-radius: 8px; background: var(--s); border: 1px solid var(--m); text-decoration: none; color: var(--text); min-width: 0; }
.an-legend a:hover { border-color: var(--c); }
.an-key { display: flex; align-items: center; gap: .3rem; font-size: .6rem; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.an-key i { width: 7px; height: 7px; flex: none; border-radius: 2px; background: var(--c); }
.an-legend b { display: block; font-size: .9rem; margin-top: .05rem; color: var(--c); }
.an-legend small { font-size: .58rem; color: var(--text-3); }
@media (max-width: 575.98px) { .an-legend { grid-template-columns: repeat(3, minmax(0, 1fr)); } .an-step > span:last-child { white-space: normal; } }
/* Recent sign-ins next to Order analytics: Today / All, table scrolls inside the box (v1.45) */
.signin-box { display: flex; flex-direction: column; }
.signin-box > div:last-child { flex: 1 1 auto; position: relative; min-height: 220px; }
.signin-scroll { position: absolute; inset: 0; overflow-y: auto; }
.signin-scroll thead th { position: sticky; top: 0; z-index: 1; background: #f8fafc; }
.signin-box[data-show="today"] tr.is-older { display: none; }
.signin-none { display: none; }
.signin-box[data-empty="1"][data-show="today"] .signin-none-today, .signin-box[data-empty="1"][data-show="all"] .signin-none-all { display: table-row; }
.signin-toggle .btn { font-size: .7rem; padding: .22rem .6rem; border: 1px solid var(--border); background: #fff; color: var(--text-2); }
.signin-toggle .btn span { display: inline-block; min-width: 1.2rem; margin-left: .2rem; padding: 0 .3rem; border-radius: 99px; background: #eef1f6; font-size: .62rem; font-weight: 700; }
.signin-toggle .btn.is-on { background: var(--primary-soft); color: var(--primary); border-color: var(--primary-border, #c9dafd); }
.signin-toggle .btn.is-on span { background: var(--primary); color: #fff; }
@media (max-width: 1199.98px) { .signin-box > div:last-child { min-height: 0; } .signin-scroll { position: static; max-height: 360px; } }

/* Administrator > Container Orders (v1.46) */
.co-fixed { display: flex; align-items: center; gap: .45rem; background: #f6f8fc; }
.co-fixed .bi-building { color: var(--text-3); }
.co-assign-bar { display: flex; align-items: center; gap: .85rem; flex-wrap: wrap; border: 1px dashed var(--border); border-radius: var(--radius-sm); padding: .85rem; background: #fafbfe; }
.co-assign-bar .text-hint { flex: 1 1 220px; }

/* Dashboard v1.46 (Yash, 25 Nov 2026): smaller tiles, Order analytics in two sections, both boxes 10% taller */
.tint-violet { background: #f3eefe; color: #6d28d9; }
.kpi-row .kpi { padding: .8rem 1rem; }
.kpi-row .kpi-icon { width: 32px; height: 32px; font-size: .95rem; border-radius: 8px; }
.kpi-row .kpi-value { font-size: 1.4rem; margin-top: .15rem; }
.kpi-row .kpi-label { font-size: .75rem; }
.kpi-row .kpi-foot, .kpi-row .kpi-split { font-size: .7rem; }
@media (min-width: 1200px) { .dash-pair .an-box, .dash-pair .signin-box { height: 371px !important; } }
.an-section + .an-section { margin-top: .7rem; padding-top: .7rem; border-top: 1px dashed var(--border); }
.an-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .45rem; }
.an-head a { font-size: .74rem; font-weight: 700; color: var(--text); text-decoration: none; display: inline-flex; gap: .35rem; align-items: center; }
.an-head a:hover { color: var(--primary); }
.an-head a .bi { color: var(--primary); }
.an-head span { font-size: .66rem; color: var(--text-3); font-weight: 600; }
.an-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.an-section .an-flow { margin-bottom: 0; }
.an-section .an-bar { margin-bottom: .4rem; }
.an-keys { display: flex; flex-wrap: wrap; gap: .2rem .7rem; }
.an-keys a { display: inline-flex; align-items: center; gap: .3rem; font-size: .6rem; color: var(--text-2); text-decoration: none; white-space: nowrap; }
.an-keys a i { width: 7px; height: 7px; border-radius: 2px; background: var(--c); }
.an-keys a b { color: var(--c); }
@media (max-width: 767.98px) { .an-grid { grid-template-columns: 1fr; } }

/* Order forms (v1.48): Container Utilisation on the right of the order details once products are open */
.od-row { display: grid; grid-template-columns: 5fr 3fr 2fr 2fr; gap: 1rem; align-items: start; }
.od-row .od-fit { display: none; }
.od-row.is-open { grid-template-columns: 4fr 2fr 2fr 4fr; }
.od-row.is-open .od-add { display: none; }
.od-row.is-open .od-fit { display: block; }
.od-fit .ord-fit { padding: .55rem .75rem; }
.od-fit .ord-fit-icon { width: 28px; height: 28px; flex-basis: 28px; font-size: .8rem; }
.od-fit .ord-fit-track { height: 8px; margin: .45rem 0 .35rem; }
.od-fit .ord-fit-msg { margin-top: .35rem; }
@media (max-width: 1199.98px) { .od-row, .od-row.is-open { grid-template-columns: 1fr 1fr; } .od-row.is-open .od-fit { grid-column: 1 / -1; } }
@media (max-width: 575.98px) { .od-row, .od-row.is-open { grid-template-columns: 1fr; } }

/* v1.48 Container Utilisation in the order's top row; the details under the products take the full width */
.vw-cols-4 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1.15fr); }
.ord-top-fit .ord-fit { padding: .55rem .75rem; }
.ord-under.ord-under-full { grid-template-columns: minmax(0, 1fr); }
.ord-under.ord-under-full:empty { display: none; }
@media (max-width: 1199.98px) and (min-width: 768px) { .ord-top.vw-cols-4 { grid-template-columns: 1fr 1fr; } .ord-top.vw-cols-4 > .form-section:nth-child(3) { grid-column: auto; border-left: 0; border-top: 1px solid var(--border); } .ord-top.vw-cols-4 > .form-section:last-child { grid-column: auto; border-left: 1px solid var(--border); border-top: 1px solid var(--border); } }
@media (max-width: 767.98px) { .vw-cols-4 { grid-template-columns: 1fr; } .vw-cols-4 > .form-section + .form-section { border-left: 0; border-top: 1px solid var(--border); } }
.ord-top-fit .ord-fit .ord-fit-msg, .od-fit .ord-fit .ord-fit-msg { white-space: normal; align-items: flex-start; }
/* v1.48 Once products are open: company / hub on top, number and date below it; Container Utilisation wider on the right, with a line between (Yash, 25 Nov 2026) */
@media (min-width: 1200px) {
    .od-row.is-open { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.8fr); grid-template-areas: "a a f" "b c f"; column-gap: 1rem; row-gap: .35rem; }
    .od-row.is-open > div:nth-child(1) { grid-area: a; }
    .od-row.is-open > div:nth-child(2) { grid-area: b; }
    .od-row.is-open > div:nth-child(3) { grid-area: c; }
    .od-row.is-open > .od-fit { grid-area: f; border-left: 1px solid var(--border); padding-left: 1.5rem; margin-left: .5rem; align-self: stretch; }
}
/* v1.48 Change Container (administrator, editable orders) */
.ord-fit-msgrow { display: flex; align-items: flex-start; gap: .5rem; }
.ord-fit-msgrow .ord-fit-msg { flex: 1 1 auto; min-width: 0; }
.btn-fit-change { flex: 0 0 auto; margin-top: .4rem; padding: .12rem .55rem; font-size: .62rem; font-weight: 600; line-height: 1.4; border: 0; border-radius: 999px; background: rgba(37, 99, 235, .1); color: var(--primary); white-space: nowrap; }
.btn-fit-change .bi { font-size: .6rem; }
.btn-fit-change:hover { background: var(--primary); color: #fff; }
.ctr-list { display: grid; gap: .6rem; }
.ctr-item { display: grid; grid-template-columns: 56px minmax(0, 1fr) 76px; gap: .85rem; align-items: center; width: 100%; text-align: left; padding: .65rem .8rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; transition: border-color .15s, box-shadow .15s; }
.ctr-item:hover:not(:disabled) { border-color: var(--primary); box-shadow: 0 2px 10px rgba(37, 99, 235, .12); }
.ctr-item.is-current { border-color: var(--primary); background: #f4f7ff; }
.ctr-item:disabled { opacity: .55; }
.ctr-photo { width: 56px; height: 42px; border-radius: 6px; background: #eef2fb; display: flex; align-items: center; justify-content: center; overflow: hidden; color: var(--primary); font-size: 1.2rem; }
.ctr-photo img { width: 100%; height: 100%; object-fit: contain; }
.ctr-body { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.ctr-name { font-weight: 600; font-size: .875rem; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.ctr-meta { font-size: .72rem; color: var(--text-2); }
.ctr-sel-badge { display: none; }
.ctr-item.is-current .ctr-sel-badge { display: inline-block; }
.ctr-track { height: 5px; background: #e9edf5; border-radius: 999px; overflow: hidden; margin-top: .25rem; }
.ctr-bar { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--text-2); }
.ctr-pct { font-weight: 700; font-size: 1rem; text-align: right; }
.ctr-item[data-state="low"] .ctr-bar { background: #f97316; } .ctr-item[data-state="low"] .ctr-pct { color: #ea580c; }
.ctr-item[data-state="near"] .ctr-bar { background: var(--primary); } .ctr-item[data-state="near"] .ctr-pct { color: var(--primary); }
.ctr-item[data-state="full"] .ctr-bar { background: var(--success); } .ctr-item[data-state="full"] .ctr-pct { color: var(--success); }
.ctr-item[data-state="over"] .ctr-bar { background: var(--danger); } .ctr-item[data-state="over"] .ctr-pct { color: var(--danger); }
/* v1.50 Product Inventory (customer): products down, warehouse hubs across */
.inv-wrap { overflow-x: auto; }
.inv-table { min-width: 100%; margin: 0; }
.inv-table th { white-space: nowrap; vertical-align: bottom; }
.inv-table .inv-sticky { position: sticky; background: #fff; z-index: 1; }
.inv-table th.inv-sticky, .inv-table tfoot .inv-sticky { background: inherit; }
.inv-table tr > .inv-sticky:first-child { left: 0; }
.inv-table tr > .inv-sticky.inv-prod { left: 36px; box-shadow: 1px 0 0 var(--border); min-width: 260px; }
.inv-hub { min-width: 130px; }
.inv-hub-name { display: block; font-weight: 700; color: var(--text); text-transform: none; letter-spacing: 0; font-size: .78rem; }
.inv-hub small { display: block; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--text-2); }
.inv-name { font-size: .8125rem; margin-top: .15rem; }
.inv-has b { color: var(--primary); }
.inv-none { color: #c3c9d6; }
.inv-sum { background: #f6f8fd; min-width: 110px; }
.inv-table tfoot td { background: #f6f8fd; border-top: 2px solid var(--border); }
.inv-total { font-size: .8125rem; color: var(--text-2); }
.inv-total b { font-size: 1rem; color: var(--text); margin: 0 .2rem; }
.inv-table > tbody > tr > td { background: #fff; padding-top: .5rem; padding-bottom: .5rem; }
.inv-table > tbody > tr:hover > td { background: #f8faff; }
.inv-table > tbody > tr > td.inv-sum { background: #f6f8fd; }
.inv-table thead th { background: #f6f8fd; }
.inv-table thead th.inv-sticky, .inv-table tfoot td.inv-sticky { background: #f6f8fd; }
/* v1.50 Stock Check */
.stk-summary { display: flex; align-items: center; gap: .9rem; padding: .9rem 1.1rem; border-radius: var(--radius); margin-bottom: 1rem; border: 1px solid; }
.stk-summary > .bi { font-size: 1.6rem; }
.stk-summary b { display: block; font-size: 1rem; }
.stk-summary span { font-size: .78rem; color: var(--text-2); }
.stk-summary.is-ok { background: #effaf3; border-color: #bfe8cd; color: #15803d; }
.stk-summary.is-bad { background: #fff5f5; border-color: #f6c9c9; color: #b91c1c; }
.stk-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
@media (max-width: 1199.98px) { .stk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575.98px) { .stk-grid { grid-template-columns: 1fr; } }
.stk-card { display: flex; gap: .75rem; align-items: flex-start; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: .85rem .95rem; }
.stk-ico { width: 34px; height: 34px; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: #eef2fb; color: var(--primary); flex: 0 0 auto; }
.stk-body { flex: 1 1 auto; min-width: 0; }
.stk-title { font-weight: 700; font-size: .85rem; }
.stk-text { font-size: .76rem; color: var(--text-2); margin-top: .15rem; }
.stk-state { font-size: 1.1rem; }
.stk-card.is-ok .stk-state { color: #16a34a; }
.stk-card.is-bad { border-color: #f6c9c9; }
.stk-card.is-bad .stk-state, .stk-card.is-bad .stk-text b { color: #dc2626; }
/* v1.51 Product Inventory: compact filters and smaller titles (Yash, 25 Nov 2026) */
.inv-filters .inv-f-customer { width: 210px; }
.inv-filters .inv-f-company { width: 210px; }
.inv-filters .inv-f-search { width: 200px; }
.inv-filters .form-check-label { white-space: nowrap; }
.inv-table thead th { padding-top: .5rem; padding-bottom: .5rem; }
.inv-hub-name { font-size: .7rem !important; }
.inv-hub small { font-size: .6rem; font-weight: 500; }
.inv-hub { min-width: 110px; }
.inv-table .inv-prod .vw-code { font-size: .64rem; padding: .05rem .35rem; }
.inv-name { font-size: .74rem; margin-top: .1rem; line-height: 1.25; }
.inv-table td b { font-size: .8125rem; }
.inv-table .hub-meta { font-size: .64rem; }
/* Product column only as wide as it needs: hub columns start closer to the product name (Yash, 25 Nov 2026) */
.inv-table th.inv-prod, .inv-table td.inv-prod { width: 270px; min-width: 240px !important; max-width: 270px; }
/* Hub columns: compact fixed width; the table is only as wide as its columns, many hubs scroll sideways (Yash, 25 Nov 2026) */
.inv-table { width: auto; min-width: 0; table-layout: fixed; }
.inv-table th.inv-hub, .inv-table td.inv-cell { width: 112px; min-width: 112px; max-width: 112px; }
.inv-table .inv-sum { width: 112px; min-width: 112px; }
.inv-hub-name, .inv-hub small { white-space: normal; line-height: 1.2; }
.inv-table th.inv-hub { white-space: normal; }
/* Many hubs: product stays on the left and Total on the right while the hubs scroll */
.inv-table .inv-sum { position: sticky; right: 0; z-index: 1; box-shadow: -1px 0 0 var(--border); }
/* Item number smaller than the product name (Yash, 25 Nov 2026) */
.inv-table .inv-prod .vw-code { font-size: .56rem; padding: .02rem .3rem; letter-spacing: 0; }
.inv-name { font-size: .76rem; }
/* Spare width goes to an empty column before Total, so Total always sits on the right (Yash, 25 Nov 2026) */
.inv-table { width: 100%; }
.inv-table .inv-gap { width: auto; padding: 0; }

/* Distribution Plan (v1.52) */
.dp-pick { display: grid; grid-template-columns: 200px minmax(0, 420px) auto; gap: 1rem; align-items: end; }
.dp-split { display: grid; grid-template-columns: minmax(300px, 2fr) 3fr; border-top: 1px solid var(--border); }
.dp-list { padding: 1rem 1.1rem; max-height: 560px; overflow-y: auto; border-right: 1px solid var(--border); }
.dp-list form + form { margin-top: .45rem; }
.dp-centre { display: flex; align-items: center; gap: .7rem; width: 100%; text-align: left; padding: .6rem .75rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); transition: border-color .15s, background .15s, box-shadow .15s; }
.dp-centre:hover, .js-dp-centre.is-lit .dp-centre { border-color: var(--primary-border); background: #f5f8ff; box-shadow: 0 1px 4px rgba(37, 99, 235, .12); }
.dp-centre-ico { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 8px; background: rgba(29, 78, 216, .1); color: #1d4ed8; }
.dp-centre-main { flex: 1; min-width: 0; font-size: .8rem; }
.dp-centre-main small { display: block; color: var(--text-2); font-size: .68rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dp-centre-main small.dp-centre-dist { color: var(--text-3, #6b7280); font-size: .64rem; margin-top: .1rem; }
.dp-centre-dist i { font-size: .62rem; margin-right: .15rem; }
.dp-centre-go { flex: none; display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .65rem; border-radius: 999px; background: var(--primary); color: #fff; font-size: .68rem; font-weight: 600; white-space: nowrap; }
.dp-centre:hover .dp-centre-go { filter: brightness(1.1); }
.dp-map-wrap { position: relative; padding: 1rem; }
.dp-map { height: 520px; border-radius: 10px; border: 1px solid var(--border); }
.dp-qty-wrap { display: flex; align-items: center; justify-content: flex-end; gap: .4rem; }
.dp-qty-wrap:has(.is-invalid) ~ .invalid-feedback { display: block; }
.dp-chip { display: inline-block; flex: none; width: 12px; height: 12px; border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.dp-legend { display: flex; gap: 1rem; margin-top: .5rem; font-size: .7rem; color: var(--text-2); }
.dp-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #1d4ed8; margin-right: .3rem; vertical-align: -1px; }
.dp-dot.is-hub { background: #16a34a; }
.dp-date { max-width: 190px; margin-bottom: .5rem; }
.dp-lines input.form-control { max-width: 140px; margin-left: auto; }
@media (max-width: 991px) { .dp-split { grid-template-columns: 1fr; } .dp-list { border-right: 0; max-height: none; } .dp-pick { grid-template-columns: 1fr; } }

/* v1.52 Distribution Plan products: case size in cm, quiet item numbers, compact columns, pallet stacking on the right (Yash, 25 Nov 2026) */
.dp-page-split { display: grid; grid-template-columns: minmax(0, 1fr) 380px; align-items: start; }
.dp-page-split > .dp-main { min-width: 0; }
.dp-page-split > .dp-stack { margin: .9rem .9rem .9rem 0; }
.dp-stack .dp-pallet-name { margin-bottom: .1rem; }
.dp-stack-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .4rem; }
.dp-stack .dp-stack-head .section-title { flex: 1; min-width: 0; margin-bottom: 0; }
.dp-pl-change { flex: none; display: inline-flex; align-items: center; gap: .25rem; padding: .15rem .55rem; border: 1px solid var(--primary-border, #bfd0f7); border-radius: 999px; background: #f4f7ff; color: var(--primary); font-size: .64rem; font-weight: 600; white-space: nowrap; }
.dp-pl-change:hover { background: var(--primary); color: #fff; }
.pl-need { font-size: .8rem; font-weight: 400; color: var(--text-2); white-space: nowrap; } .pl-need b { font-size: 1rem; color: var(--text); }
.pl-item { grid-template-columns: 44px minmax(0, 1fr) 90px; }
@media (max-width: 1199.98px) { .dp-page-split { grid-template-columns: 1fr; } .dp-page-split > .dp-stack { margin: 0 .9rem .9rem; } }
.dp-prod-split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1rem; align-items: start; }
.dp-lines th.dp-n { width: 30px; } .dp-lines th.dp-img { width: 46px; }
.dp-lines .dp-sku-col { width: 1%; white-space: nowrap; padding-right: .35rem; }
.dp-lines th.dp-num { width: 72px; white-space: normal; line-height: 1.2; } .dp-lines th.dp-qty-col { width: 112px; white-space: normal; line-height: 1.2; }
.dp-lines td, .dp-lines th { padding-left: .45rem; padding-right: .45rem; }
.dp-sku { display: inline-block; font-family: var(--bs-font-monospace, monospace); font-size: .7rem; color: #475569; background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 4px; padding: 0 .3rem; }
.dp-case { font-size: .66rem; color: var(--text-3, #6b7280); margin-top: .1rem; white-space: nowrap; }
.dp-lines input.form-control { max-width: 100px; margin-left: 0; }
/* v1.61: wider Cases column (stacking icon + colour chip + box), stacking rule icon */
.dp-lines th.dp-qty-col { width: 168px; }
.dp-lines .dp-qty-wrap input.form-control { flex: 0 0 96px; width: 96px; max-width: 96px; }
.dp-lines th.dp-num { width: 64px; }
.dp-stk { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 5px; background: #fef3c7; color: #b45309; font-size: .85rem; cursor: default; }
.dp-stk.is-any { background: #dcfce7; color: #15803d; }
.dp-chip[data-bs-toggle] { cursor: default; }
/* small light tooltip for the stacking icon and colour chip (v1.62) */
.tooltip.dp-tip { --bs-tooltip-bg: #fff; --bs-tooltip-color: #334155; --bs-tooltip-font-size: .58rem; --bs-tooltip-padding-x: .35rem; --bs-tooltip-padding-y: .1rem; --bs-tooltip-max-width: 170px; --bs-tooltip-opacity: 1; --bs-tooltip-arrow-width: .6rem; --bs-tooltip-arrow-height: .3rem; }
.tooltip.dp-tip .tooltip-inner { border: 1px solid #d5dbe7; border-radius: 4px; box-shadow: 0 2px 6px rgba(15, 23, 42, .1); text-align: left; line-height: 1.3; white-space: nowrap; }
.tooltip.dp-tip .tooltip-arrow::before { filter: drop-shadow(0 1px 0 #d5dbe7); }
/* "This way up" mark (two arrows over a line, as printed on cases): upright only (v1.62) */
.ico-upright { display: inline-block; width: 1em; height: 1em; vertical-align: -.125em; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 1 1.5 5h2v6h2V5h2zM11.5 1l-3 4h2v6h2V5h2zM1 13h14v2H1z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 1 1.5 5h2v6h2V5h2zM11.5 1l-3 4h2v6h2V5h2zM1 13h14v2H1z'/%3E%3C/svg%3E") center / contain no-repeat; }
.dp-stk-key { white-space: nowrap; margin-left: .35rem; } .dp-stk-key .dp-stk { width: 16px; height: 16px; font-size: .6rem; vertical-align: -3px; margin-left: .25rem; }
.dp-stack { border: 1px solid var(--border); border-radius: 10px; padding: .7rem .8rem; background: var(--surface); }
.dp-stack .section-title { margin-bottom: .4rem; }
.dp-stack-for { font-size: .76rem; margin-bottom: .5rem; } .dp-stack-for small { display: block; color: var(--text-3); font-size: .66rem; }
.dp-stack .pallet-view-sm { height: 190px; }
.dp-pallet-sum { margin-top: .5rem; border: 1px solid var(--border); border-radius: 8px; background: #f8fafc; padding: .2rem .6rem; }
.dp-pallet-sum > div { display: flex; align-items: baseline; gap: .5rem; padding: .28rem 0; font-size: .74rem; }
.dp-pallet-sum > div + div { border-top: 1px dashed var(--border); }
.dp-pallet-sum span { color: var(--text-3); flex: 1; }
.dp-pallet-sum b { font-size: .74rem; }
.dp-pallet-sum .dp-sep { flex: none; color: var(--text-3); margin: 0 .15rem; }
.dp-pallet-sum em { font-style: normal; color: var(--text-3); font-size: .66rem; }
.dp-pallet-sum span:first-child { font-size: .68rem; }
.dp-pallet-name small { font-size: .62rem; }
.dp-pallet-sum small { flex-basis: 100%; }
.dp-pallet-sum .dp-opt { flex: none; color: #15803d; font-size: .66rem; white-space: nowrap; margin-left: .5rem; }
.dp-pallet-sum .dp-opt b { color: #15803d; }
.dp-stack .opt-title { margin-top: .7rem; }
.dp-legend { display: flex; flex-wrap: wrap; gap: .25rem .7rem; font-size: .68rem; margin-bottom: .55rem; }
.dp-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: .25rem; vertical-align: -1px; }
.dp-pallets { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; }
.dp-pallets > .pallet-view-empty { grid-column: 1 / -1; padding: 1.2rem 0; }
.dp-pallet { margin: 0; }
.dp-pallet .pallet-view { height: 150px; padding: 4px; }
.dp-pallets-opt .pallet-view { border-color: #bbf7d0; background: linear-gradient(#fff, #f0fdf4); }
.dp-pallet figcaption { font-size: .62rem; color: var(--text-3); margin-top: .2rem; line-height: 1.35; }
.dp-pallet figcaption b { color: var(--text); }
.pallet-view-title span { font-weight: 400; color: var(--text-3); }
.dp-stack-normal { font-size: .74rem; padding: .4rem .6rem; border: 1px solid var(--border); border-radius: 8px; background: #f8fafc; color: var(--text-2); }
.dp-stack-normal b { color: var(--text); font-size: .86rem; }
.dp-empty { margin-top: .2rem; color: #b45309; }
.dp-empty b { color: #b45309; }
.dp-empty small { display: block; color: var(--text-3); font-size: .58rem; }
.dp-empty-bar { display: block; height: 5px; border-radius: 3px; background: #fde68a; margin-bottom: .15rem; overflow: hidden; }
.dp-empty-bar i { display: block; height: 100%; background: #16a34a; }
@media (max-width: 1199.98px) { .dp-prod-split { grid-template-columns: 1fr; } }

/* Distribution Details (v1.53, Yash 26 Nov 2026): route + map on the left, the dispatch on the right */
.dp-dispatch-sec { border-top: 1px solid var(--border); }
.dp-dispatch { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 1rem; align-items: start; }
.dp-route { display: flex; flex-direction: column; gap: .75rem; min-width: 0; }
.dp-route-stops { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem 1rem; }
.dp-route-lbl { display: block; font-size: .65rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); margin-bottom: .1rem; }
.dp-ico-hub { color: #16a34a; background: #ecfdf3; }
.dp-route-dist { grid-column: 1 / -1; display: flex; align-items: center; gap: .4rem; font-size: .8rem; color: var(--text-2); padding: .4rem .65rem; border-radius: 8px; background: #f4f7ff; }
.dp-route-dist .bi { color: var(--primary); }
.dp-route-map.dp-map-wrap { padding: 0; }
.dp-route-map .dp-map { height: 340px; }
.dp-ship .ship-head { margin-bottom: .6rem; }
.dp-ship-ro { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dp-bol-cur { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .35rem; padding: .35rem .55rem; border: 1px dashed var(--border); border-radius: 8px; background: #fff; font-size: .8rem; }
.ship-file .bi-file-earmark-word { color: #2b579a; }
.ship-file .bi-file-earmark-excel { color: #217346; }
.dp-ship-wait { font-size: .8rem; color: var(--text-2); display: flex; gap: .45rem; padding: .65rem; border-radius: 8px; background: #fff; border: 1px dashed var(--border); }
@media (max-width: 1199.98px) { .dp-dispatch { grid-template-columns: minmax(0, 1fr); } }
.dp-ship .ship-actions .ship-hint { flex-basis: 100%; }

/* Plan page (v1.53, Yash 26 Nov 2026): no empty space. Products show 5 rows then scroll (header and Total stay);
   the Pallet Stacking box is as tall as the left side and scrolls; Distribution Details follows straight after. */
.dp-lines-scroll.is-scroll { overflow-y: auto; border-bottom: 1px solid var(--border); }
.dp-lines-scroll.is-scroll thead th { position: sticky; top: 0; z-index: 2; background: var(--surface-2, #f6f8fc); }
.dp-lines-scroll.is-scroll tfoot td { position: sticky; bottom: 0; z-index: 2; background: #fafbfe; box-shadow: 0 -2px 0 var(--border), 0 4px 0 #fafbfe; }
@media (min-width: 1200px) {
    .dp-page-split.is-fit > .dp-stack { height: 0; min-height: calc(100% - 1.8rem); overflow-y: auto; padding-top: 0; scrollbar-width: thin; }
    .dp-page-split.is-fit > .dp-stack .dp-stack-head { position: sticky; top: 0; z-index: 3; background: var(--surface, #fff); padding-top: .7rem; padding-bottom: .4rem; margin-bottom: 0; }
}
.dp-page-split.is-fit .dp-main > .form-section:last-child { padding-bottom: .9rem; }
.dp-lines-scroll.is-scroll tfoot td::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 10px; background: #fafbfe; }

/* Plan status line under Plan Details / hub / service centre (Yash, 26 Nov 2026) */
.dp-status { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: .9rem 1.25rem .8rem; }
.dp-status .section-title { margin-bottom: .65rem; }
.dp-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .5rem; }
.dp-step { position: relative; display: flex; align-items: flex-start; gap: .55rem; min-width: 0; }
.dp-step:not(:last-child)::after { content: ''; position: absolute; top: 15px; left: 38px; right: .5rem; height: 2px; background: var(--border); z-index: 0; }
.dp-step.is-done:not(:last-child)::after { background: #86efac; }
.dp-step-ico { position: relative; z-index: 1; flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: .85rem; background: #f1f4f9; color: var(--text-3); border: 2px solid var(--border); }
.dp-step.is-done .dp-step-ico { background: #16a34a; border-color: #16a34a; color: #fff; }
.dp-step.is-next .dp-step-ico { background: #fff; border-color: var(--primary); color: var(--primary); }
.dp-step-txt { position: relative; z-index: 1; background: var(--surface, #fff); padding-right: .5rem; min-width: 0; line-height: 1.25; }
.dp-step-txt b { display: block; font-size: .78rem; }
.dp-step-txt small { display: block; font-size: .7rem; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dp-step.is-next .dp-step-txt b { color: var(--primary); }
@media (max-width: 767.98px) { .dp-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dp-step::after { display: none; } }
/* Delivery box under the Dispatch box (v1.53) */
.dp-ship-col { display: flex; flex-direction: column; gap: .75rem; min-width: 0; }

/* ---- Stock Statement (v1.53, Yash 26 Nov 2026) ---- */
.ss-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; padding: 1rem; border-bottom: 1px solid var(--border); }
.ss-tile { border: 1px solid var(--border); border-radius: 10px; padding: .6rem .85rem; background: #fff; }
.ss-tile-label { display: block; font-size: .72rem; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .03em; }
.ss-tile b { display: block; font-size: 1.35rem; line-height: 1.3; color: var(--text); }
.ss-tile small { color: var(--text-2); font-size: .72rem; }
.ss-tile.ss-in b { color: var(--success); }
.ss-tile.ss-out b { color: var(--info); }
.ss-tile.ss-adj b { color: var(--warning); }
.ss-tile.ss-close { background: var(--primary-soft); border-color: transparent; }
.ss-tile.ss-close b { color: var(--primary); }
.ss-table { margin: 0; }
.ss-table thead th { background: #f6f8fd; white-space: nowrap; vertical-align: bottom; }
.ss-table thead th small { display: block; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--text-2); font-size: .68rem; }
.ss-table td.ss-in b { color: var(--success); }
.ss-table td.ss-out b { color: var(--info); }
.ss-table td.ss-adj b { color: var(--warning); }
.ss-table .ss-close-col { background: #f6f8fd; min-width: 110px; }
.ss-zero { color: #c3cad6; }
.ss-row { cursor: pointer; }
.ss-row:hover > td { background: #f8faff; }
.ss-row:hover > td.ss-close-col { background: #eef2fb; }
.ss-go { color: var(--text-2); }
.ss-row:hover .ss-go { color: var(--primary); }
.ss-hub-row td { background: #fbfcfe; border-top: 2px solid var(--border); font-size: .82rem; padding-top: .45rem; padding-bottom: .45rem; }
.ss-hub-row .bi { color: var(--primary); }
.ss-sub-row td { background: #f9fafc; border-top: 1px solid var(--border); }
.ss-table tfoot td { background: #f6f8fd; border-top: 2px solid var(--border); }
.ss-bal-row td { background: #fbfcfe; }
.ss-note { color: var(--text-2); font-size: .8rem; max-width: 280px; }
.ss-print-head { display: none; }
@media print {
    .appbar, .no-print, .page-header .actions, .crumbs, footer { display: none !important; }
    body, .content { background: #fff !important; padding: 0 !important; margin: 0 !important; }
    .box { box-shadow: none !important; border: 0 !important; }
    .box-header .badge { border: 1px solid #ccc; }
    .ss-print-head { display: block; padding: 0 0 .5rem; font-size: .85rem; }
    .ss-tiles { grid-template-columns: repeat(5, 1fr); padding: .5rem 0; }
    .ss-table { font-size: .75rem; }
    .ss-table tr { page-break-inside: avoid; }
    .table-box { overflow: visible !important; }
}

/* ---- Plan page tidy-up (v1.53, Yash 26 Nov 2026): map as tall as the Dispatch / Delivery column; stacking rules behind an ⓘ ---- */
@media (min-width: 1200px) {
    .dp-dispatch { align-items: stretch; }
    .dp-route { height: 100%; }
    .dp-route-map.dp-map-wrap { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 300px; }
    .dp-route-map .dp-map { flex: 1 1 auto; height: auto; min-height: 260px; }
}
.dp-rules-i { position: relative; display: inline-flex; vertical-align: middle; margin-left: .3rem; color: var(--primary); cursor: help; font-size: .8rem; outline: 0; }
.dp-rules-pop { display: none; position: absolute; top: calc(100% + 6px); left: -8px; z-index: 20; width: 300px; padding: .6rem .75rem; border-radius: 10px; background: #fff; border: 1px solid var(--border); box-shadow: 0 10px 28px rgba(15, 23, 42, .16);
    font-size: .72rem; line-height: 1.45; font-weight: 400; color: var(--text-2); text-transform: none; letter-spacing: 0; white-space: normal; cursor: default; }
.dp-rules-pop b { display: block; color: var(--text); font-size: .74rem; margin-bottom: .25rem; }
.dp-rules-pop > span { display: block; padding-left: .7rem; position: relative; }
.dp-rules-pop > span::before { content: "•"; position: absolute; left: 0; color: var(--primary); }
.dp-rules-pop .js-pl-limits { margin-top: .3rem; font-weight: 600; color: var(--text); }
.dp-rules-i:hover .dp-rules-pop, .dp-rules-i:focus .dp-rules-pop, .dp-rules-i:focus-within .dp-rules-pop { display: block; }
/* the pop opens under the whole title line, so the scrolling stacking box never cuts it */
.dp-stack-head { position: relative; }
.dp-stack-head .dp-rules-i { position: static; }
.dp-stack-head .dp-rules-pop { left: 0; right: 0; width: auto; top: 100%; }
.dp-stack-head .section-title { white-space: nowrap; display: flex; align-items: center; }

/* v1.54 (Yash, 26 Nov 2026): dashboard - smaller tiles (six in a row), Order analytics full width with
   Purchase and Container Orders side by side, Distribution plan analytics next to Recent sign-ins */
.kpi-row .kpi { padding: .6rem .8rem; border-radius: 10px; }
.kpi-row .kpi-icon { width: 26px; height: 26px; font-size: .8rem; border-radius: 7px; }
.kpi-row .kpi-label { font-size: .7rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: .3rem; }
.kpi-row .kpi-value { font-size: 1.15rem; margin-top: .05rem; line-height: 1.25; }
.kpi-row .kpi-foot, .kpi-row .kpi-split { font-size: .66rem; }
.kpi-row .kpi-foot { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-row .kpi-split { gap: .2rem .6rem; }
.kpi-row .kpi-split .badge { font-size: .64rem; min-width: 1.3rem; padding: .15em .4em; }
.tint-teal { background: #e6f6f4; color: #0f766e; }
.an-dispatched { --c: #0369a1; --s: #e6f4fb; --m: #c2e3f4; }
.an-draft { --c: #475569; --s: #f1f4f9; --m: #dbe1ea; }
.an-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.an-cols .an-section:first-child { padding-right: 1.6rem; }
.an-cols .an-section + .an-section { margin-top: 0; padding-top: 0; border-top: 0; padding-left: 1.6rem; border-left: 1px dashed var(--border); }
.an-stack { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.an-half .an-stack { grid-template-columns: 1fr; gap: .7rem; }
.an-latest { margin-top: .8rem; padding-top: .7rem; border-top: 1px dashed var(--border); }
.an-row { display: grid; grid-template-columns: 92px minmax(0, 1fr) 76px 84px; align-items: center; gap: .6rem; padding: .3rem .4rem; border-radius: 6px;
    text-decoration: none; color: var(--text); font-size: .72rem; }
.an-row:hover { background: #f5f8fd; color: var(--text); }
.an-row code { font-size: .7rem; }
.an-row-what { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); }
.an-row-date { color: var(--text-3); font-size: .68rem; }
.an-row-st { justify-self: end; font-size: .64rem; font-weight: 600; color: var(--c, var(--text-2)); background: var(--s, #f1f4f9); border: 1px solid var(--m, #dbe1ea); padding: .05rem .45rem; border-radius: 999px; white-space: nowrap; }
.an-row-none { display: block; color: var(--text-3); }
@media (min-width: 1200px) { .dash-pair .an-box, .dash-pair .signin-box { height: 100% !important; } }
@media (max-width: 991.98px) { .an-cols { grid-template-columns: 1fr; } .an-cols .an-section:first-child { padding-right: 0; } .an-cols .an-section + .an-section { padding-left: 0; border-left: 0; margin-left: 0; margin-top: .7rem; padding-top: .7rem; border-top: 1px dashed var(--border); } }
@media (max-width: 767.98px) { .an-stack { grid-template-columns: 1fr; } .an-row { grid-template-columns: 84px minmax(0, 1fr) 80px; } .an-row-date { display: none; } }
/* v1.54: Service Centre list filters (customer login) */
.js-sc-filters .sc-zip { min-width: 96px; }
@media (min-width: 1400px) { .js-sc-filters .js-f-state, .js-sc-filters .js-f-city { min-width: 170px; } }

/* ---------- Administrator > Delete & Restore (v1.55) ---------- */
.dropdown-item.text-danger-2 { color: #b42318; }
.dropdown-item.text-danger-2:hover { background: #fef3f2; color: #912018; }
.dr-tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; }
.dr-tabs a { padding: .55rem .9rem; font-size: .8125rem; font-weight: 600; color: var(--text-2); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.dr-tabs a:hover { color: var(--primary); }
.dr-tabs a.active { color: var(--primary); border-bottom-color: var(--primary); }
.dr-tabs a i { margin-right: .3rem; }
.dr-warn, .dr-block, .dr-note { display: flex; gap: .75rem; align-items: flex-start; padding: .75rem 1rem; border-radius: 10px; font-size: .8125rem; margin-bottom: 1rem; }
.dr-warn { background: #fffaeb; border: 1px solid #fedf89; color: #7a2e0e; }
.dr-block { background: #fef3f2; border: 1px solid #fecdca; color: #912018; }
.dr-note { background: var(--primary-soft); border: 1px solid var(--primary-border); color: var(--text-2); padding: .5rem .85rem; }
.dr-warn > i, .dr-block > i { font-size: 1.25rem; line-height: 1; }
.dr-block ul { margin: .35rem 0 .25rem; padding-left: 1.1rem; }
.dr-block small { display: block; opacity: .85; }
.dr-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; }
.dr-card { display: flex; gap: .9rem; align-items: center; padding: 1rem 1.1rem; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s; }
.dr-card:hover { border-color: #fda29b; box-shadow: 0 4px 14px rgba(180, 35, 24, .08); }
.dr-ico { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; background: #fef3f2; color: #d92d20; font-size: 1.2rem; }
.dr-card-body { flex: 1; display: flex; flex-direction: column; gap: .15rem; }
.dr-card-body b { font-size: .9rem; color: var(--text-1, #101828); }
.dr-card-body small { color: var(--text-3); font-size: .75rem; }
.dr-card-body em { font-style: normal; font-size: .7rem; font-weight: 600; color: var(--text-2); }
.dr-go { color: var(--text-3); }
.dr-steps { display: flex; gap: .4rem; list-style: none; padding: 0; margin: 0 0 1rem; flex-wrap: wrap; }
.dr-steps li { display: flex; align-items: center; gap: .4rem; font-size: .75rem; font-weight: 600; color: var(--text-3); padding: .3rem .7rem .3rem .35rem; border-radius: 99px; background: #eef1f6; }
.dr-steps li span { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: #fff; font-size: .68rem; }
.dr-steps li.now { background: #fee4e2; color: #b42318; }
.dr-steps li.now span { background: #d92d20; color: #fff; }
.dr-steps li.done { background: #ecfdf3; color: #067647; }
.dr-steps li.done span { background: #17b26a; color: #fff; }
.dr-company { max-width: 460px; }
.dr-parts { display: grid; gap: .55rem; margin-top: .9rem; }
.dr-part { display: flex; gap: .7rem; align-items: flex-start; padding: .7rem .9rem; border: 1px solid var(--border); border-radius: 10px; text-decoration: none; color: inherit; }
.dr-part:hover { border-color: var(--primary-border); background: #fafbff; }
.dr-part.active { border-color: #fda29b; background: #fffbfa; }
.dr-part .dr-radio { color: var(--text-3); margin-top: .1rem; }
.dr-part.active .dr-radio { color: #d92d20; }
.dr-part b { font-size: .8125rem; }
.dr-part b i { color: var(--text-3); margin: 0 .2rem 0 0; }
.dr-part em { font-style: normal; font-size: .68rem; font-weight: 700; background: #eef1f6; border-radius: 99px; padding: .05rem .45rem; margin-left: .4rem; }
.dr-part small { display: block; color: var(--text-3); font-size: .74rem; margin-top: .1rem; }
.dr-part.is-all b { color: #b42318; }
.dr-filter { max-width: 320px; margin-bottom: .75rem; }
.dr-pick { max-height: 520px; overflow: auto; }
.dr-pick tr { cursor: pointer; }
.dr-chk { width: 36px; }
.dr-actions { display: flex; justify-content: flex-end; gap: .5rem; margin: 1rem 0; }
.dr-actions-split { justify-content: space-between; }
.dr-title { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; font-weight: 700; font-size: .95rem; margin-bottom: .85rem; }
.dr-title > i { color: #d92d20; }
.dr-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.dr-tile { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: .6rem .75rem; display: grid; grid-template-columns: auto 1fr; column-gap: .55rem; align-items: center; }
.dr-tile i { grid-row: span 2; font-size: 1.05rem; color: #d92d20; }
.dr-tile b { font-size: 1.05rem; line-height: 1.1; }
.dr-tile span { font-size: .7rem; color: var(--text-3); }
.dr-lists { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: .75rem; margin-bottom: .75rem; }
.dr-list { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.dr-list-h { padding: .5rem .8rem; font-size: .78rem; font-weight: 700; background: #f8f9fc; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: .4rem; }
.dr-list-h span { margin-left: auto; font-size: .7rem; background: #fee4e2; color: #b42318; border-radius: 99px; padding: 0 .45rem; }
.dr-list ul { list-style: none; margin: 0; padding: .35rem .8rem; max-height: 220px; overflow: auto; font-size: .78rem; }
.dr-list li { padding: .22rem 0; border-bottom: 1px dashed #eef1f6; }
.dr-list li:last-child { border-bottom: 0; }
.dr-also { font-size: .78rem; color: var(--text-2); margin-bottom: .6rem; }
.dr-neg td { background: #fef3f2 !important; }
.dr-backup, .dr-delete { display: flex; gap: .9rem; align-items: center; flex-wrap: wrap; padding: 1rem 1.1rem; border-radius: 12px; margin: 1rem 0; }
.dr-backup { background: var(--primary-soft); border: 1px solid var(--primary-border); }
.dr-backup .dr-ico { background: #fff; color: var(--primary); }
.dr-backup p, .dr-delete p { margin: .15rem 0 0; font-size: .78rem; color: var(--text-2); }
.dr-backup form { display: flex; gap: .5rem; }
.dr-delete { background: #fffbfa; border: 1px solid #fecdca; }
.dr-delete .form-control { margin-top: .4rem; }
.dr-file { display: flex; align-items: center; gap: .75rem; padding: .7rem .95rem; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 1rem; }
.dr-file > i { font-size: 1.6rem; color: var(--primary); }
.dr-file b { display: block; font-size: .8125rem; word-break: break-all; }
.dr-file small { color: var(--text-3); font-size: .72rem; }
.dr-dl { font-size: .72rem; font-weight: 600; color: var(--text-3); display: none; }
.dr-dl.ok { display: inline; color: #067647; }
.dr-upload { max-width: 560px; }
.dr-drop { display: flex; flex-direction: column; align-items: center; gap: .2rem; padding: 1.6rem 1rem; border: 2px dashed var(--primary-border); border-radius: 12px; background: #fafbff; cursor: pointer; text-align: center; width: 100%; }
.dr-drop > i { font-size: 2rem; color: var(--primary); }
.dr-drop small { color: var(--text-3); font-size: .74rem; }
.dr-drop input { margin-top: .5rem; font-size: .75rem; }
@media (max-width: 767.98px) {
    .dr-cards { grid-template-columns: 1fr; }
    .dr-backup form { width: 100%; justify-content: flex-end; }
}
.dr-backup > .flex-grow-1, .dr-delete > .flex-grow-1 { flex: 1 1 320px; min-width: 0; }

/* v1.63: contact rows in the hub / service centre popups - the phone column is wide enough for (555) 123-4567 */
.contact-card { grid-template-columns: minmax(0, 1.5fr) minmax(10rem, 1fr) 32px; }

/* Account Details (v1.64): read-only note and Change Password popup */
.vw-note-bar { display: flex; align-items: center; gap: .45rem; margin: 0; padding: .55rem 1rem; font-size: .76rem; color: var(--text-2); background: #f7f9fc; border-bottom: 1px solid var(--border); }
.vw-note-bar i { color: var(--primary); }
.pw-dialog { max-width: 440px; }
.pw-rules { list-style: none; margin: .25rem 0 0; padding: .6rem .75rem; border: 1px solid var(--border); border-radius: 10px; background: #f7f9fc; font-size: .78rem; color: var(--text-2); display: grid; grid-template-columns: 1fr 1fr; gap: .3rem .75rem; }
.pw-rules li { display: flex; align-items: center; gap: .4rem; }
.pw-rules li i { font-size: .8rem; color: var(--text-3); }
.pw-rules li.is-ok { color: #15803d; }
.pw-rules li.is-ok i { color: #16a34a; }
.pw-rules.is-checked li:not(.is-ok) { color: #dc2626; }
.pw-rules.is-checked li:not(.is-ok) i { color: #dc2626; }
@media (max-width: 575.98px) { .pw-rules { grid-template-columns: 1fr; } }

/* v1.65 Access Rights: buttons and links the operational user has no right to are greyed (assets/js/menu-rights.js) */
.no-right, .btn.no-right, .btn.no-right:hover, .btn.no-right:focus { opacity: .4; cursor: not-allowed !important; filter: grayscale(1); box-shadow: none !important; }
a.no-right:not(.btn) { color: var(--text-3) !important; text-decoration: none; }
/* v1.65 Account Details: an operational user's rights per menu */
.acc-rights { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; }
@media (max-width: 991px) { .acc-rights { grid-template-columns: 1fr; } }
.acc-rights-group { border: 1px solid var(--border); border-radius: .6rem; overflow: hidden; }
.acc-rights-head { padding: .45rem .75rem; background: var(--primary-soft); color: var(--primary); font-weight: 600; font-size: .8rem; border-bottom: 1px solid var(--primary-border); }
.acc-rights-head i { margin-right: .3rem; }
.acc-rights-row { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .4rem .75rem; font-size: .8rem; border-bottom: 1px solid var(--border); }
.acc-rights-row:last-child { border-bottom: 0; }
.acc-rights-row i { color: var(--text-3); margin-right: .3rem; }
.acc-rights-row .badge { font-size: .65rem; }
/* v1.65 Masters > Operational Users: Status switch and Access Rights boxes */
.status-switch { height: calc(1.5em + .6rem + 2px); display: flex; align-items: center; padding: 0 .75rem; border: 1px solid var(--border); border-radius: .5rem; background: var(--surface); }
.status-switch .form-check-label { font-weight: 500; }
.ar-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; align-items: start; }
@media (max-width: 991px) { .ar-grid { grid-template-columns: 1fr; } }
.ar-box { border: 1px solid var(--border); border-radius: .6rem; background: var(--surface); overflow: hidden; }
.ar-head { display: flex; align-items: center; justify-content: space-between; padding: .55rem .8rem; background: var(--primary-soft); border-bottom: 1px solid var(--primary-border); }
.ar-title { font-weight: 600; color: var(--primary); font-size: .85rem; }
.ar-title i { margin-right: .3rem; }
.ar-all { font-size: .75rem; color: var(--text-2); display: flex; align-items: center; gap: .35rem; cursor: pointer; margin: 0; }
.ar-all .form-check-input { margin: 0; }
.ar-table { width: 100%; font-size: .8rem; }
.ar-table th { font-size: .68rem; text-transform: uppercase; letter-spacing: .03em; color: var(--text-3); font-weight: 600; padding: .45rem .8rem; border-bottom: 1px solid var(--border); }
.ar-table th:not(:first-child), .ar-table td:not(:first-child) { text-align: center; width: 50px; padding-left: 0; padding-right: 0; }
.ar-table td { padding: .45rem .8rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.ar-table tr:last-child td { border-bottom: 0; }
.ar-table .form-check-input, .ar-all .form-check-input { margin: 0; float: none; vertical-align: middle; border-color: #aab6cc; width: 1.05em; height: 1.05em; }
.ar-table td:not(:first-child) .form-check-input { display: block; margin: 0 auto; }
.ar-row.on { background: #f8faff; }
.ar-row:not(.on) .ar-create, .ar-row:not(.on) .ar-edit, .ar-row:not(.on) .ar-delete, .ar-row:not(.on) .ar-view { opacity: .55; }
.ar-menu { display: flex; align-items: center; gap: .45rem; margin: 0; cursor: pointer; color: var(--text); }
.ar-menu i { color: var(--text-3); }
.ar-row.on .ar-menu { font-weight: 600; }
.ar-row.on .ar-menu i { color: var(--primary); }
.ar-view:disabled { opacity: 1; background-color: #eef1f6; }
.ar-view:disabled:checked { background-color: #93b0f5; border-color: #93b0f5; }
.ar-na { color: var(--text-3); font-size: .85rem; }
.ar-full { padding: .2rem .6rem; border: 1px solid var(--primary-border); border-radius: .4rem; background: var(--primary-soft); }
.ar-full .form-check-input { margin-left: 0; margin-right: .4rem; float: none; vertical-align: -2px; }
.ar-full .form-check-label { color: var(--primary); font-weight: 600; }
.ar-foot { padding: .4rem .8rem; border-top: 1px solid var(--border); font-size: .72rem; color: var(--text-3); background: #fbfcfe; }

/* ---- Reports > Container Order Report (v1.66, Yash 29 Nov 2026): tabs under Print / PDF / Excel, filter bar, report sheet ---- */
.rp-side { display: flex; flex-direction: column; align-items: flex-end; gap: .5rem; }
.rp-btns { display: flex; gap: .5rem; }
.rp-tabs { display: flex; gap: .35rem; flex-wrap: wrap; justify-content: flex-end; }
.rp-tabs a { padding: .3rem .8rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: .75rem; font-weight: 500; text-decoration: none; white-space: nowrap; }
.rp-tabs a:hover { border-color: var(--primary-border); color: var(--primary); }
.rp-tabs a.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.rp-tabs a i { margin-right: .2rem; }
.rp-filters { margin-bottom: .85rem; }
.rp-fbar { display: flex; align-items: stretch; gap: 1rem; }
.rp-fdate { flex: 0 0 250px; display: flex; flex-direction: column; gap: .5rem; }
.rp-fmid { flex: 1 1 auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem .6rem; align-content: start; }
.rp-fsep { flex: 0 0 1px; background: var(--border); }
.rp-fbar .form-select, .rp-fbar .form-control { font-size: .75rem; }
.rp-fbtn { flex: 0 0 auto; display: flex; gap: .5rem; align-items: center; }
.rp-fbar .rp-fbtn .btn { min-height: 64px; display: inline-flex; align-items: center; gap: .35rem; padding-left: 1.1rem; padding-right: 1.1rem; }
@media (max-width: 991px) {
    .rp-fbar { flex-direction: column; } .rp-fdate { flex-basis: auto; } .rp-fsep { flex-basis: 1px; height: 1px; }
    .rp-fbar .rp-fbtn .btn { min-height: 40px; flex: 1 1 0; justify-content: center; }
}
.rp-sheet { padding: 1rem 1.15rem; }
.rp-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 2px solid var(--text); padding-bottom: .55rem; }
.rp-head-l { display: flex; align-items: center; gap: .5rem; min-width: 200px; }
.rp-head-l img { width: 30px; height: 30px; }
.rp-head-l b { display: block; font-size: .78rem; }
.rp-head-l small, .rp-head-r { color: var(--text-3); font-size: .66rem; }
.rp-head-c { text-align: center; }
.rp-head-c h2 { margin: 0; font-size: 1.05rem; font-weight: 700; }
.rp-head-c p { margin: .1rem 0 0; color: var(--text-2); font-size: .7rem; }
.rp-head-r { display: flex; flex-direction: column; align-items: flex-end; min-width: 200px; }
.rp-head-r b { color: var(--text); }
.rp-params { display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; padding: .45rem 0 .6rem; font-size: .7rem; border-bottom: 1px solid var(--border); margin-bottom: .35rem; }
.rp-params em { font-style: normal; color: var(--text-3); margin-right: .25rem; }
.rp-table { width: 100%; border-collapse: collapse; font-size: .72rem; }
.rp-table th { text-align: left; font-size: .62rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); padding: .4rem .5rem; border-bottom: 1px solid var(--text-2); background: #f8fafc; white-space: nowrap; font-weight: 600; }
.rp-table td { padding: .32rem .5rem; border-bottom: 1px solid #eef1f6; vertical-align: top; }
.rp-table td small { display: block; color: var(--text-3); font-size: .65rem; }
.rp-table td.text-end, .rp-table th.text-end { font-variant-numeric: tabular-nums; }
.rp-table a { font-weight: 500; }
.rp-table td:first-child, .rp-table td:nth-child(2) { white-space: nowrap; }
.rp-grp td { background: var(--primary-soft); font-weight: 600; color: #1e3a8a; }
.rp-cnt { font-weight: 500; color: var(--text-2); font-size: .66rem; margin-left: .4rem; text-transform: none; letter-spacing: 0; }
.rp-sub td { font-weight: 600; border-top: 1px solid var(--text-3); background: #fbfcfe; }
.rp-gt td { font-weight: 700; border-top: 2px solid var(--text); border-bottom: 3px double var(--text); background: #f1f5f9; }
.rp-note { color: var(--text-3); font-weight: 500 !important; font-size: .65rem; }
.rp-fill { display: inline-block; width: 52px; height: 6px; background: #eef1f6; border-radius: 3px; vertical-align: middle; overflow: hidden; }
.rp-fill b { display: block; height: 100%; }
.rp-fill-low b { background: #f59e0b; } .rp-fill-near b { background: #2563eb; } .rp-fill-full b { background: #16a34a; } .rp-fill-over b { background: #dc2626; }
.rp-fp { font-size: .66rem; margin-left: .3rem; color: var(--text-2); }
.rp-foot { display: flex; justify-content: space-between; gap: 1rem; color: var(--text-3); font-size: .66rem; margin-top: .75rem; }
.rp-warn { font-size: .7rem; color: var(--warning); margin: .5rem 0 0; }
.rp-sec { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; margin: 1rem 0 .3rem; font-weight: 700; }
.rp-sec i { margin-right: .25rem; }
.rp-t-warning { color: var(--warning); } .rp-t-primary { color: var(--primary); } .rp-t-ready { color: #6d28d9; } .rp-t-info { color: var(--info); } .rp-t-success { color: var(--success); }
.rp-kpis, .rp-bks { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: .6rem; margin: .75rem 0 .4rem; }
.rp-kpi { border: 1px solid var(--border); border-radius: .55rem; padding: .6rem .75rem; display: flex; gap: .6rem; }
.rp-kpi > i { font-size: 1rem; color: var(--primary); background: var(--primary-soft); width: 32px; height: 32px; border-radius: .5rem; display: grid; place-items: center; flex: 0 0 auto; }
.rp-kpi small, .rp-bk small { display: block; color: var(--text-2); font-size: .66rem; }
.rp-kpi b, .rp-bk b { font-size: 1.05rem; }
.rp-kpi span, .rp-bk span { display: block; color: var(--text-3); font-size: .66rem; }
.rp-bk { border: 1px solid var(--border); border-left-width: 4px; border-radius: .55rem; padding: .6rem .75rem; }
.rp-bk-0 { border-left-color: var(--warning); } .rp-bk-1 { border-left-color: var(--primary); } .rp-bk-2 { border-left-color: #6d28d9; } .rp-bk-3 { border-left-color: var(--danger); } .rp-bk-4 { border-left-color: var(--success); } .rp-bk-5 { border-left-color: #64748b; }
.rp-agegrid { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; font-size: .7rem; margin-bottom: .2rem; }
.rp-age { font-size: .65rem; font-weight: 600; padding: .1rem .5rem; border-radius: 999px; white-space: nowrap; }
.rp-a0 { background: var(--success-soft); color: var(--success); } .rp-a1 { background: var(--warning-soft); color: var(--warning); } .rp-a2 { background: #ffedd5; color: #c2410c; } .rp-a3 { background: var(--danger-soft); color: var(--danger); }
.rp-late td { background: #fff5f5; }
.rp-ok { color: var(--success); font-weight: 600; } .rp-lt { color: var(--danger); font-weight: 600; }
@media (max-width: 991px) {
    .rp-side { align-items: flex-start; } .rp-tabs { justify-content: flex-start; }
    .rp-kpis, .rp-bks { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rp-head { flex-wrap: wrap; } .rp-head-l, .rp-head-r { min-width: 0; }
}
.rp-sheet { position: relative; }
.rp-loader { position: absolute; inset: 0; z-index: 5; background: rgba(244, 246, 251, .72); backdrop-filter: blur(1.5px); border-radius: var(--radius); display: flex; justify-content: center; align-items: flex-start; padding-top: 90px; }
.rp-loader[hidden] { display: none; }
.rp-loader-card { position: sticky; top: 120px; background: #fff; border: 1px solid var(--border); border-radius: .75rem; box-shadow: 0 12px 32px rgba(15, 23, 42, .14); padding: 1.25rem 2rem; display: flex; flex-direction: column; align-items: center; gap: .3rem; min-width: 300px; text-align: center; }
.rp-loader-card b { font-size: .9rem; }
.rp-loader-sub { color: var(--text-2); font-size: .72rem; }
.rp-loader-time { color: var(--text-3); font-size: .68rem; font-variant-numeric: tabular-nums; }
.rp-spin { width: 38px; height: 38px; border-radius: 50%; border: 4px solid var(--primary-soft); border-top-color: var(--primary); animation: rp-spin .8s linear infinite; margin-bottom: .35rem; }
@keyframes rp-spin { to { transform: rotate(360deg); } }
.rp-busy > :not(.rp-loader) { filter: grayscale(.3); }
.rp-fbtn .spinner-border-sm { width: .9rem; height: .9rem; border-width: .15em; }
@media print {
    .rp-filters, .rp-side, .page-header:has(.rp-side) { display: none !important; }
    .rp-sheet { padding: 0; }
    .rp-table { font-size: .68rem; }
    .rp-table tr { page-break-inside: avoid; }
    .rp-grp td, .rp-gt td, .rp-sub td, .rp-late td, .rp-fill b, .rp-age, .badge { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .rp-table a { color: inherit; text-decoration: none; }
    .rp-table td small { display: none; }
}
.rp-table .text-hint { font-size: inherit; }

/* Customer view: service centre filters (search on top, state + city below, Filter button on the right spanning both lines) */
.centre-filters { display: grid; grid-template-columns: 1fr auto; gap: .5rem; align-items: stretch; }
.centre-filter-fields { display: grid; gap: .5rem; min-width: 0; }
.centre-filter-selects { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.centre-filters .js-hub-filter { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem; min-width: 76px; }
/* Customer view: company panel and service centre panel are always the same height */
@media (min-width: 1200px) {
  .split-view.split-equal { align-items: stretch; }
  .split-equal > .split-main, .split-equal > .split-side { display: flex; flex-direction: column; }
  .split-equal > .split-main > .box, .split-equal > .split-side > .box { flex: 1 1 auto; display: flex; flex-direction: column; margin-bottom: 0; }
  .split-equal > .split-main > .box > :last-child { margin-top: auto; }
  .split-equal .hubs-panel .table-box { flex: 1 1 auto; }
}
/* Customer view: "Show on Map" popup */
.centre-map-all { height: min(70vh, 620px); }
.centre-map-all .leaflet-popup-content a { font-weight: 600; }
/* v1.72: warning question (Back without saving) */
.app-confirm.is-warn .app-confirm-icon { background: #fff7e6; color: #d97706; }

/* v1.76 (Yash, 4 Dec 2026): order progress bar right of the order number (completed green, pending orange)
   and the Next Action column of the order lists */
.vw-hero-progress { margin-left: auto; align-self: flex-start; padding-top: .35rem; min-width: 0; flex: 0 1 40rem; }
.vw-hero-progress + .vw-hero-actions { margin-left: 0; }
.ord-progress { display: flex; gap: .3rem; min-width: 26rem; }
.ord-progress-step { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: .3rem; }
.ord-progress-bar { display: block; height: .45rem; border-radius: 999px; background: #f59e0b; }
.ord-progress-step.is-done .ord-progress-bar { background: #16a34a; }
.ord-progress-label { font-size: .64rem; line-height: 1.2; color: var(--warning); white-space: nowrap; }
.ord-progress-label .bi { font-size: .65rem; }
.ord-progress-step.is-done .ord-progress-label { color: var(--success); }
.ord-progress-step.is-current .ord-progress-label { font-weight: 700; }
.ord-progress-step.is-current .ord-progress-bar { box-shadow: 0 0 0 2px #bbf7d0; }
.ord-progress-meta { font-size: .6rem; line-height: 1.25; color: var(--text-2); }
.ord-progress-at { font-size: .56rem; letter-spacing: -.02em; white-space: nowrap; }
.ord-progress-by { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ord-progress-step.is-pending .ord-progress-by { color: var(--warning); font-weight: 500; }
.ord-progress-by .bi { font-size: .6rem; }
.ord-next-badge { white-space: nowrap; }
@media (max-width: 991.98px) {
    .vw-hero:has(.vw-hero-progress) { flex-wrap: wrap; }
    .vw-hero-progress { width: 100%; margin-left: 0; order: 3; }
    .ord-progress { min-width: 0; max-width: none; }
    .ord-progress-label { white-space: normal; font-size: .6rem; letter-spacing: -.01em; }
    .ord-progress-label .bi { display: none; }
    .ord-progress-meta { font-size: .56rem; }
    .ord-progress-at { white-space: normal; }
    .ord-progress-by { white-space: normal; overflow-wrap: anywhere; text-overflow: clip; }
}
