/* ============================================================================
   PMS Innovador - application layer
   ----------------------------------------------------------------------------
   Loaded after bootstrap.min.css and theme.css. Screens are built from
   Bootstrap components and utilities (themed in theme.css); this file only
   holds what Bootstrap has no component for. Custom classes carry the pms-
   prefix and read Bootstrap's variables - no colour or radius is hard-coded.
     1. Lucide icons            4. Table helpers
     2. App shell               5. Page loader
     3. Tile (icon / avatar)    6. SweetAlert2 theme
   ========================================================================== */

:root {
    /* Figma Layout collection. */
    --pms-sidebar-width: 264px;
    --pms-topbar-height: 72px;
    --pms-page-padding: 2rem;
}

/* 1. Lucide icons (lucide-static font, the icon set used in Figma) --------- */
[class^="icon-"],
[class*=" icon-"] {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 1em;
    height: 1em;
    font-size: 1.25rem;
    line-height: 1;
    vertical-align: -.125em;
}

.btn-sm [class*="icon-"],
.dropdown-item [class*="icon-"],
.form-text [class*="icon-"] {
    font-size: 1rem;
}

/* A flex button has no line box, so an icon-only button would size to the
   glyph; giving the icon the button's line height keeps 40 / 32 / 48px. */
.btn > [class*="icon-"] {
    height: var(--bs-btn-line-height);
}

/* Icons inside running text, table cells and badges follow the text size. */
.small [class*="icon-"],
small [class*="icon-"],
td [class*="icon-"],
.alert [class*="icon-"],
.badge [class*="icon-"] {
    font-size: 1.15em;
}

/* Figma draws icons in secondary buttons, idle nav items and menus in the
   neutral icon colour; the label keeps the text colour. */
.btn-secondary > [class*="icon-"],
.btn-light > [class*="icon-"],
.btn-outline-secondary > [class*="icon-"],
.nav-pills .nav-link:not(.active) > [class*="icon-"],
.dropdown-item:not([class*="text-"]) > [class*="icon-"] {
    color: var(--bs-tertiary-color);
}

/* 2. App shell: offcanvas-lg sidebar + sticky top bar + content ----------- */
.pms-shell {
    display: flex;
    min-height: 100vh;
}

.pms-sidebar {
    --bs-offcanvas-width: var(--pms-sidebar-width);
    --bs-offcanvas-padding-x: 1rem;
    --bs-offcanvas-padding-y: 1rem;
}

.pms-sidebar .offcanvas-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* From lg up the offcanvas is an in-flow, sticky sidebar. */
@media (min-width: 992px) {
    .pms-sidebar {
        position: sticky;
        top: 0;
        flex: 0 0 var(--pms-sidebar-width);
        width: var(--pms-sidebar-width);
        height: 100vh;
        overflow-y: auto;
        background-color: var(--bs-body-bg) !important;
        border-right: var(--bs-border-width) solid var(--bs-border-color);
    }

    .pms-sidebar {
        display: flex;
        flex-direction: column;
    }

    /* Bootstrap sets flex-grow: 0 on the lg body; growing it pins "Collapse sidebar" to the bottom. */
    .pms-sidebar .offcanvas-body {
        flex: 1 1 auto;
        padding: 1rem;
    }
}

.pms-main {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
}

.pms-topbar {
    height: var(--pms-topbar-height);
    padding: 0 1.5rem;
}

/* Header: global search (Figma "Header"), bell count, sidebar extras. */
.pms-search {
    flex: 0 0 20rem;
    max-width: 20rem;
}

/* Header breadcrumb (Figma "Header"): Home > section > page. */
.pms-crumbs .breadcrumb {
    flex-wrap: nowrap;
    white-space: nowrap;
}
.pms-crumbs .breadcrumb-item a {
    color: var(--bs-secondary-color);
    text-decoration: none;
}
.pms-crumbs .breadcrumb-item a:hover {
    color: var(--bs-emphasis-color);
}
.pms-crumbs .breadcrumb-item.active {
    font-weight: 500;
}

/* Header "+ New" menu with a second line under each entry (FND-15). */
.pms-quick-create {
    min-width: 21.5rem;
}
.pms-quick-create .dropdown-item {
    align-items: flex-start;
}

.pms-search .form-control {
    padding-right: 4.5rem;
}

.pms-kbd {
    position: absolute;
    top: 50%;
    right: .75rem;
    padding: .125rem .375rem;
    font-family: var(--bs-body-font-family);
    font-size: .6875rem;
    font-weight: 500;
    line-height: 1rem;
    color: var(--bs-tertiary-color);
    background-color: var(--bs-light-bg-subtle);
    border: var(--bs-border-width) solid var(--bs-gray-300);
    border-radius: .375rem;
    transform: translateY(-50%);
    pointer-events: none;
}

#globalSearchResults {
    top: calc(100% + .25rem);
    left: 0;
    max-height: 70vh;
    overflow-y: auto;
    box-shadow: var(--bs-box-shadow-lg);
}

.pms-bell-count {
    position: absolute;
    top: .125rem;
    right: .125rem;
    min-width: 1.125rem;
    padding: .0625rem .3125rem;
    font-size: .6875rem;
    line-height: 1rem;
}

/* Figma "Caption": the grey sub-line under a table cell or list row title is 11px, not the 13px of .small. */
.table td .small.text-body-tertiary,
.list-group-item .small.text-body-tertiary,
.small.pms-kpi-sub {
    font-size: .6875rem;
    line-height: 1rem;
    letter-spacing: .007em;
}

/* CR-005: the breadcrumb trail lives in the header's left slot; search keeps a fixed width beside it. */
.pms-topbar .pms-breadcrumb .breadcrumb {
    --bs-breadcrumb-divider: '›';
    --bs-breadcrumb-font-size: .875rem;
    --bs-breadcrumb-item-padding-x: .375rem;
    align-items: center;
}

.pms-topbar .pms-breadcrumb .breadcrumb-item a {
    color: var(--bs-tertiary-color);
    text-decoration: underline;
}

.pms-topbar .pms-breadcrumb .breadcrumb-item.active {
    color: var(--bs-emphasis-color);
    font-weight: 500;
}

.pms-topbar .pms-search {
    flex: 0 0 auto;
    width: 20rem;
    max-width: 100%;
}

/* NTF-02 bell panel */
.pms-bell-panel {
    width: 25rem;
    max-width: calc(100vw - 2rem);
    border-radius: var(--bs-border-radius-xl, 1rem);
    box-shadow: var(--bs-box-shadow-lg);
}

/* NTF-01 row: Mark as read / Open appear on hover or keyboard focus (always on touch screens). */
.pms-ntf-row .pms-ntf-actions {
    opacity: 0;
    transition: opacity .12s ease-in-out;
}

.pms-ntf-row:hover .pms-ntf-actions,
.pms-ntf-row:focus-within .pms-ntf-actions {
    opacity: 1;
}

@media (hover: none) {
    .pms-ntf-row .pms-ntf-actions {
        opacity: 1;
    }
}

/* Sidebar: a button row behaves like a link; the group chevron flips when open. */
.pms-sidebar .nav-link {
    width: 100%;
    text-align: left;
}

.pms-sidebar .nav-link[aria-expanded="true"] .pms-nav-chevron {
    transform: rotate(180deg);
}

.pms-sidebar .pms-nav-group-open {
    color: var(--bs-emphasis-color);
}

/* Collapsed rail (lg and up): icons only, labels in the title tooltip. */
@media (min-width: 992px) {
    .pms-shell.pms-sidebar-collapsed {
        --pms-sidebar-width: 4.5rem;
    }

    .pms-sidebar-collapsed .pms-nav-label {
        display: none !important;
    }

    .pms-sidebar-collapsed .pms-sidebar .offcanvas-body {
        padding-inline: .75rem;
    }

    .pms-sidebar-collapsed .pms-sidebar .nav-link {
        justify-content: center;
        padding-inline: 0;
    }

    .pms-sidebar-collapsed .pms-sidebar-brand {
        justify-content: center;
        padding-left: 0 !important;
    }

    .pms-sidebar-collapsed .pms-sidebar .collapse {
        display: none !important;
    }
}

.pms-content {
    flex: 1 1 auto;
    padding: var(--pms-page-padding);
}

.pms-footer {
    padding: 1rem var(--pms-page-padding);
}

/* 3. Tile (icon / avatar) ------------------------------------------------------
   Square (or, with .rounded-circle, round) tile holding one icon or initials.
   Colour comes from Bootstrap utilities, e.g. .bg-primary .text-white or
   .bg-danger-subtle .text-danger-emphasis. */
.pms-tile {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--bs-border-radius-sm);
}

.pms-tile-xs { width: 2rem; height: 2rem; }
.pms-tile-xs > [class*="icon-"] { font-size: 1rem; }
.pms-tile-sm { width: 2.25rem; height: 2.25rem; }
.pms-tile-sm > [class*="icon-"] { font-size: 1.375rem; }
.pms-tile-lg { width: 3rem; height: 3rem; border-radius: var(--bs-border-radius); }
.pms-tile-lg > [class*="icon-"] { font-size: 1.5rem; }

/* Empty / status illustration: 64px with a soft halo in the tile colour. */
.pms-tile-xl {
    width: 4rem;
    height: 4rem;
    box-shadow: 0 0 0 .5rem color-mix(in srgb, currentcolor 8%, transparent);
}

.pms-tile-xl > [class*="icon-"] { font-size: 1.75rem; }

/* Fields with a leading icon and an optional trailing action (show password). */
.pms-field {
    position: relative;
}

.pms-field > .pms-field-icon {
    position: absolute;
    top: 50%;
    left: .75rem;
    z-index: 2;
    color: var(--bs-tertiary-color);
    transform: translateY(-50%);
    pointer-events: none;
}

.pms-field > .form-control {
    padding-left: 2.5rem;
}

.pms-field > .form-control-lg {
    padding-left: 2.75rem;
}

.pms-field > .pms-field-action {
    position: absolute;
    top: 50%;
    right: .375rem;
    transform: translateY(-50%);
}

.pms-field:has(> .pms-field-action) > .form-control {
    padding-right: 2.75rem;
}

/* Halo: a dashed ring around one icon, for "check your email" / "expired" states. */
.pms-halo {
    position: relative;
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 6rem;
    height: 6rem;
    color: var(--bs-primary);
    background-color: var(--pms-blue-50);
    border-radius: 50%;
}

.pms-halo::before {
    position: absolute;
    inset: .75rem;
    content: "";
    border: 1.5px dashed currentcolor;
    border-radius: 50%;
}

.pms-halo > [class*="icon-"] {
    font-size: 2rem;
}

.pms-halo-danger {
    color: var(--bs-danger);
    background-color: var(--bs-danger-bg-subtle);
}

/* Requirement checklist under a password field. */
.pms-rules {
    padding: .75rem 1rem;
    background-color: var(--bs-tertiary-bg);
    border-radius: var(--bs-border-radius);
}

.pms-rules li {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: var(--bs-secondary-color);
}

.pms-rules li[data-state="ok"] { color: var(--bs-body-color); }
.pms-rules li[data-state="ok"] > [class*="icon-"] { color: var(--bs-success); }
.pms-rules li[data-state="bad"] > [class*="icon-"] { color: var(--bs-danger); }
.pms-rules li[data-state="idle"] > [class*="icon-"] { color: var(--bs-tertiary-color); }

/* Utilities Bootstrap does not ship. */
.min-w-0 {
    min-width: 0;
}

/* Status dot (attention tiles, legends). Colour via .bg-* utilities. */
.pms-dot {
    display: inline-block;
    flex: none;
    width: .5rem;
    height: .5rem;
    border-radius: 50%;
}

/* Label column of the label + bar + value rows in dashboard widgets. */
.pms-col-label {
    flex: 0 0 6.5rem;
}

/* Column chart (dashboard "Orders by month"): bar heights are sized by the page script; widths are fixed in px.
   Columns spread across a wide card and scroll sideways when they do not fit. */
.pms-bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    height: 12rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 8px 4px;         /* room for the first and last value labels */
}

.pms-bars > div {
    display: flex;
    flex: 0 0 56px;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: .25rem;
    height: 100%;
}

.pms-bars > div > span.small:first-child { font-size: .75rem; }

.pms-bar {
    width: 44px;
    min-height: .25rem;
    background-color: var(--pms-blue-200);
    border-radius: .5rem .5rem .25rem .25rem;
}

.pms-bar.is-current {
    background-color: var(--bs-primary);
}

/* Time-slot strip (auditor home). */
.pms-slot {
    border-width: 2px;
}

.pms-slot-now {
    border-color: var(--bs-primary);
}

.pms-slot-upcoming {
    color: var(--bs-secondary-color);
    background-color: transparent;
    box-shadow: none;
    border-style: dashed;
    border-width: 1px;
}

/* List screens (Appjs/list.js): search box + filter pills above a table card. */
.pms-list-search {
    width: 17.5rem;
    max-width: 100%;
}

.btn-chip > [data-x] {
    font-size: 1rem;
}

.btn-chip > [data-x]:hover {
    color: var(--bs-emphasis-color);
}

/* Status / tag chips that sit beside a code in a table cell. */
.pms-tag {
    vertical-align: middle;
}

/* Timeline (interaction history): a hairline joins the round icon of each entry to the next. */
.pms-timeline {
    margin: 0;
    padding: 0;
    list-style: none;
}

.pms-timeline > li {
    position: relative;
    display: flex;
    gap: .75rem;
    padding-bottom: 1rem;
}

.pms-timeline > li:last-child {
    padding-bottom: 0;
}

.pms-timeline > li:not(:last-child)::before {
    position: absolute;
    top: 2.25rem;
    bottom: .25rem;
    left: 1rem;
    width: 1px;
    content: "";
    background-color: var(--bs-border-color);
}

/* Record-header title block: takes the room left beside the action buttons and only wraps them below when it gets narrow. */
.pms-header-grow {
    flex: 1 1 24rem;
    min-width: 0;
}

/* Quotation overview: the summary and history column keeps a fixed reading width beside the flexible main column. */
@media (min-width: 992px) {
    .pms-quote-aside {
        width: 26.5rem;
    }
}

/* Label / value pairs shown as a two-column list (client and record detail cards). */
.pms-dl-inline dt {
    font-size: .75rem;
    font-weight: 400;
    color: var(--bs-tertiary-color);
}

/* Sticky bits of long forms: the action bar and the right-hand summary column. */
.pms-actionbar {
    position: sticky;
    bottom: 1rem;
    z-index: 5;
    box-shadow: var(--bs-box-shadow-lg);
}

@media (min-width: 992px) {
    .pms-sticky {
        position: sticky;
        top: calc(var(--pms-topbar-height) + 1.5rem);
    }
}

/* Tables that share one column grid across several cards (the scoping tracker's three groups). */
.pms-fixed-table {
    min-width: 60rem;
    table-layout: fixed;
}

.scp-col-lead { width: 28%; }
.scp-col-service { width: 22%; }
.scp-col-sent { width: 11%; }
.scp-col-response { width: 14%; }
.scp-col-estimate { width: 17%; }
.scp-col-open { width: 8%; }

/* Skill matrix (ALC-06): one narrow, centred column per skill so 11 columns stay scannable. */
.pms-skill-matrix { min-width: 64rem; }
.pms-skill-matrix th:not(:first-child), .pms-skill-matrix td:not(:first-child) { width: 4.5rem; }
.pms-skill-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: var(--pms-color-bg-brand-subtle, #eef0ff);
    color: var(--pms-color-text-brand, #4653e3);
}
.pms-skill-check i { font-size: .8rem; }
.pms-skill-check.is-picked { background: var(--bs-primary); color: #fff; }
/* MoM 2 Nov 2026: primary skill = solid "P", secondary skill = outlined "S"; the column picked in the Skill filter gets a ring */
.pms-skill-check.is-primary, .pms-skill-check.is-secondary { font-size: .7rem; font-weight: 600; line-height: 1; }
.pms-skill-check.is-primary { background: var(--bs-primary); color: #fff; }
.pms-skill-check.is-secondary { background: transparent; color: var(--pms-color-text-brand, #4653e3); border: 1.5px solid currentColor; }
.pms-skill-check.is-picked.is-primary, .pms-skill-check.is-picked.is-secondary { box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), .25); }

/* Attachments (scoping dialogs and panel): a dashed drop zone and file rows. */
.pms-dropzone {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    background-color: var(--bs-body-bg);
    border: 1px dashed var(--bs-gray-400);
    border-radius: var(--bs-border-radius-lg);
}

.pms-dropzone:hover,
.pms-dropzone.is-drag {
    background-color: var(--pms-blue-50);
    border-color: var(--bs-primary);
}

.pms-dropzone-sm {
    flex-direction: row;
    gap: .75rem;
    padding: .625rem .75rem;
    text-align: left;
}

.pms-dropzone-tile,
.pms-file-tile {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    color: var(--bs-primary);
    background-color: var(--pms-blue-50);
    border-radius: var(--bs-border-radius-sm);
}

.pms-dropzone-tile {
    color: var(--bs-secondary-color);
    background-color: var(--bs-tertiary-bg);
    border-radius: var(--bs-border-radius);
}

.pms-file {
    display: flex;
    gap: .75rem;
    align-items: center;
    padding: .5rem .5rem .5rem .75rem;
    background-color: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
}

/* Select2 inside a .pms-field: leave room for the leading icon. */
.pms-field > .select2-container .select2-selection--single {
    padding-left: 2.5rem;
}

/* Stage tracker (tender detail, project workspace): numbered steps joined by a hairline. */
.pms-stepper {
    display: flex;
    gap: 1rem;
    margin: 0;
    padding: 0;
    overflow-x: auto;
    list-style: none;
}

.pms-step {
    position: relative;
    display: flex;
    flex: 1 0 9rem;
    gap: .75rem;
    align-items: flex-start;
}

.pms-step:not(:last-child)::after {
    position: absolute;
    top: .875rem;
    right: 0;
    left: 2.75rem;
    height: 1px;
    content: "";
    background-color: var(--bs-border-color);
    transform: translateX(calc(100% - 3.5rem));
    display: none;
}

.pms-step-dot {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    font-size: .75rem;
    font-weight: 600;
    color: var(--bs-secondary-color);
    background-color: var(--bs-body-bg);
    border: 1px solid var(--bs-gray-300);
    border-radius: 50%;
}

.pms-step-done .pms-step-dot {
    color: #fff;
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

.pms-step-current .pms-step-dot {
    color: var(--bs-primary);
    border: 2px solid var(--bs-primary);
}

.pms-step-ended .pms-step-dot {
    color: #fff;
    background-color: var(--bs-danger);
    border-color: var(--bs-danger);
}

/* Selectable card (Team Lead / auditor pickers): the whole card is the label; the checked one is outlined. */
.pms-choice {
    cursor: pointer;
}

.pms-choice:has(input:checked) {
    background-color: var(--pms-blue-50);
    border-color: var(--bs-primary);
}

/* Team Lead card on Allocate (ALC-02): the whole card selects; the chosen one gets a blue outline. */
.pms-lead { cursor: pointer; }
.pms-lead:has(input[name="TeamLead"]:checked) { border-color: var(--bs-primary); box-shadow: 0 0 0 1px var(--bs-primary); }
.pms-lead-auditors > li + li { border-top: 1px solid var(--bs-border-color-translucent); }

/* 4. Table helpers ------------------------------------------------------------ */
/* Rows that open a record. */
.pms-row-link {
    cursor: pointer;
}

.pms-row-link:focus-visible {
    outline: 2px solid var(--bs-primary);
    outline-offset: -2px;
}

/* In list tables (a table card: .card > .table-responsive > .table) codes,
   dates, numbers and row actions never break - LD-2026-0101 must not split at
   its hyphen - while name columns wrap and .text-wrap free-text columns keep
   a readable minimum width. */
.card > .table-responsive > .table > tbody > tr > td:first-child,
.card > .table-responsive > .table > tbody > tr > td.small,
.card > .table-responsive > .table > tbody > tr > td.text-end,
.card > .table-responsive > .table > tbody > tr > td a {
    white-space: nowrap;
}

.table > tbody > tr > td.text-wrap {
    min-width: 10rem;
}

/* Column widths of the editable quotation line-item table. */
.pms-col-service { min-width: 12.5rem; }
.pms-col-num { width: 7.5rem; min-width: 7rem; }
.pms-col-amount { width: 8.75rem; min-width: 8rem; }
.pms-col-action { width: 3rem; }

/* 5. Page loader (toggled by Pms.showLoader / hideLoader via .d-none) ------ */
#pageLoader {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(var(--pms-scrim-rgb), .32);
}

/* 6. SweetAlert2 theme (confirmations and toasts) ------------------------- */
.swal2-container {
    /* SweetAlert2 11.2x sets confirmButtonColor as an inline custom property on
       the button, so the brand default goes through the same variable and a
       per-call colour (destructive red in Pms.confirmDelete) still wins. */
    --swal2-confirm-button-background-color: var(--bs-primary);
    --swal2-action-button-focus-box-shadow: 0 0 0 var(--bs-focus-ring-width) var(--bs-focus-ring-color);
}

.swal2-container.swal2-backdrop-show {
    background: rgba(var(--pms-scrim-rgb), .48);
}

.swal2-container .swal2-popup {
    width: min(440px, calc(100% - 2rem));
    padding: 1.5rem;
    font-family: var(--bs-body-font-family);
    border-radius: var(--bs-border-radius-xl);
    box-shadow: var(--pms-shadow-2xl);
}

.swal2-container .swal2-title {
    padding: .5rem 0 0;
    font-size: 1.125rem;
    line-height: 1.625rem;
    font-weight: 600;
    color: var(--bs-emphasis-color);
}

.swal2-container .swal2-html-container {
    margin: .5rem 0 0;
    padding: 0;
    font-size: .875rem;
    line-height: 1.25rem;
    color: var(--bs-secondary-color);
}

.swal2-container .swal2-icon {
    margin: .5rem auto 0;
    transform: scale(.8);
}

.swal2-container .swal2-actions {
    gap: .75rem;
    margin-top: 1.5rem;
}

.swal2-container .swal2-styled {
    min-height: 2.5rem;
    margin: 0;
    padding: 0 1rem;
    font-family: var(--bs-body-font-family);
    font-size: .875rem;
    font-weight: 600;
    border-radius: var(--bs-border-radius);
    box-shadow: none;
}

.swal2-container .swal2-styled.swal2-confirm {
    background-color: var(--swal2-confirm-button-background-color);
}

.swal2-container .swal2-styled.swal2-cancel {
    order: -1;
    color: var(--bs-emphasis-color);
    background-color: var(--bs-body-bg);
    border: var(--bs-border-width) solid var(--bs-gray-300);
}

.swal2-container .swal2-styled:focus-visible {
    box-shadow: 0 0 0 var(--bs-focus-ring-width) var(--bs-focus-ring-color);
}

/* Responsive ------------------------------------------------------------------ */
@media (max-width: 1199.98px) {
    :root { --pms-page-padding: 1.5rem; }
}

@media (max-width: 991.98px) {
    .pms-topbar { padding: 0 1rem; }
}

@media (max-width: 767.98px) {
    :root { --pms-page-padding: 1rem; }
    .pms-topbar { height: 3.75rem; }
}

/* Quotation lists (S06): the Figma filter bar has no "Clear all" link, only the removable filter chips. */
.pms-list-quiet [data-role="clear"] {
    display: none !important;
}

/* Printable documents (quotation preview): only the document is printed. */
.pms-doc {
    max-width: 52rem;
}

@media print {
    .pms-sidebar,
    .pms-topbar,
    .pms-footer,
    #toastHost,
    .d-print-none {
        display: none !important;
    }

    .pms-shell {
        display: block;
    }

    .pms-content {
        padding: 0;
    }

    #prevWrap {
        background: none !important;
        border: 0;
        box-shadow: none;
    }

    #prevWrap .card-body {
        padding: 0 !important;
    }

    .pms-doc {
        max-width: none;
        border: 0 !important;
        box-shadow: none !important;
    }
}


/* ---- Responsive pass (R02 / R03): phone 375 and tablet 768 ----------------------------------------------------------- */
/* Header: below lg the search opens from an icon as a full-width row under the bar. */
@media (max-width: 991.98px) {
    .pms-topbar { position: sticky; padding: 0 1rem; gap: .5rem !important; }
    .pms-topbar .pms-search { display: none; }
    .pms-topbar.pms-search-open .pms-search {
        display: block !important; position: absolute; left: 0; right: 0; top: 100%; width: auto; max-width: none; padding: .5rem 1rem;
        background: var(--bs-body-bg); border-bottom: 1px solid var(--bs-border-color); box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .08); z-index: 5;
    }
    .pms-topbar.pms-search-open .pms-search .pms-kbd { display: none !important; }
    .pms-topbar.pms-search-open #globalSearchResults { position: static; margin-top: .5rem; max-height: 60vh; overflow: auto; }
}

/* Breadcrumb: on phones only the current page, the back link above the title handles the way up. */
@media (max-width: 575.98px) {
    .pms-topbar .pms-breadcrumb .breadcrumb-item:not(.active) { display: none; }
    .pms-topbar .pms-breadcrumb .breadcrumb-item.active { padding-left: 0; }
    .pms-topbar .pms-breadcrumb .breadcrumb-item.active::before { display: none; }
    .pms-topbar .pms-breadcrumb { min-width: 0; flex: 1 1 auto; }
    .pms-topbar .pms-breadcrumb .breadcrumb-item.active { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
}

/* Inputs stay at 16px on phones so iOS Safari does not zoom the page on focus. */
@media (max-width: 575.98px) {
    .form-control, .form-select, .select2-container--bootstrap-5 .select2-selection, .select2-search__field { font-size: 1rem !important; }
    .btn { min-height: 2.5rem; }
    .btn-sm { min-height: 2.25rem; }
    /* KPI cards: two to a row, tighter */
    .pms-page-actions, .pms-page-header .btn { white-space: nowrap; }
    .row > .col-6 > .card > .card-body { padding: .75rem; gap: .25rem !important; }
    .row > .col-6 > .card .display-6 { font-size: 1.5rem; }
    .row > .col-6 > .card .pms-tile { width: 2rem; height: 2rem; font-size: .9rem; }
    .row > .col-6 > .card .pms-kpi-sub { font-size: .6875rem; }
}

/* Lists: the first column stays in view while the rest scrolls sideways; long names wrap instead of widening the table. */
@media (max-width: 767.98px) {
    .table-responsive > .table { --pms-sticky-bg: var(--bs-card-bg, var(--bs-body-bg)); }
    .table-responsive > .table > thead > tr > th:first-child,
    .table-responsive > .table > tbody > tr > td:first-child {
        position: sticky; left: 0; z-index: 1; background-color: var(--pms-sticky-bg); box-shadow: 1px 0 0 var(--bs-border-color);
        min-width: 8.5rem; max-width: 12rem; white-space: normal;
    }
    .table-responsive > .table .btn-sm, .table-responsive > .table .dropdown-toggle { min-width: 2.25rem; min-height: 2.25rem; }
}

/* A strip that scrolls sideways (week strips, tab strips) with a soft edge so people know there is more. */
.pms-scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
@media (max-width: 767.98px) {
    .nav-tabs, .nav-underline { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
    .nav-tabs::-webkit-scrollbar, .nav-underline::-webkit-scrollbar { display: none; }
    .nav-tabs .nav-link, .nav-underline .nav-link { white-space: nowrap; }
}

/* Wizard stepper: a compact "Step N of M" strip on phones, the current step kept in view. */
@media (max-width: 767.98px) {
    #cpStepper, .pms-stepper { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
    #cpStepper::-webkit-scrollbar, .pms-stepper::-webkit-scrollbar { display: none; }
    #cpStepper .pms-step { flex: 0 0 auto; scroll-snap-align: center; }
    #cpStepper .pms-step:not(.pms-step-current) > span:last-child { display: none; }
}
/* Tenders list (TND-01): the title under the tender code stays on one line, as on the Figma frames. */
.pms-tender-title {
    max-width: 15rem;
}
.pms-tender-note {
    max-width: 13rem;
}

/* Stage tracker with hairline connectors between the steps (tender detail, create project): the line turns blue once the step before it is done. */
.pms-stepper-lines {
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
}
.pms-stepper-lines .pms-step {
    flex: 0 0 auto;
}
.pms-stepper-lines .pms-step-line {
    flex: 1 1 1rem;
    min-width: .75rem;
    max-width: 3rem;
    height: 2px;
    margin-top: .8125rem;
    background-color: var(--bs-gray-300);
    border-radius: 1px;
}
.pms-stepper-lines .pms-step-line.is-done {
    background-color: var(--bs-primary);
}
.pms-stepper-lines .pms-step-done .pms-step-dot i { font-size: .875rem; }

/* Label / value pairs on the tender pages. */
.pms-tender-dl dt {
    font-size: .75rem;
    font-weight: 400;
    color: var(--bs-tertiary-color);
}
.pms-tender-dl dd {
    margin: 0;
    font-weight: 500;
    color: var(--bs-emphasis-color);
}

/* Drop zone that shows the Figma validation state (red dashes) while its hidden proxy input is invalid. */
.pms-file-proxy.is-invalid ~ .pms-error { display: none !important; }
.pms-dropzone-field:has(~ .pms-file-proxy.is-invalid) {
    color: var(--bs-danger);
    border-color: var(--bs-danger);
}
.pms-dropzone-field:has(~ .pms-file-proxy.is-invalid) .pms-dropzone-tile { color: var(--bs-danger); background-color: var(--bs-danger-bg-subtle, #fee4e2); }
.pms-dropzone-field:has(~ .pms-file-proxy.is-invalid) .text-body-tertiary { color: var(--bs-danger) !important; }

/* Two columns as on the Figma wizard and handover frames: a 696px form beside a 400px summary (shrinks proportionally, stacks below lg). */
.pms-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}
@media (min-width: 992px) {
    .pms-split { grid-template-columns: minmax(0, 696fr) minmax(0, 400fr); }
}
.pms-cp-priority { min-height: 2.5rem; }

/* Multi-select with chips on one line (Create project > Services): remove cross after the label, chevron like a single select. */
.pms-multi-flat .select2-container--bootstrap-5 .select2-selection--multiple {
    min-height: 2.5rem;
    padding: .25rem 2.25rem .25rem .5rem;
    background: var(--bs-body-bg) url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23667085' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") no-repeat right .75rem center / 16px 12px;
}
.pms-multi-flat .select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__rendered {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem;
    align-items: center;
}
.pms-multi-flat .select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice {
    display: inline-flex;
    flex-direction: row-reverse;
    gap: .375rem;
    align-items: center;
    margin: 0;
    padding: .125rem .625rem;
    font-size: .75rem;
    background-color: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 999px;
}
.pms-multi-flat .select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice__remove {
    position: static;
    margin: 0;
    padding: 0;
    font-size: .75rem;
}
.pms-multi-flat .select2-container--bootstrap-5 .select2-selection--multiple .select2-search--inline .select2-search__field { margin: 0; }

/* Create project: hints and option descriptions are 12px on the Figma wizard frames. */
#cpPage .small { font-size: .75rem; line-height: 1rem; }
.pms-multi-flat .select2-container--bootstrap-5 .select2-selection--multiple .select2-search--inline { display: flex; flex: 1 1 3rem !important; width: auto !important; min-width: 3rem; }
.pms-multi-flat .select2-container--bootstrap-5 .select2-selection--multiple .select2-search--inline .select2-search__field { width: 100% !important; height: 1.5rem; }
.pms-multi-flat .select2-container--bootstrap-5 .select2-selection--multiple { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; }
.pms-multi-flat .select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__rendered { flex: 0 1 auto; width: auto; }

/* Record-header subtitle: 16px as on the Figma record headers (Bootstrap's .lead is 18px). */
.pms-record-sub { font-size: 1rem; line-height: 1.5rem; }

/* Financial-year picker beside the dashboard greeting: keeps room for "FY 2026-27" once Select2 has measured it. */
.pms-field.w-auto > .select2-container { min-width: 10rem; }

/* Option descriptions in the tender dialogs and drawer are 12px on the Figma frames. */
.pms-tnd .form-check-label .small { font-size: .75rem; line-height: 1rem; }

/* New tender drawer and tender dialogs: label 12px/16px with a 6px gap, helper 6px below the control, 12px between control and text (Figma TND-02). */
.pms-tnd .modal-body .form-label { margin-bottom: .375rem; font-size: .75rem; line-height: 1rem; }
.pms-tnd .modal-body p.small.mt-1 { margin-top: .375rem !important; }
.pms-tnd .pms-label-row { align-items: center !important; margin-bottom: .375rem; }
.pms-tnd .pms-label-row .form-label { margin-bottom: 0; }
.pms-tnd .pms-label-row .btn-link { font-size: .75rem; line-height: 1rem; font-weight: 500; text-decoration: none; }
.pms-tnd .modal-header .modal-title { line-height: 1.625rem; margin-bottom: .25rem; }
.pms-tnd .form-check { gap: .75rem; }
.pms-tnd .form-check-label { color: var(--bs-body-color); line-height: 1.25rem; }
.pms-tnd .form-check-label .small { margin-top: .125rem; }
.pms-tnd .form-switch .form-check-input { width: 2.75rem; height: 1.5rem; }
.pms-tnd textarea.form-control { min-height: 6rem; }

/* Trailing icon in a .pms-field (calendar on date fields). */
.pms-field > .pms-field-end { position: absolute; top: 50%; right: .75rem; z-index: 2; color: var(--bs-body-color); transform: translateY(-50%); pointer-events: none; }

/* Date field that reads "25 Sep 2026" with the calendar icon on the right; the native picker opens from anywhere on the field. */
.pms-date > input[type="date"] { padding-left: .75rem; padding-right: 2.5rem; color: transparent; background-image: none; }
.pms-date > input[type="date"]::-webkit-datetime-edit { opacity: 0; }
.pms-date > input[type="date"]::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: auto; height: auto; opacity: 0; cursor: pointer; }
.pms-date > .pms-date-text { position: absolute; top: 50%; left: .75rem; z-index: 1; max-width: calc(100% - 3.25rem); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transform: translateY(-50%); pointer-events: none; }
.pms-date > .pms-date-text.is-empty::before { content: "Select date"; color: var(--bs-tertiary-color); }
.pms-tnd .modal-body p.small { line-height: 1rem; }
.pms-tnd .modal-body .form-label { display: block; }
.pms-tnd .modal-header .btn-close { margin: 0; }
.pms-tnd .pms-label-row .btn-link { display: inline-flex; align-items: center; height: 1rem; padding: 0; }
.pms-tnd textarea.form-control { resize: none; }
.pms-tnd .modal-body .small { font-size: .75rem; line-height: 1rem; }

/* EXE-19 Timesheets: person rows with a card per working day (Figma "Timesheets by person"). */
.pms-ts { min-width: 56rem; }
.pms-ts-row { display: grid; grid-template-columns: 11rem minmax(0, 1fr) 6.5rem; gap: 1rem; align-items: center; padding: .5rem 0; }
.pms-ts-row[data-person] { cursor: pointer; }
.pms-ts-head { color: var(--bs-tertiary-color); font-size: .75rem; padding-bottom: .25rem; }
.pms-ts-group { font-size: .75rem; font-weight: 600; margin: .75rem 0 .25rem; }
.pms-ts-days { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .5rem; }
.pms-ts-head .pms-ts-days { display: block; }
.pms-ts-cell { display: flex; flex-direction: column; gap: .125rem; padding: .5rem .625rem; border: 1px solid var(--bs-border-color); border-radius: .5rem; background: var(--bs-body-bg); min-height: 3.75rem; }
.pms-ts-cell b { font-size: .75rem; font-weight: 500; }
.pms-ts-cell i { font-style: normal; font-size: .9375rem; font-weight: 600; }
.pms-ts-cell small { font-size: .6875rem; color: var(--bs-tertiary-color); }
.pms-ts-cell.is-today { background: var(--pms-blue-50, #eef0ff); border-color: var(--pms-blue-100, #d6dbff); }
.pms-ts-cell.is-upcoming { background: var(--bs-tertiary-bg); }
.pms-ts-cell.is-upcoming i, .pms-ts-cell.is-leave i { color: var(--bs-tertiary-color); font-weight: 400; }
.pms-ts-cell.is-leave { background: var(--bs-secondary-bg); }
.pms-ts-cell.is-missing { background: var(--bs-warning-bg-subtle); border-style: dashed; border-color: var(--bs-warning); }
.pms-ts-cell.is-missing small { color: var(--bs-warning-text-emphasis); }

/* Page header: the title block takes the free width (its subtitle wraps) so the action buttons stay on the right (Figma "Page Header") */
.pms-page-head-main { flex: 1 1 0; min-width: min(100%, 18rem); }

/* ALC-04 Assign auditors: the man-day share input at the end of a member row */
.pms-md-input { width: 7.5rem !important; flex: none; }
@media (max-width: 575.98px) { .pms-md-input { width: 5.5rem !important; } }

/* Man-days bar with ticks at 50 %, 75 % and 100 % of the approved effort (--t1..--t3 are set by the page script) */
.pms-thresholds { position: relative; }
.pms-thresholds::after { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
    background: linear-gradient(to right, transparent calc(var(--t1, 50%) - 1px), var(--bs-body-bg) calc(var(--t1, 50%) - 1px) calc(var(--t1, 50%) + 1px), transparent calc(var(--t1, 50%) + 1px)),
        linear-gradient(to right, transparent calc(var(--t2, 75%) - 1px), var(--bs-body-bg) calc(var(--t2, 75%) - 1px) calc(var(--t2, 75%) + 1px), transparent calc(var(--t2, 75%) + 1px)),
        linear-gradient(to right, transparent calc(var(--t3, 100%) - 2px), var(--bs-body-bg) calc(var(--t3, 100%) - 2px) calc(var(--t3, 100%) - 1px), transparent calc(var(--t3, 100%) - 1px)); }

/* Project workspace header actions: pairs of buttons share the row on a phone instead of staggering */
@media (max-width: 575.98px) { #wsActions > .btn, #wsActions > .dropdown { flex: 1 1 auto; } #wsActions > .btn { justify-content: center; } }

/* Time fields inside .pms-field: the native clock glyph is replaced by the design's icon */
.pms-field > input[type="time"] { padding-right: 2.5rem; }
.pms-field > input[type="time"]::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: auto; height: auto; opacity: 0; cursor: pointer; }

/* Daily report: the hours field carries its unit */
.pms-hours-input { padding-right: 2rem; -moz-appearance: textfield; }
.pms-hours-input::-webkit-outer-spin-button, .pms-hours-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pms-field > .pms-field-end.small { pointer-events: none; }

/* FND-13 User menu */
.pms-user-menu { min-width: 19rem; }
.pms-role-row.is-active { background: var(--bs-primary-bg-subtle); }
/* The role's radio (Switch role): a 1.125rem ring; the role in use gets a filled 0.5rem dot */
.pms-role-radio { position: relative; flex: none; width: 1.125rem; height: 1.125rem; margin-top: .1875rem; border: 2px solid var(--bs-secondary-color); border-radius: 50%; }
.pms-role-row.is-active .pms-role-radio { border-color: var(--bs-primary); }
.pms-role-row.is-active .pms-role-radio::after { content: ""; position: absolute; inset: 0; margin: auto; width: .5rem; height: .5rem; border-radius: 50%; background: var(--bs-primary); }

/* Header: a long breadcrumb (Home / My projects / PRJ-2026-001 / Rounds) shrinks and clips instead of pushing the account menu off the right edge */
.pms-crumbs { min-width: 0; overflow: hidden; }
.pms-crumbs .breadcrumb { flex-wrap: nowrap; white-space: nowrap; }
.pms-crumbs .breadcrumb-item { overflow: hidden; text-overflow: ellipsis; }

/* Request-issuance reason: the validation state is the red border and the message below it (Figma CER-09), not Bootstrap's inline icon */
#rqReason.is-invalid { background-image: none; padding-right: .75rem; }
#isVerdict .js-vlink.hide-link { display: none !important; }

/* FND-12 global search: results are wider than the field so the project name and status stay readable */
#globalSearchResults { min-width: min(36rem, calc(100vw - 2rem)); max-height: 70vh; overflow-y: auto; }
#globalSearchResults .dropdown-item.active, #globalSearchResults .dropdown-item:focus { background: var(--bs-primary-bg-subtle); color: inherit; }
#globalSearchResults .dropdown-item span.small { white-space: normal; }
@media (min-width: 992px) { #globalSearchResults { left: auto; right: 0; } }
@media (max-width: 991.98px) { #globalSearchResults { min-width: 0; } }

/* Charts with one column per item (bars above, labels below) scroll sideways when the columns do not fit the card;
   the page script sets --pms-cols to the number of columns on .pms-chart-inner. */
.pms-chart-scroll { overflow-x: auto; overflow-y: hidden; padding-bottom: .25rem; }
.pms-chart-inner { min-width: calc(var(--pms-cols, 0) * 3.5rem); }


/* FND-05 loading skeleton: grey bars standing in for a label / value pair */
.pms-skel { display: grid; grid-template-columns: minmax(5rem, 9rem) 1fr; gap: .875rem 1.25rem; align-items: center; }
.pms-skel > span, .pms-skel-bar, .pms-skel-tile { display: block; height: .75rem; border-radius: .5rem; background-color: var(--bs-tertiary-bg, #f1f3f9); animation: pms-skel 1.4s ease-in-out infinite; }
@keyframes pms-skel { 50% { opacity: .5; } }
.pms-skel-tile { flex: none; width: 2rem; height: 2rem !important; border-radius: .5rem !important; }
@media (prefers-reduced-motion: reduce) { .pms-skel > span, .pms-skel-bar, .pms-skel-tile { animation: none; } }
