/*======================================================
  FROST TABLE - Global Reusable Table System
  ✓ Fixed headers (sort + filter rows)
  ✓ Frozen columns support
  ✓ Horizontal & vertical scrolling
  ✓ Action bar with bulk actions
  ✓ Custom pagination
  ✓ Export/Print functionality
  ✓ Column visibility toggle
======================================================*/

/* ==================== CSS VARIABLES ==================== */
:root {
    /* Column widths - customize per table via inline CSS variables */
    --frost-col1-width: 40px;
    --frost-col2-width: 100px;
    --frost-col3-width: 180px;

    /* Heights */
    --frost-header-height: 48px;
    --frost-filter-height: 46px;
    --frost-row-height: 48px;

    /* Colors */
    --frost-header-bg: #F5F5F5;
    --frost-filter-bg: rgb(205, 206, 208);
    --frost-border: #e2e8f0;
    --frost-row-bg: #ffffff;
    --frost-row-alt: #f8fafc;
    --frost-row-hover: #e0f2fe;
    --frost-primary: #1e293b;
    --frost-accent: #38bdf8;
    --frost-text: #334155;
    --frost-text-muted: #667085;
}

/* Table-specific CSS variables */
.frost-table {
    --frost-col1-width: 40px;
    --frost-col2-width: 100px;
    --frost-col3-width: 180px;
}

/* ==================== CONTAINER ==================== */
.frost-frame {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Static height fallback — applies ONLY when frost-table.js is absent.
   The script adds `frost-js` to <html> (see initFrostFrameViewportFitOnce in frost-table.js) and
   from then on JS owns the frame height: it MEASURES the frame's distance from the top of the
   viewport and pins the frame so the pagination footer sits a fixed gap above the bottom of the
   screen, or leaves the frame content-sized when the rows do not fill it.

   Why this rule can no longer be unconditional: it defeated the very JS that was meant to
   supersede it. `sizeAllFrames()` cleared the inline height to probe the frame's NATURAL content
   height, but with this declaration live "no inline height" means "clamped to 100vh - offset",
   not "auto" — so the probe read the clamp back, the `content > target` test was false, and the
   frame was NEVER pinned to the viewport. The footer then sat at `frameTop + clamp`, i.e. a gap of
   `--frost-frame-offset - frameTop` below the screen, which does not track the viewport height at
   all and varies per page with whatever chrome sits above the table.

   Declaring it under `html:not(.frost-js)` also removes the specificity fight: when JS is present
   this stylesheet declares no height at all, so a page that legitimately owns its frame's height
   (embedded card, wizard preview) keeps it at any specificity.

   `:not(.is-simple):not(.is-embedded)` is load-bearing, not decoration: this selector is one step
   more specific than the plain `.frost-frame.is-simple { height: auto }` below, so without the
   exclusions it would win and start clamping simple/embedded tables that are content-sized on
   purpose. */
html:not(.frost-js) .frost-frame:not(.is-simple):not(.is-embedded) {
    /* Fill viewport to show as many rows as possible */
    height: clamp(320px, calc(100vh - var(--frost-frame-offset, 280px)), 1400px);
}

.frost-frame.is-simple {
    height: auto;
}

.frost-container {
    padding: 0px !important;
    overflow: visible;
    border: 1px solid var(--frost-border);
    border-radius: 0;
    background: #fff;
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1 1 auto;
}

/* ==================== TOOLBAR (Optional global search) ==================== */
.frost-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #f8fafc;
    border-bottom: 1px solid var(--frost-border);
    flex-wrap: wrap;
    gap: 12px;
}

.frost-toolbar-left,
.frost-toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.frost-entries-select {
    padding: 8px 12px;
    border: 1px solid var(--frost-border);
    border-radius: 6px;
    background: #fff;
    font-size: 14px;
}

.frost-global-search {
    padding: 10px 16px;
    border: 1px solid var(--frost-border);
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
    min-width: 280px;
}

.frost-global-search:focus {
    outline: none;
    border-color: var(--frost-accent);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.1);
}

/* ==================== SCROLL WRAPPER ==================== */
.frost-scroll-wrapper {
    position: relative;
    /* Responsive max-height based on viewport with a safe min/max */
    max-height: clamp(260px, calc(100vh - var(--frost-scroll-offset, 320px)), 900px);
    overflow: auto;
    scrollbar-width: thin;
}

/* When inside a frame, let the table body use all remaining space */
.frost-frame .frost-scroll-wrapper {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
}

/* The Blade component emits a per-table `#{tableId}-scrollWrapper { max-height: clamp(260px,
   calc(100vh - 320px), 900px); min-height: clamp(260px, 45vh, 400px) }` block (see
   resources/views/components/frost-table.blade.php). An ID selector outranks the class rule above,
   so those caps won inside the frame and produced dead white space that looked like the frame was
   mis-sized:
     - the 900px max-height left a band between the last row and the pagination footer on tall
       screens (measured: 151px at a 1440px viewport);
     - the 400px min-height held the wrapper open under a short table (measured: 273px of empty
       space under the last row of a 3-row table).
   Inside a JS-sized frame the wrapper must simply be `flex: 1` and take exactly the space the frame
   gives it, so re-assert that here. `!important` is required to outrank the ID selectors.

   Scoped to `.frost-frame--js-fit`, which is added ONLY to frames some script actually sizes.
   Releasing the caps on a frame nobody sizes would leave nothing constraining the wrapper at all —
   a frame inside a modal grew to its full 9756px content height in exactly that case.

   TWO independent engines add this class, and BOTH gate it on the same predicate:
     - frost-table.js (Blade tables) adds it in sizeFrame(), and strips it again from simple/embedded
       frames, frames inside
       `.modal/.offcanvas/dialog/[role=dialog]/.p-dialog/.p-drawer/.p-sidebar`, and frames opted out
       with `data-frost-viewport-fit="off"`.
     - resources/js/components/Common/FrostTable.vue (Vue tables) binds it to its own
       `viewportFitEnabled` computed, which applies the same overlay/opt-out/embedded/simple test.
   So a page that loads this stylesheet WITHOUT frost-table.js does NOT automatically escape the
   rule: a Vue <FrostTable> on such a page still emits the class from its template (and still sizes
   itself). Only the height rule at the top of this file is gated on `html:not(.frost-js)`; this
   cap-release rule is deliberately ungated, because the class itself is the gate. */
.frost-frame.frost-frame--js-fit .frost-scroll-wrapper {
    max-height: none !important;
    min-height: 0 !important;
}

/* A one-cell server error row must not let the table/frame collapse to its
   message's intrinsic width. Keep the same full-width geometry as loaded rows. */
.frost-frame.frost-has-load-error,
.frost-container.frost-has-load-error,
.frost-scroll-wrapper.frost-has-load-error,
.frost-table.frost-has-load-error {
    width: 100% !important;
    min-width: 100% !important;
    align-self: stretch;
    box-sizing: border-box;
}

.frost-load-error-row > td {
    width: 100%;
    padding: 2rem !important;
    color: #dc2626;
    text-align: center !important;
    white-space: normal !important;
}

/* Footer sits below the scroll area inside the flex column (do not sticky to viewport — breaks at zoom / short heights). */
.frost-frame .frost-footer {
    flex-shrink: 0;
    position: relative;
    z-index: 200;
    background: #ffffff;
    box-shadow: 0 -6px 12px rgba(15, 23, 42, 0.08);
}

/* ==================== TABLE BASE ==================== */
.frost-table {
    width: 100%;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed !important;
}

.frost-table thead th,
.frost-table tbody td {
    box-sizing: border-box !important;
}

.frost-table th,
.frost-table td {
    padding: 5px 17px;
    text-align: left;
    border-bottom: 1px solid var(--frost-border);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
}

/* Don't apply text-overflow on cells containing badges */
.frost-table td:has(.custom-badge),
.frost-table td:has(.custom-badge-id),
.frost-table td:has(.status-badge),
.frost-table td:has(.name-badge) {
    overflow: visible;
    text-overflow: unset;
}

/* Allow action cell to overflow for popup */
.frost-table td.action-cell {
    overflow: visible !important;
}

/* Checkbox/action columns should show only their control, never a text ellipsis. */
.frost-table th:has(input[type="checkbox"]),
.frost-table td:has(input[type="checkbox"]),
.frost-table td.action-cell {
    overflow: visible !important;
    text-overflow: clip !important;
}

/* The select (checkbox) control column hugs its checkbox with the same 10px
   horizontal gutter as every other body cell. The action column gets its 10px
   gutter from the `tbody td` rule below (no forced centering, so action menus
   keep their alignment). */
.frost-table th:has(input[type="checkbox"]),
.frost-table td:has(input[type="checkbox"]) {
    padding-left: 10px !important;
    padding-right: 10px !important;
    text-align: center !important;
}

/* ==================== BODY CELL HORIZONTAL GUTTER ====================
   Every BODY cell carries a 10px gutter on the left and right (UI spec). Header
   cells (th) keep their own padding / sort-caret reserve. `.frost-table tbody td`
   outranks the base `.frost-table td { padding: 5px 17px }` (more element
   selectors + later in the file), so this wins without !important; the
   checkbox / action carve-out above still wins via !important where it applies.
   Combined with `white-space:nowrap; overflow:hidden; text-overflow:ellipsis`
   on the base cell, body text truncates to the column width with an ellipsis.
   The fit reserve (FIT_PAD / PAD = 10 in FrostTable.vue and frost-table.js) is
   kept in sync with this value so auto-fit columns hug to the same gutter. */
.frost-table tbody td {
    padding-left: 10px;
    padding-right: 10px;
}

/* ==================== RESIZE-AWARE CELL TEXT TRUNCATION ====================
   Wrap any cell text that should shrink with the column in `.frost-cell-text`.
   It truncates to the CURRENT column width (max-width:100%, never a fixed px),
   so dragging a column wider/narrower shows more/fewer characters, with the
   overflow rendered as an ellipsis. This is the standard for variable-width
   truncation — prefer it over hardcoded `max-width: NNpx` on inner spans.

   Works for plain cells AND for text sitting next to an icon inside a flex
   badge such as `.name-badge` (the icon stays fixed; the text fills the rest
   and ellipsises). Opt-in via `:has()` so existing tables are unaffected. */
.frost-table .frost-cell-text {
    display: block;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* A flex badge that contains truncating text must be allowed to shrink to the
   cell width; the icon keeps its size, the text takes the remaining space. */
.frost-table .name-badge:has(.frost-cell-text) {
    min-width: 0;
    max-width: 100%;
}

.frost-table .name-badge:has(.frost-cell-text) > .icon,
.frost-table .name-badge:has(.frost-cell-text) > img {
    flex: 0 0 auto;
}

.frost-table .name-badge > .frost-cell-text {
    flex: 1 1 auto;
}

/* ── GENERAL text truncation for ANY frost table ───────────────────────────
   The base `.frost-table td` rule only ellipsises text that is a DIRECT child
   of the cell. A value wrapped in a plain (unclassed, unstyled) text element —
   the very common `<div>Title</div>` / `<a>Text</a>` cell pattern — would wrap
   or hard-clip instead. Make those wrappers truncate to the CURRENT column
   width with an ellipsis too (resize-aware). Badge / flex / control wrappers
   always carry a class or inline style, so `:not([class]):not([style])` leaves
   them untouched. For explicit control, add `.frost-cell-text` to the element. */
.frost-table tbody td > div:not([class]):not([style]),
.frost-table tbody td > p:not([class]):not([style]),
.frost-table tbody td > a:not([class]):not([style]) {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Wrapping chip/badge stacks (e.g. grouped source-id badges under a title) ──
   Cap the stack at ~2 rows and scroll vertically past that, so a group with many
   sources never grows the row unbounded. Reusable across every frost table. */
.frost-table .frost-badge-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-top: 4px;
    max-height: 42px;       /* ~2 rows of chips */
    overflow-y: auto;
}

/* ==================== DYNAMIC HEADER-FIT COLUMN WIDTHS ====================
   When a table opts into header-fit (table.frost-fit-headers, added by frost-table.js when
   the table has no author-pinned widths / saved widths), each column is sized to hug its
   HEADER content with exactly 10px of padding on the left and 10px on the right (the JS
   measures the header text + sort-icon space and sets the column width). The horizontal
   cell padding is therefore set to 10px so the column truly hugs its header instead of
   carrying the default 17px gutters.

   Truncation is unchanged: body cells keep `white-space:nowrap; overflow:hidden;
   text-overflow:ellipsis` and the JS hover tooltip, so cell text truncates to the CURRENT
   (resizable) column width — never to a fixed character/px cap. Resize, frozen columns,
   action/checkbox/badge overflow cells, and horizontal scroll all keep their existing rules:
   the carve-outs below preserve the sort-icon reserve and the action/checkbox gutters. */
.frost-table.frost-fit-headers th,
.frost-table.frost-fit-headers td {
    padding-left: 10px;
    padding-right: 10px;
}

/* Keep room for the sort caret on sortable headers even in fit mode. */
.frost-table.frost-fit-headers thead tr.frost-sort-row th[data-sort] {
    padding-right: 24px;
}

/* ISSUE B — Center the HEADER LABEL text on header-fit tables only.
   Scoped to `.frost-fit-headers` so no other Frost table is affected. `text-align: center`
   is direction-agnostic, so this mirrors correctly in RTL (AR) without a [dir="rtl"] override.
   The sort caret stays absolutely positioned at the inline-end (`.table-sort-icon` right:8px),
   so it remains visible/usable; for sortable headers we mirror the 24px caret reserve on the
   leading edge so the label centers within the available text area instead of being shoved
   off-center by the one-sided caret gutter. The per-column filter row below is left untouched
   (filter controls keep their existing alignment). Only the label text is centered. */
.frost-table.frost-fit-headers thead tr.frost-sort-row th {
    text-align: center;
}

.frost-table.frost-fit-headers thead tr.frost-sort-row th[data-sort] {
    padding-left: 24px;
}

/* The action column header (index 0) keeps its own centered/empty control gutter; checkbox
   control headers stay centered too — both already align, so no extra rule is needed. */

/* Action / checkbox cells use the same 10px control gutter as every other body cell. */
.frost-table.frost-fit-headers th:has(input[type="checkbox"]),
.frost-table.frost-fit-headers td:has(input[type="checkbox"]),
.frost-table.frost-fit-headers td.action-cell {
    padding-left: 10px !important;
    padding-right: 10px !important;
}

/* ==================== SORT ICON ==================== */
.table-sort-icon {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    background-image: url('../images/sort-icon.svg');
    background-size: contain;
    background-repeat: no-repeat;
    cursor: pointer;
    pointer-events: none;
}

/* ==================== HEADER ROW 1 (SORT) ==================== */
.frost-table thead tr.frost-sort-row th {
    position: sticky;
    top: 0;
    z-index: 100;
    /* `height` on a table cell is a MINIMUM: it keeps the default header height for
       single-line labels but still lets the cell grow so a long title (e.g.
       "Date de livraison") wraps onto a second line instead of being cut off with an
       ellipsis. (Do not switch this to `height:auto` + `min-height` — min-height is
       unreliable on table cells, which collapses the header and the resize grip.) */
    height: var(--frost-header-height);
    background: var(--frost-header-bg);
    color: var(--frost-text-muted);
    font-weight: 400;
    font-size: 14px;
    line-height: 1.25;
    letter-spacing: 0.5px;
    border-color: rgb(102, 112, 133, 0.45) !important;
    border-right: 1px solid rgb(102, 112, 133, 0.45) !important;
    cursor: pointer;
    user-select: none;
    overflow: visible;
    /* Override the nowrap/ellipsis inherited from `.frost-table th` so a MULTI-WORD label
       wraps BETWEEN words onto a second line — but a SINGLE word must NEVER split mid-word.
       `overflow-wrap: normal` + `word-break: normal` forbid intra-word breaks (no more
       "Contac"+"t" / "Pipelin"+"e" / "Stag"+"e"); the header-fit pass sizes the column wide
       enough for the widest word, so words stay whole. (Was overflow-wrap:anywhere /
       word-break:break-word, which let a word split when the column was a hair too narrow.) */
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
    word-wrap: normal;
    -webkit-hyphens: none;
    hyphens: none;
    vertical-align: middle;
}

.frost-table thead tr.frost-sort-row th[data-sort] {
    position: sticky;
    padding-right: 28px;
}

.frost-table thead tr.frost-sort-row th[data-sort] .table-sort-icon {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
}

/* Sort icons state */
.sort-icon {
    display: inline-flex;
    flex-direction: column;
    margin-left: 6px;
    vertical-align: middle;
    font-size: 8px;
    line-height: 1;
    opacity: 0.4;
}

.frost-sort-row th:hover .sort-icon { opacity: 0.7; }
.frost-sort-row th.sort-asc .sort-icon,
.frost-sort-row th.sort-desc .sort-icon { opacity: 1; }
.frost-sort-row th.sort-asc .arrow-up { color: var(--frost-accent); }
.frost-sort-row th.sort-desc .arrow-down { color: var(--frost-accent); }

/* ==================== HEADER ROW 2 (FILTER) ==================== */
.frost-table thead tr.frost-filter-row th {
    position: sticky;
    /* Stick right below the sort row. --frost-sort-row-height is published by JS
       (frostSyncHeaderHeight) and grows when a header label wraps; falls back to the
       fixed default height before/if JS hasn't run. */
    top: var(--frost-sort-row-height, var(--frost-header-height));
    z-index: 90;
    height: var(--frost-filter-height);
    /* Match sort-row horizontal padding (see .frost-table th) so filters align under labels */
    padding: 6px 14px;
    vertical-align: middle;
    border-color: rgb(102, 112, 133, 0.45) !important;
    border-right: 1px solid rgb(102, 112, 133, 0.45) !important;
    background: white;
    min-width: 0;
    overflow: visible;
}

.frost-table thead tr.frost-filter-row th.frost-filter-dropdown-open {
    z-index: 49 !important;
}

.frost-table thead tr.frost-filter-row th .frost-ms.is-open {
    z-index: 49;
}

/* Frozen header/filter cells must always sit above horizontally scrolling header cells. */
.frost-table thead tr.frost-sort-row th.frost-frozen-col {
    z-index: 130 !important;
}

.frost-table thead tr.frost-filter-row th.frost-frozen-col {
    z-index: 125 !important;
}

.frost-table thead tr.frost-sort-row th.frost-frozen-right-col {
    z-index: 131 !important;
}

.frost-table thead tr.frost-filter-row th.frost-frozen-right-col {
    z-index: 126 !important;
}

.frost-table thead tr.frost-filter-row th.frost-frozen-col.frost-filter-dropdown-open,
.frost-table thead tr.frost-filter-row th.frost-frozen-right-col.frost-filter-dropdown-open {
    z-index: 10080 !important;
}

.frost-table thead tr.frost-filter-row th.frost-frozen-col .frost-ms.is-open,
.frost-table thead tr.frost-filter-row th.frost-frozen-right-col .frost-ms.is-open {
    z-index: 10070;
}

.frost-table thead tr.frost-filter-row th:not(.frost-frozen-col):not(.frost-frozen-right-col) .frost-ms-dropdown {
    z-index: 49;
}

/* Same extra right inset as sort headers with the sort icon */
.frost-table thead tr.frost-filter-row th.frost-filter-for-sortable-col {
    padding-right: 28px;
}

/* ==================== SEARCH INPUT ==================== */
.search-input-dataTable-frost {
    border: 1px solid #e2e8f0;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 5px 5px 5px 24px;
    height: 28px;
    box-sizing: border-box;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    background-color: #FFF !important;
    background-image: url('../images/loop_icon.svg');
    background-position: left 6px center;
    background-repeat: no-repeat;
    background-size: 14px 14px;
    outline: none;
    font-size: 12px;
}

.search-input-dataTable-frost:focus {
    border-color: var(--frost-accent);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.15);
}

/* RFP/RFQ column: native dropdown (no search icon) */
select.rfp-rfq-filter-select {
    border: 1px solid #e2e8f0;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 4px 8px;
    height: 28px;
    box-sizing: border-box;
    border-radius: 4px;
    background-color: #fff !important;
    font-size: 12px;
    outline: none;
    cursor: pointer;
}

select.rfp-rfq-filter-select:focus {
    border-color: var(--frost-accent);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.15);
}

/* ==================== DATE RANGE PICKER ==================== */
.date-range-input {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="%2364748b" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"/><line x1="16" y1="2" x2="16" y2="6"/><line x1="8" y1="2" x2="8" y2="6"/><line x1="3" y1="10" x2="21" y2="10"/></svg>') !important;
    cursor: pointer;
    padding-right: 24px !important;
}

.date-range-input.active {
    border-color: var(--frost-accent);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.15);
}

.date-range-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.frost-table thead tr.frost-filter-row th .date-range-wrapper {
    box-sizing: border-box;
}

.date-range-clear {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    cursor: pointer;
    opacity: 0.5;
    display: none;
    background: none;
    border: none;
    padding: 0;
    font-size: 14px;
    line-height: 1;
    color: #64748b;
    color: white;
    background: red;
    border-radius: 50%;
    padding-top: 1px;
}

.date-range-clear:hover {
    opacity: 1;
    color: white;
    background: red;
}

.date-range-wrapper.has-value .date-range-clear {
    display: block;
}
.date-range-wrapper .search-input-dataTable-frost{
    background-color: #d3f0ff !important;
}

/* ==================== NUMERIC RANGE FILTER ==================== */
.frost-range-filter {
    display: flex;
    align-items: center;
    gap: 3px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.frost-range-filter .frost-range-input {
    flex: 1 1 0;
    min-width: 0;
    padding: 5px 4px !important;
    background-image: none !important;
    text-align: left;
    -moz-appearance: textfield;
}

.frost-range-filter .frost-range-input::-webkit-inner-spin-button,
.frost-range-filter .frost-range-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.frost-range-separator {
    flex: 0 0 auto;
    color: #98a2b3;
    font-size: 11px;
    line-height: 1;
}
/* ==================== BODY ROWS ==================== */
.frost-table tbody tr {
    height: var(--frost-row-height);
    background: var(--frost-row-bg);
}

.frost-table tbody td {
    font-size: 14px;
    color: var(--frost-text);
}

/* ==================== FROZEN COLUMNS ==================== */
/*
 * Frozen columns are now dynamically generated by the frost-table.blade.php component.
 * The component generates inline styles for headers and a <style> block for tbody cells.
 * This allows any number of frozen columns (2, 3, or more) to work properly.
 */

/* Base styles for frozen cells */
.frost-table th,
.frost-table td {
    background: inherit;
}

/* Ensure tbody cells have proper background when frozen */
.frost-table tbody tr td {
    background: var(--frost-row-bg);
}

/* ── Offer product column: paid + catalogue promo rows (stable on column resize) ── */
.ca-offer-product-cell {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

/* Free-promo rows: badge + title stack stays top-aligned with the thumbnail */
.ca-offer-product-cell:has(.ca-free-line-title-col) {
    align-items: flex-start;
}

.ca-offer-product-title-col,
.ca-free-line-title-col {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    flex: 1;
}

/* Shrink-wrap title (capped at column); avoids full-td flex stretch next to image */
.ca-offer-product-title-inner {
    width: fit-content;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

/* When a pack-details control sits beside the title */
.ca-offer-product-title-row {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 4px;
    min-width: 0;
    width: 100%;
}

.ca-offer-product-title-inner.ca-offer-product-title-inner--grow {
    flex: 1 1 0%;
    min-width: 0;
    width: auto;
    max-width: 100%;
}

.ca-offer-product-cell .product-image {
    flex-shrink: 0;
}

/* ── Catalogue buy-X-get-Y-free sub-rows (show / review / offer tables) ── */
/*
 * Shrink-wrap to title width (capped at column): badge position:absolute top-end of THIS box,
 * not a full-width flex row (that pinned the pill to the td border when resizing).
 */
.ca-free-line-title-wrap {
    position: relative;
    width: fit-content;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
.ca-free-line-title-wrap .ca-free-line-badge {
    position: absolute;
    top: 0;
    inset-inline-end: 0;
    z-index: 1;
    line-height: 1.25;
    white-space: nowrap;
    max-width: calc(100% - 4px);
    overflow: hidden;
    text-overflow: ellipsis;
}
.ca-free-line-title-wrap .ca-free-line-title-text {
    /* Clear the badge band; title stays start-aligned below */
    padding-top: calc(0.25rem + 1.15em + 6px);
    text-align: start;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    line-height: 1.35;
}
.ca-free-line-title-wrap > .ca-product-card-title {
    padding-top: calc(0.25rem + 1.15em + 6px);
    margin: 0;
    text-align: start;
    line-height: 1.35;
    min-width: 0;
    max-width: 100%;
    width: 100%;
}
.ca-free-line-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #047857;
    background: #d1fae5;
    padding: 2px 7px;
    border-radius: 999px;
    vertical-align: middle;
}
/* No promo tint — follow normal frost row striping */
.frost-table tbody tr.ca-free-line-row > td,
.frost-table tbody tr.js-offer-line-row--synthetic.ca-free-line-row > td {
    background: var(--frost-row-bg) !important;
}

/* ==================== NUMBER DISPLAY FIXES ==================== */
/* Prevent table jumping when numbers change format */
/* Use monospace font and fixed widths for consistent layout */

.frost-table .subtotalPriceValue,
.frost-table .tax-value-display,
.frost-table .totalPriceValue,
.frost-table .price-value,
.frost-table .discount-value-display {
    font-size: 14px !important;
    font-weight: 400 !important;
    min-width: 80px !important;
    max-width: 120px !important;
    display: inline-block !important;
}

/* Specific widths for different number columns */
.frost-table td .subtotalPriceValue {
    min-width: 100px !important;
    max-width: 140px !important;
}

.frost-table td .tax-value-display {
    min-width: 80px !important;
    max-width: 120px !important;
}

.frost-table td .totalPriceValue {
    min-width: 100px !important;
    max-width: 140px !important;
}

/* Ensure table cells don't resize when content changes */
.frost-table td:has(.subtotalPriceValue),
.frost-table td:has(.tax-value-display),
.frost-table td:has(.totalPriceValue) {
    position: relative !important;
    overflow: visible !important;
}

/* Input field stability */
.frost-table input.price-value,
.frost-table input.product-item-price,
.frost-table input.product-item-qty,
.frost-table input.product-item-discount {

    border-radius: 0 !important;
    padding: 2px 4px !important;
    text-align: center !important;
    min-width: 60px !important;
    max-width: 120px !important;
    box-sizing: border-box !important;
}

/* Specific input widths */
.frost-table input.product-item-price {
    min-width: 100px !important;
    max-width: 140px !important;
}

.frost-table input.product-item-qty {
    min-width: 50px !important;
    max-width: 80px !important;
}

.frost-table input.product-item-discount {
    min-width: 40px !important;
    max-width: 70px !important;
}

/* ==================== NO FROZEN COLUMNS VARIANT ==================== */
.frost-table.no-frozen-cols th,
.frost-table.no-frozen-cols td {
    position: relative !important;
    left: auto !important;
    z-index: auto !important;
    box-shadow: none !important;
    width: auto;
    min-width: auto;
    max-width: none;
}

.frost-table.no-frozen-cols thead tr.frost-sort-row th,
.frost-table.no-frozen-cols thead tr.frost-filter-row th {
    position: sticky !important;
    z-index: 100;
}

.frost-table.no-frozen-cols thead tr.frost-sort-row th {
    top: 0;
}

.frost-table.no-frozen-cols thead tr.frost-filter-row th {
    top: var(--frost-sort-row-height, var(--frost-header-height));
}

/* First column (action) in no-frozen-cols variant */
.frost-table.no-frozen-cols th:first-child,
.frost-table.no-frozen-cols td:first-child {
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
}

.frost-table.no-frozen-cols thead tr.frost-sort-row th:first-child,
.frost-table.no-frozen-cols thead tr.frost-filter-row th:first-child {
    z-index: 100;
}

/* ==================== ACTION BUTTONS BAR ==================== */
.frost-action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #EAECF0;
    border-bottom: 1px solid var(--frost-border);
    flex-wrap: wrap;
    gap: 12px;
}

#columnToggleBtn {
    background-color: var(--frost-text-muted) !important;
    border-radius: 0px;
    color: white;
    height: -webkit-fill-available;
}

.frost-action-left {
    display: none;
    gap: 8px;
}

.frost-action-left.show {
    display: flex;
}

.frost-action-right {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.frost-action-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--frost-text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.frost-action-btn::before {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 30px;
    background-color: #B2B2B2;
}

.frost-action-btn.approve {
    background: #dcfce7;
    border-color: #86efac;
    color: #166534;
}

.frost-action-btn.approve:hover {
    background: #bbf7d0;
}

.frost-action-btn.reject {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #991b1b;
}

.frost-action-btn.reject:hover {
    background: #fecaca;
}

.frost-action-btn.close-btn {
    background: #fef3c7;
    border-color: #fcd34d;
    color: #92400e;
}

.frost-action-btn.close-btn:hover {
    background: #fde68a;
}

/* ==================== COLUMN DROPDOWN ==================== */
.column-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border: 1px solid var(--frost-border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 8px 0;
    z-index: 9999 !important;
    min-width: 180px;
    max-height: 300px;
    overflow-y: auto;
}

.column-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 13px;
    color: var(--frost-text);
}

.column-dropdown .dropdown-item:hover {
    background: #f1f5f9;
}

.column-dropdown .dropdown-item input {
    margin: 0;
}

/* ==================== FOOTER (PAGINATION) ==================== */
.frost-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: transparent;
    flex-wrap: wrap;
    gap: 12px;
}

.pagination-container {
    position: sticky;
    background-color: transparent;
    z-index: 3;
    padding-top: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
}

.pagination-left {
    width: 150px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 8px 0px 0px 8px;
    border: 1px solid #EAECF0;
    background: #FFF;
    display: flex;
    gap: 5px;
    align-items: center;
    justify-content: center;
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    color: #101828;
}

.pagination-right {
    display: flex;
    align-items: center;
}

.frost-footer .pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
    margin: 0 auto;
    /* Cancel DataTables/global .pagination-container { position: sticky; bottom: 0 } */
    position: relative !important;
    bottom: auto !important;
    margin-top: 0;
    padding-top: 0;
}

.frost-footer .pagination-left {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #EAECF0;
    border-radius: 8px 0 0 8px;
    height: 38px;
    box-sizing: border-box;
}

.frost-footer .pagination-cog {
    width: 18px;
    height: 18px;
    color: var(--frost-text-muted);
    cursor: pointer;
    flex-shrink: 0;
}

.frost-footer .entries-select-footer {
    border: none;
    background: transparent;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #101828;
    cursor: pointer;
    outline: none;
    padding: 0;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right center;
    padding-right: 16px;
}

.frost-footer .entries-label {
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    color: var(--frost-text-muted);
}

.frost-footer .pagination-right {
    display: flex;
    align-items: center;
    gap: 0;
    height: 38px;
    border: 1px solid #EAECF0;
    border-left: none;
    border-radius: 0 8px 8px 0;
    background: #fff;
    overflow: hidden;
}

.frost-footer .pagination-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 100%;
    background: #fff;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.frost-footer .pagination-nav-btn:hover:not(:disabled) {
    background: #F9FAFB;
}

.frost-footer .pagination-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.frost-footer .pagination-nav-btn.prev {
    border-right: 1px solid #EAECF0;
}

.frost-footer .pagination-nav-btn.next {
    border-left: 1px solid #EAECF0;
}

.frost-footer .pagination-current {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 100%;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #1D2939;
    background: #fff;
}

.frost-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #64748b;
}

.pagination-cog {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin-right: 4px;
}

.frost-pagination {
    display: flex;
    align-items: center;
    gap: 2px;
}

.frost-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--frost-text);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.frost-page-btn:hover:not(:disabled) { background: #e2e8f0; }
.frost-page-btn.active { background: var(--frost-primary); color: #fff; }
.frost-page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.frost-page-btn.arrow {
    padding: 0 6px;
    background: transparent;
}

.frost-page-btn.arrow:hover:not(:disabled) {
    background: #e2e8f0;
}

.frost-page-btn.arrow img,
.pagination-arrow {
    width: 18px;
    height: 18px;
}

/* ==================== CHECKBOX ==================== */
.frost-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--frost-primary);
}

/* ==================== SCROLLBAR ==================== */
.frost-scroll-wrapper::-webkit-scrollbar { width: 10px; height: 10px; }
.frost-scroll-wrapper::-webkit-scrollbar-track { background: #f1f5f9; }
.frost-scroll-wrapper::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 5px; }
.frost-scroll-wrapper::-webkit-scrollbar-thumb:hover { background: #64748b; }
.frost-scroll-wrapper::-webkit-scrollbar-corner { background: #f1f5f9; }

/* ==================== BADGES & STATUS ==================== */
.custom-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    border-radius: 0 !important;
    background-color: #E8F8FA;
    color: #00517B;
    font-size: 0.9rem;
    font-family: Poppins;
    gap: 0.5rem;
    white-space: nowrap;
    max-width: 100% !important;
    overflow: hidden;
    text-overflow: ellipsis;
}

.custom-badge .icon {
    width: 24px;
    height: 24px;
    border-radius: 50% !important;
    object-fit: cover;
    flex-shrink: 0;
}

.custom-badge .selected_supplier_text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Name badge for user/requestor - square corners */
.frost-table .name-badge,
.frost-container .name-badge {
    border-radius: 0 !important;
}

.frost-table .name-badge .icon,
.frost-container .name-badge .icon {
    border-radius: 0 !important;
}

.custom-badge-id {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px 4px 0;
    background: #f1f5f9;
    border-radius: 6px;
    font-weight: 500;
    color: var(--frost-text);
    max-width: 100%;
}
.frost-custom-badge-id {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px 4px 0;
    background: #f1f5f9;
    border-radius: 6px;
    font-weight: 500;
    color: var(--frost-text);
    max-width: 100%;
}

/* 🔑 Text truncation — follow the CURRENT column width, not a fixed px cap.
   The <td> carries the resize-driven width; max-width:100% lets the text use
   all of it and ellipsis the overflow, so resizing the column shows more/less. */
.workspace-text {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
    min-width: 0;
}

.custom-badge-id .badge-icon {
    width: 14px;
    height: 14px;
    opacity: 0.6;
}

/* Special ID badge colors */
.custom-badge-rfq-id {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: #dbeafe; /* Light blue */
    border-radius: 6px;
    font-weight: 500;
}

.custom-badge-rfq-id .badge-icon {
    width: 14px;
    height: 14px;
    opacity: 0.7;
}

.custom-badge-request-id {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: #dcfce7; /* Light green */
    border-radius: 6px;
    font-weight: 500;
    color: #166534; /* Dark green text */
}

.custom-badge-request-id .badge-icon {
    width: 14px;
    height: 14px;
    opacity: 0.7;
}

/* ── ID-badge text truncation — applies to EVERY frost table ───────────────
   The ID-style badges (id / rfq-id / request-id) render an icon + a BARE text
   node inside an inline-flex box. A flex container cannot ellipsis a bare text
   run, so when the column is too narrow the value hard-clips mid-character
   ("789, 7") instead of showing "…". Switch these badges to inline-block: the
   icon + text become normal inline content that truncates with an ellipsis at
   the CURRENT column width, and therefore reveals more as the column is resized
   wider (resize behavior itself is unchanged). The flex `gap` is replaced by an
   icon margin since inline-block has no `gap`. Other badges (.custom-badge,
   .status-badge, .name-badge) already ellipsis via an inner span, so they are
   intentionally left as-is. */
.frost-table .custom-badge-id,
.frost-table .frost-custom-badge-id,
.frost-table .custom-badge-rfq-id,
.frost-table .custom-badge-request-id,
.frost-container .custom-badge-id,
.frost-container .frost-custom-badge-id,
.frost-container .custom-badge-rfq-id,
.frost-container .custom-badge-request-id {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}
.frost-table .custom-badge-id > .badge-icon,
.frost-table .frost-custom-badge-id > .badge-icon,
.frost-table .custom-badge-rfq-id > .badge-icon,
.frost-table .custom-badge-request-id > .badge-icon,
.frost-container .custom-badge-id > .badge-icon,
.frost-container .frost-custom-badge-id > .badge-icon,
.frost-container .custom-badge-rfq-id > .badge-icon,
.frost-container .custom-badge-request-id > .badge-icon {
    display: inline-block;
    vertical-align: middle;
    margin-inline-end: 6px;
}
/* Inner text span (e.g. .status-text / .workspace-text / .frost-cell-text) must flow INLINE
   beside the icon — left as display:block it dropped onto its own line under the icon. The
   badge above owns the ellipsis, so neutralize the span's own block/width/overflow. */
.frost-table .custom-badge-id > span,
.frost-table .frost-custom-badge-id > span,
.frost-table .custom-badge-rfq-id > span,
.frost-table .custom-badge-request-id > span,
.frost-container .custom-badge-id > span,
.frost-container .frost-custom-badge-id > span,
.frost-container .custom-badge-rfq-id > span,
.frost-container .custom-badge-request-id > span {
    display: inline;
    vertical-align: middle;
    max-width: none;
    min-width: 0;
    overflow: visible;
}

/* ==================== MULTI-VALUE BADGE STACK (group rows) ====================
   Used by group rows on the E-Sourcing list (esourcing-table.blade.php) and the
   Requests list (requests-table.blade.php) Workspace/Requestor columns: a "G-"
   consolidated row can be formed from source requests spanning DIFFERENT
   workspaces/requestors, so instead of one (arbitrary) badge these columns show
   every DISTINCT value stacked in one cell. Reuses the existing .custom-badge-id /
   .custom-badge visual language (same icon, same colors) — never a new visual
   language — at a reduced font size, capped to ~2-3 rows tall with a vertical
   scrollbar for the rest so a group with many distinct values never blows out row
   height. No left/right — purely block-axis (flex column + vertical scroll), so it
   needs no RTL-specific handling. */
.frost-multi-badge-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    max-height: 58px; /* ≈ 2-3 stacked badge rows before scrolling */
    overflow-y: auto;
    overflow-x: hidden;
    max-width: 100%;
}
.frost-multi-badge-stack .custom-badge-id,
.frost-multi-badge-stack .custom-badge {
    font-size: 11px;
    padding-top: 2px;
    padding-bottom: 2px;
    max-width: 100%;
    flex-shrink: 0;
}
.frost-multi-badge-stack .custom-badge-id .badge-icon {
    width: 11px;
    height: 11px;
}
.frost-multi-badge-stack .custom-badge .icon {
    width: 16px;
    height: 16px;
}
.frost-multi-badge-stack::-webkit-scrollbar { width: 6px; }
.frost-multi-badge-stack::-webkit-scrollbar-track { background: transparent; }
.frost-multi-badge-stack::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.frost-multi-badge-stack::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 0px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
     max-width: 160px;          /* adjust as needed */
    overflow: hidden;
    text-overflow: ellipsis;
}
td .status-badge {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.status-text {
    max-width: 100%;        /* 🔑 adjust per column */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

.frost-frame[data-locale="ar"] .status-badge,
.frost-container[data-locale="ar"] .status-badge {
    font-size: 18px !important;
}

.frost-frame[data-locale="ar"] .status-text,
.frost-container[data-locale="ar"] .status-text {
    line-height: 1.25 !important;
}

.status-badge.drafted { background: #f1f5f9; color: #475569; }
.status-badge.pending { background: #fef3c7; color: #92400e; }
.status-badge.submitted { background: #dbeafe; color: #1d4ed8; }
.status-badge.accepted { background: #d1fae5; color: #059669; }
.status-badge.received { background: #dcfce7; color: #166534; }
.status-badge.partial { background: #e0f2fe; color: #0369a1; }
.status-badge.correction { background: #fef3c7; color: #b45309; }
.status-badge.rejected { background: #fee2e2; color: #dc2626; }
.status-badge.closed { background: #e2e8f0; color: #64748b; }
.status-badge.approved { background: #bbf7d0; color: #15803d; }
.status-badge.active { background: #d1fae5; color: #059669; }
.status-badge.completed { background: #dbeafe; color: #1d4ed8; }
.status-badge.neutral { background: #f8fafc; color: #64748b; }
.status-badge.responded { background:#E0F2FE; color:#075985; }
.status-badge.online { background: #dcfce7; color: #166534; }
.status-badge.offline { background: #f1f5f9; color: #475569; }

/* GRN / Order Status Badges */
.status-badge.order-drafted { background: #f1f5f9; color: #475569; }
.status-badge.order-pending-for-approval { background: #fef3c7; color: #92400e; }
.status-badge.approved-order { background: #bbf7d0; color: #15803d; }
.status-badge.order-submitted-to-vendor { background: #dbeafe; color: #1d4ed8; }
.status-badge.order-accepted-by-vendor { background: #d1fae5; color: #059669; }
.status-badge.order-received { background: #dcfce7; color: #166534; }
.status-badge.order-received-partially { background: #e0f2fe; color: #0369a1; }
.status-badge.order-send-for-correction,
.status-badge.order-return-for-correction { background: #fef3c7; color: #b45309; }
.status-badge.order-rejected,
.status-badge.order-rejected-by-vendor { background: #fee2e2; color: #dc2626; }
.status-badge.order-closed { background: #e2e8f0; color: #64748b; }

/* User Status Badges */
.status-badge.inactive,
.status-badge.deactivated { background: #fee2e2; color: #dc2626; }
.status-badge.deleted { background: #fef2f2; color: #991b1b; }

/* Request Status Badges */
.status-badge.drafted { background: #f1f5f9; color: #475569; }
.status-badge.pending-for-approval,
.status-badge.pending-approval { background: #fef3c7; color: #92400e; }
.status-badge.return-for-correction { background: #fed7aa; color: #c2410c; }
.status-badge.transformed-to-order { background: #d1fae5; color: #059669; }
.status-badge.submitted-request,
.status-badge.submitted { background: #dbeafe; color: #1d4ed8; }

/* Contract Lifecycle Phase Colors (Active, Expired, Closed) */
.status-badge.active { background: #d1fae5; color: #059669; }
.status-badge.expired { background: #fee2e2; color: #dc2626; }
.status-badge.closed { background: #e2e8f0; color: #64748b; }

/* Contract Status Badges (using hyphenated slugs) */
.status-badge.drafted { background: #f1f5f9; color: #475569; }
.status-badge.new-contract { background: #e0f2fe; color: #0284c7; }
.status-badge.pending-for-approval { background: #fef3c7; color: #92400e; }
.status-badge.approved { background: #bbf7d0; color: #15803d; }
.status-badge.submitted-to-vendor { background: #dbeafe; color: #1d4ed8; }
.status-badge.accepted-by-vendor { background: #d1fae5; color: #059669; }
.status-badge.rejected { background: #fee2e2; color: #dc2626; }
.status-badge.rejected-by-vendor { background: #fee2e2; color: #dc2626; }
.status-badge.send-for-correction { background: #fed7aa; color: #c2410c; }
.status-badge.request-for-correction-by-vendor { background: #fef3c7; color: #b45309; }
.status-badge.qtt-received { background: #dcfce7; color: #166534; }
.status-badge.qtt-received-partially { background: #e0f2fe; color: #0369a1; }
.status-badge.closed { background: #e2e8f0; color: #64748b; }

/* Legacy contract- prefixed classes */
.status-badge.contract-drafted { background: #f1f5f9; color: #475569; }
.status-badge.contract-pending { background: #fef3c7; color: #92400e; }
.status-badge.contract-approved { background: #d1fae5; color: #059669; }
.status-badge.contract-submitted { background: #dbeafe; color: #1d4ed8; }
.status-badge.contract-accepted { background: #d1fae5; color: #059669; }
.status-badge.contract-rejected { background: #fee2e2; color: #dc2626; }
.status-badge.contract-closed { background: #e2e8f0; color: #64748b; }

/* ==================== ACTION CELL & POPUP ==================== */
.action-cell {
    position: relative;
    text-align: center;
    overflow: visible !important;
    z-index: 100;
    pointer-events: auto; /* Ensure it's clickable */
}

.action-cell:hover,
.action-cell:focus-within,
/* Keep the cell elevated while its popup is open, even after the cursor leaves —
   otherwise the cell falls back to its base z-index and the open flyout is painted
   behind the next (frozen) column. */
.action-cell:has(.action-popup.open) {
    z-index: 9998;
}

.action-icon {
    cursor: pointer;
    width: 20px;
    height: 20px;
    opacity: 0.6;
    pointer-events: auto; /* Ensure it's clickable */
    position: relative; /* Ensure it's positioned correctly */
    z-index: 1; /* Ensure it's above other elements */
}

.action-icon:hover {
    opacity: 1;
}

.frost-table .action-popup,
.frost-container .action-popup,
.action-cell .action-popup {
    display: none !important;
    position: absolute !important;
    top: 50% !important;
    left: 100% !important;
    transform: translate(5%, -50%) !important;
    background: #fff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
    padding: 8px !important;
    z-index: 888 !important;
    white-space: nowrap !important;
    gap: 4px !important;
    flex-direction: row !important;
    align-items: center !important;
}

/* Higher specificity to override base rule when open */
.frost-table .action-popup.open,
.frost-container .action-popup.open,
.action-cell .action-popup.open,
.frost-table td.action-cell .action-popup.open,
.frost-container td.action-cell .action-popup.open,
#table-supplier .action-popup.open,
#table-supplier-container .action-popup.open,
#table-supplier td.action-cell .action-popup.open,
.tab-pane .action-popup.open,
.tab-content .action-popup.open {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: fixed !important; /* Allow fixed positioning when open */
    z-index: 999999 !important; /* Ensure it's above everything */
}

/* Ensure tab containers don't clip the popup (only for tabs with frost tables) */
#active .frost-table,
#active #table-supplier,
.tab-pane #table-supplier-container {
    position: relative;
}

/* Ensure popup can escape tab container */
#table-supplier-container {
    overflow: visible !important;
}

/* Ensure action cell in table-supplier is clickable */
#table-supplier .action-cell,
#table-supplier-container .action-cell {
    pointer-events: auto !important;
    cursor: pointer !important;
}

#table-supplier .action-icon,
#table-supplier-container .action-icon {
    pointer-events: auto !important;
    cursor: pointer !important;
}

.action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: transparent !important;
    cursor: pointer;
}

.action-button:hover { background: #e2e8f0 !important; }
.action-button img { width: 16px; height: 16px; }

/* Ensure action cell doesn't affect row height */
.frost-table tbody tr td.action-cell {
    padding: 5px 8px;
}

/* ==================== LINKS ==================== */
.frost-table td a {
    color: inherit;
    text-decoration: none;
}

/* ==================== AMOUNT ==================== */
.amount-cell {
    font-weight: 400;
    color: #059669;
}

/* ==================== CLICKABLE TD ==================== */
.clickable-td {
    cursor: pointer;
}

/* ==================== PRINT STYLES ==================== */
@media print {
    body * {
        visibility: hidden;
    }

    .frost-container,
    .frost-container * {
        visibility: visible;
    }

    .frost-container {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }

    .frost-action-bar,
    .frost-footer,
    .action-cell,
    .frost-filter-row,
    .action-popup,
    #columnDropdown {
        display: none !important;
    }

    .frost-scroll-wrapper {
        max-height: none !important;
        overflow: visible !important;
    }

    .frost-table tbody tr {
        display: table-row !important;
    }

    .frost-table {
        width: 100% !important;
        min-width: unset !important;
        font-size: 10px;
    }

    .frost-table th,
    .frost-table td {
        padding: 6px 8px !important;
        border: 1px solid #ddd !important;
    }
}

/* ==================== HIDE DATATABLE DEFAULTS ==================== */
.dt-buttons,
.dt-button-hidden {
    display: none !important;
}

/* ==================== FLATPICKR CUSTOMIZATIONS ==================== */
.flatpickr-calendar {
    font-family: 'Poppins', sans-serif;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    border: 1px solid #e2e8f0;
}

.flatpickr-months {
    background: #f8fafc;
    border-radius: 8px 8px 0 0;
}

.flatpickr-current-month {
    font-weight: 600;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
    background: var(--frost-primary) !important;
    border-color: var(--frost-primary) !important;
}

.flatpickr-day.inRange {
    background: #e0f2fe !important;
    border-color: #e0f2fe !important;
    box-shadow: -5px 0 0 #e0f2fe, 5px 0 0 #e0f2fe;
}

.flatpickr-day:hover {
    background: #f1f5f9;
}

.flatpickr-day.today {
    border-color: var(--frost-accent);
}

/* ==================== E-SOURCING / ESOURCE STATUS BADGES ==================== */
/* Uses Str::slug($status) => e.g. "pending-for-approval" */

.status-badge.updated-from-order-module,
.status-badge.created-from-order-module,
.status-badge.created-from-contract-module {
    background: #e2e8f0;
    color: #475569;
}

.status-badge.drafted,
.status-badge.draft {
    background: #f1f5f9;
    color: #475569;
}

.status-badge.pending,
.status-badge.pending-for-approval,
.status-badge.pending-approval {
    background: #fef3c7;
    color: #92400e;
}

.status-badge.return-for-correction,
.status-badge.send-for-correction {
    background: #fed7aa;
    color: #c2410c;
}

.status-badge.submitted,
.status-badge.submitted-to-vendor,
.status-badge.submitted-request {
    background: #dbeafe;
    color: #1d4ed8;
}

.status-badge.approved,
.status-badge.approved-by-approver {
    background: #bbf7d0;
    color: #15803d;
}

.status-badge.accepted,
.status-badge.accepted-by-vendor {
    background: #d1fae5;
    color: #059669;
}

.status-badge.rejected,
.status-badge.rejected-by-vendor {
    background: #fee2e2;
    color: #dc2626;
}

.status-badge.closed,
.status-badge.completed,
.status-badge.finished {
    background: #e2e8f0;
    color: #64748b;
}

.status-badge.cancelled,
.status-badge.canceled {
    background: #fef2f2;
    color: #991b1b;
}

.status-badge.under-evaluation {
    background: #ede9fe;
    color: #6d28d9;
}

.status-badge.evaluation-completed {
    background: #d1fae5;
    color: #047857;
}

/* ==================== BILL STATUS BADGES ==================== */

/* Pending */
.status-badge.pending-bill {
    background: #fef3c7;   /* amber */
    color: #92400e;
}

/* Draft */
.status-badge.bill-drafted {
    background: #f1f5f9;   /* gray */
    color: #475569;
}

/* Submitted to vendor */
.status-badge.bill-submitted-to-vendor {
    background: #dbeafe;   /* blue */
    color: #1d4ed8;
}

/* Accepted by vendor */
.status-badge.bill-accepted-by-vendor {
    background: #d1fae5;   /* green */
    color: #059669;
}

/* Accepted (internal) */
.status-badge.bill-accepted {
    background: #bbf7d0;   /* strong green */
    color: #15803d;
}

/* Rejected */
.status-badge.bill-rejected {
    background: #fee2e2;   /* red */
    color: #dc2626;
}

/* Return for correction */
.status-badge.bill-return-for-correction {
    background: #fed7aa;   /* orange */
    color: #c2410c;
}

/* Reminder mail sent */
.status-badge.reminder-mail-to-approve-bill {
    background: #e0f2fe;   /* light blue */
    color: #0369a1;
}

/* Approved bill */
.status-badge.approved-bill {
    background: #bbf7d0;
    color: #15803d;
}

/* Partially paid */
.status-badge.bill-partially-paid {
    background: #e0f2fe;
    color: #0369a1;
}

/* Paid */
.status-badge.bill-paid {
    background: #dcfce7;
    color: #166534;
}

/* Not paid */
.status-badge.bill-not-paid {
    background: #fee2e2;
    color: #991b1b;
}

/* Deleted */
.status-badge.deleted-bill {
    background: #fef2f2;
    color: #7f1d1d;
    text-decoration: line-through;
}
.nav-tabs .nav-item .nav-link.active{
    width:auto !important;
}
.nav-tabs .nav-item .nav-link{
    width:auto !important;
}
/* ==================== CREDIT NOTE STATUS BADGES ==================== */

/* Draft */
.status-badge.credit-note-drafted {
    background: #f1f5f9;   /* gray */
    color: #475569;
}

/* Pending */
.status-badge.credit-note-pending {
    background: #fef3c7;   /* amber */
    color: #92400e;
}

/* Issued */
.status-badge.credit-note-issued {
    background: #dbeafe;   /* blue */
    color: #1d4ed8;
}

/* Applied / Used */
.status-badge.credit-note-applied {
    background: #dcfce7;   /* green */
    color: #166534;
}

/* Partially applied */
.status-badge.credit-note-partially-applied {
    background: #e0f2fe;   /* light blue */
    color: #0369a1;
}

/* Closed */
.status-badge.credit-note-closed {
    background: #e2e8f0;
    color: #64748b;
}

/* Cancelled */
.status-badge.credit-note-cancelled {
    background: #fef2f2;
    color: #991b1b;
}
/* ==================== PAYMENT STATUS BADGES ==================== */

/* Draft / Created */
.status-badge.payment-drafted,
.status-badge.payment-created {
    background: #f1f5f9;   /* gray */
    color: #475569;
}

/* Pending / Waiting approval */
.status-badge.payment-pending,
.status-badge.pending-payment,
.status-badge.waiting-payment {
    background: #fef3c7;   /* amber */
    color: #92400e;
}

/* Submitted */
.status-badge.payment-submitted {
    background: #dbeafe;   /* blue */
    color: #1d4ed8;
}

/* Approved */
.status-badge.payment-approved {
    background: #bbf7d0;   /* green */
    color: #15803d;
}

/* Partially paid */
.status-badge.payment-partially-paid {
    background: #e0f2fe;   /* light blue */
    color: #0369a1;
}

/* Paid */
.status-badge.payment-paid {
    background: #dcfce7;   /* strong green */
    color: #166534;
}

/* Rejected */
.status-badge.payment-rejected {
    background: #fee2e2;   /* red */
    color: #dc2626;
}

/* Cancelled */
.status-badge.payment-cancelled,
.status-badge.payment-canceled {
    background: #fef2f2;
    color: #991b1b;
}
/* Credit Note – Submitted To Vendor */
.status-badge.credit-note-submitted-to-vendor {
    background: #dcfce7;
    color: #166534;
}
/* ==================== PAYMENT METHOD BADGES ==================== */
.payment-method-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Inside a data cell, track the CURRENT column width instead of the 140px cap
   (mirrors the td .status-badge rule) so resizing shows more/less of the label. */
td .payment-method-badge {
    max-width: 100%;
}


/* Cash */
.payment-method-cash {
    background: #dcfce7;   /* light green */
    color: #166534;
}

/* Bank Transfer */
.payment-method-bank-transfer {
    background: #e0f2fe;   /* light blue */
    color: #075985;
}

/* Check / Cheque */
.payment-method-check {
    background: #fef3c7;   /* amber */
    color: #92400e;
}

/* Fallback / unknown */
.payment-method-unknown {
    background: #f1f5f9;
    color: #475569;
}
/* ==================== PAYMENT TYPE BADGES ==================== */
.payment-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    margin-right: 4px;
    margin-bottom: 2px;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Inside a data cell, track the CURRENT column width instead of the 160px cap. */
td .payment-type-badge {
    max-width: 100%;
}

/* Bill */
.payment-type-bill {
    background: #e0f2fe;   /* light blue */
    color: #0369a1;
}

/* Standalone Bill */
.payment-type-standalone-bill {
    background: #dbeafe;
    color: #1d4ed8;
}

/* Grouped Bill */
.payment-type-grouped-bill {
    background: #ede9fe;
    color: #5b21b6;
}

/* Preforma Bill */
.payment-type-preforma-bill {
    background: #fef3c7;   /* amber */
    color: #92400e;
}

/* Credit Note */
.payment-type-credit-note {
    background: #ecfeff;   /* very light cyan */
    color: #0f766e;        /* teal text */
}


/* Mixed / fallback */
.payment-type-mixed {
    background: #f1f5f9;
    color: #475569;
}

/* ==================== INVITE TYPE BADGES ==================== */
.invite-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    background: #dcfce7;
    color: #166534;
}
.invite-type-badge + .invite-type-badge {
    margin-left: 6px;
}

/* ==================== DEFAULT DATE FILTER TOOLTIP ==================== */
.frost-default-date-tooltip {
    position: fixed;
    background: #f8fafc;              /* slate-50 */
    color: #0f172a;                   /* slate-900 */
    padding: 8px 12px;
    font-size: 12px;
    line-height: 1.45;
    border-radius: 6px;
    max-width: 260px;
    white-space: normal;
    box-shadow: 0 6px 18px rgba(15,23,42,0.12);
    border: 1px solid #e2e8f0;        /* slate-200 */
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 10050;
    pointer-events: none;
}

.frost-default-date-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px 6px 0;
    border-style: solid;
    border-color: #f8fafc transparent transparent;
}

/* Visible state */
.frost-default-date-tooltip.show {
    opacity: 1;
    transform: translateY(0);
}
/* ===================== DELETED ROW ===================== */
.frost-table tbody tr.row-deleted td {
    background-color: #fef3f2 !important; /* soft red */
    color: #991b1b !important;
    font-weight: 500;
}

/* Keep hover consistent */
.frost-table tbody tr.row-deleted:hover td {
    background-color: #fee2e2 !important;
}

/* Make icons readable */
.frost-table tbody tr.row-deleted img {
    opacity: 0.85;
}

/* Optional: action cell still clickable */
.frost-table tbody tr.row-deleted .action-cell {
    cursor: pointer;
}

/* =========================================================
   FROST TABLE – DELETED ROW (GLOBAL RED THEME)
   ========================================================= */

/*  Base row background (ALL TDs, including frozen ones) */
#table-workspaces.frost-table tbody tr.deleted-row > td {
    background-color: #fef2f2 !important;   /* soft red */
    color: #991b1b !important;
    border-color: #fecaca !important;
}

/*  Hover state (must stay red) */
#table-workspaces.frost-table tbody tr.deleted-row:hover > td {
    background-color: #fee2e2 !important;
}

/*  Override Frost CSS variables (critical for sticky/frozen cols) */
#table-workspaces.frost-table tbody tr.deleted-row {
    --frost-row-bg: #fef2f2;
    --frost-row-alt: #fef2f2;
    --frost-row-hover: #fee2e2;
}

/*  Title / main text emphasis */
#table-workspaces.frost-table tbody tr.deleted-row td {
    font-weight: 500;
}

/* Deleted title cell (the one with "(Supprimé)") */
#table-workspaces.frost-table tbody tr.deleted-row .td-deleted {
    color: #b91c1c !important;
    font-weight: 600;
}

/*Status badge: Deleted */
#table-workspaces.frost-table tbody tr.deleted-row .status-badge,
#table-workspaces.frost-table tbody tr.deleted-row .status-badge.deleted {
    background-color: #fee2e2 !important;
    color: #991b1b !important;
    border: 1px solid #fecaca;
}

/* ID badge inside deleted row */
#table-workspaces.frost-table tbody tr.deleted-row .custom-badge-id {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Action cell icon tone */
#table-workspaces.frost-table tbody tr.deleted-row .action-icon {
    opacity: 0.6;
}
/* ==================== SUPPLIER QUALIFICATION STATUS BADGES ==================== */

/* Qualified */
.status-badge.qualified {
    background: #dcfce7;   /* green-100 */
    color: #166534;        /* green-800 */
}

/* Temporarily Qualified */
.status-badge.temporarily-qualified {
    background: #fef3c7;   /* amber-100 */
    color: #92400e;        /* amber-800 */
}

/* Not Qualified */
.status-badge.not-qualified {
    background: #fee2e2;   /* red-100 */
    color: #991b1b;        /* red-800 */
}

/* Blocked */
.status-badge.blocked {
    background: #f1f5f9;   /* slate-100 */
    color: #475569;        /* slate-700 */
}
.frost-filter-select2,
.status-filter-select,
.workspace-filter-select {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.frost-filter-row select.frost-filter-select2 {
    appearance: none;
    -webkit-appearance: none;
    display: none !important;
}

.frost-filter-row select.frost-filter-select2:has(+ .frost-ms) {
    display: none !important;
}

.frost-filter-row select.frost-native-select-bound {
    display: none !important;
}

/* ── Frost Multi-Select (frost-ms) ────────────────────────────────── */
.frost-ms {
    position: relative;
    width: 100%;
    box-sizing: border-box;
    font-size: 12px;
}

/* Trigger bar */
.frost-ms-trigger {
    display: flex;
    align-items: center;
    height: 32px;
    min-height: 32px;
    max-height: 32px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    padding: 0 26px 0 4px;
    cursor: pointer;
    position: relative;
    box-sizing: border-box;
    overflow: hidden;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.frost-ms.is-open .frost-ms-trigger {
    border-color: #00517b;
    box-shadow: 0 0 0 2px rgba(0, 81, 123, 0.12);
}

/* Arrow */
.frost-ms-arrow {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0; height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #6b7280;
    pointer-events: none;
    transition: transform 0.15s;
}
.frost-ms.is-open .frost-ms-arrow {
    border-top: none;
    border-bottom: 5px solid #00517b;
    top: calc(50% - 2px);
}

/* Tags container */
.frost-ms-tags {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 3px;
    overflow: hidden;
    flex: 1;
    min-width: 0;
    height: 30px;
}
.frost-ms-placeholder {
    color: #9ca3af;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Tag pill */
.frost-ms-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    padding: 1px 5px 1px 7px;
    flex-shrink: 0;
    max-width: 110px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 18px;
    height: 20px;
}
.frost-ms-tag-text {
    overflow: hidden;
    text-overflow: ellipsis;
}
.frost-ms-tag-remove {
    color: #93c5fd;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
}
.frost-ms-tag-remove:hover {
    color: #1d4ed8;
}

/* Overflow badge */
.frost-ms-overflow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #dbeafe;
    color: #1d4ed8;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    height: 18px;
    flex-shrink: 0;
    white-space: nowrap;
}

/* ── Dropdown panel ──────────────────────────────────────────────── */
.frost-ms-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    z-index: 10060;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    background: #fff;
    overflow: hidden;
    font-size: 12px;
}
.frost-ms.is-open .frost-ms-dropdown {
    display: block;
}

/* Search box */
.frost-ms-search-wrap {
    padding: 8px 8px 6px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}
.frost-ms-search {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    padding: 5px 8px 5px 26px;
    font-size: 12px;
    outline: none;
    box-sizing: border-box;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") no-repeat 6px center;
    transition: border-color 0.15s;
}
.frost-ms-search:focus {
    border-color: #00517b;
    box-shadow: 0 0 0 2px rgba(0,81,123,0.10);
}
.frost-ms-search::placeholder {
    color: #9ca3af;
    font-style: italic;
}

/* Options list */
.frost-ms-options {
    max-height: 220px;
    overflow-y: auto;
    padding: 4px 0;
}

/* Single option row */
.frost-ms-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    cursor: pointer;
    color: #374151;
    transition: background 0.1s;
    margin: 0;
    font-weight: 400;
}
.frost-ms-option:hover {
    background: #eff6ff;
    color: #1d4ed8;
}

/* Checkbox inside option */
.frost-ms-option input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border: 1.5px solid #d1d5db;
    border-radius: 3px;
    background: #fff;
    flex-shrink: 0;
    cursor: pointer;
    position: relative;
    transition: all 0.1s;
    margin: 0;
}
.frost-ms-option:hover input[type="checkbox"] {
    border-color: #93c5fd;
}
.frost-ms-option input[type="checkbox"]:checked {
    background: #1d4ed8;
    border-color: #1d4ed8;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6l3 3 5-5' stroke='%23fff' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-size: 10px;
    background-repeat: no-repeat;
    background-position: center;
}
.frost-ms-option input[type="checkbox"]:checked + span {
    color: #1d4ed8;
    font-weight: 600;
}
.frost-ms-option input[type="checkbox"]:indeterminate {
    background: #1d4ed8;
    border-color: #1d4ed8;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6h8' stroke='%23fff' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-size: 10px;
    background-repeat: no-repeat;
    background-position: center;
}
.frost-ms-option input[type="checkbox"]:indeterminate + span {
    color: #1d4ed8;
    font-weight: 600;
}

/* "All" select-all/deselect-all row — sits between the search box and the individual options.
   Scope is the currently visible (search-filtered) options; see frost-table.js updateSelectAllState(). */
.frost-ms-select-all-wrap {
    border-bottom: 1px solid #e2e8f0;
    padding: 2px 0;
}
.frost-ms-option.frost-ms-select-all {
    font-weight: 600;
}
.frost-ms-option.frost-ms-select-all input[type="checkbox"]:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.custom-badge-id.badge-request-id {
    cursor: pointer;
}

.custom-badge-id.badge-request-id:hover {
    background-color: #E0E7FF;
}
.custom-badge-id.badge-request-id {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    padding: 4px 10px;
    border-radius: 6px;

    background-color: #EEF2FF;
    color: #1E1B4B;

    font-size: 13px;
    font-weight: 600;
    line-height: 1;

    border: 1px solid #E0E7FF;
    white-space: nowrap;
}

.custom-badge-id.badge-request-id .badge-icon {
    width: 14px;
    height: 14px;
    opacity: 0.6;
}

/*
 * The box is 60x40 (1.5:1) but product thumbnails are normalized to a 4:3
 * (1.333:1) canvas. Without object-fit the default is `fill`, which genuinely
 * STRETCHES the bitmap (+12.5% horizontal stretch at 4:3 - the opposite
 * direction from the 40x40 boxes in dataTable-global.css, but the same bug).
 * `contain` letterboxes inside the same box instead - an admin thumbnail is an
 * identification aid, so cropping (`cover`) is not acceptable here.
 * Box dimensions are deliberately unchanged: they are load-bearing for admin
 * table row heights across ~20 blades.
 *
 * NOTE: ~73 blades load BOTH this file and dataTable-global.css, which sizes
 * this same class 40x40. Which box wins there is decided by <link> order and is
 * a pre-existing inconsistency, NOT something object-fit changes: `contain` is
 * correct for either box, so the fix holds whichever one applies.
 */
.product-table-image{
width: 60px;
height: 40px;
flex-shrink: 0;
object-fit: contain;
object-position: center;
}
.total-action{
    font-weight: 600;
}
.pagination-numbers {
    display: flex;
    align-items: center;
    gap: 6px;
}

.page-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border-radius: 6px;
    border: none;
    background: #fff;
    color: #344054;
    font-weight: 500;
    cursor: pointer;
}

.page-btn:hover:not(.active) {
    background: #f2f4f7;
}

.page-btn.active {
    background: #0369a1;
    color: #fff;
    border-color: #0369a1;
}

.page-dots {
    padding: 0 6px;
    color: #98a2b3;
    font-weight: 600;
}
.status-badge.sourcing-completed {
    background-color: #e6f9f0;
    color: #027a48;
}

/* ◐ Partial Accepted */
.status-badge.transformed-to-order {
    background-color: #d1fadf;
    color: #039855;
}
/* ◐ dashboard module tables */
/* TABLE HEADERS */
.module-dashboard
.frost-table thead tr.frost-sort-row th {
    background-color: #1B4965 !important;
    color: white !important;
}

/* SORT ICON */
.module-dashboard
.frost-table th .table-sort-icon {
    filter: brightness(0) invert(1);
}

/* COLUMN TOGGLE BUTTON */
.module-dashboard
[id$="-columnToggleBtn"] {
    background-color: #1B4965 !important;
    color: white !important;
}

/* ACTION BAR */
.module-dashboard
.frost-action-bar {
    background-color: #F4F7FA !important;
}
/* =========================
   MODULE SCOPED SCROLLBAR
   ========================= */

/* Firefox */
.module-dashboard .frost-scroll-wrapper {
    scrollbar-width: thin;
    scrollbar-color: #1B4965 #F4F7FA;
}

/* Chrome / Edge / Safari */
.module-dashboard .frost-scroll-wrapper::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.module-dashboard .frost-scroll-wrapper::-webkit-scrollbar-track {
    background-color: #F4F7FA;
}

.module-dashboard .frost-scroll-wrapper::-webkit-scrollbar-thumb {
    background-color: #1B4965;
    border-radius: 8px;
}

.module-dashboard .frost-scroll-wrapper::-webkit-scrollbar-thumb:hover {
    background-color: #163A52;
}

/* RFQ completed */
.status-badge.rfq-completed {
    background-color: #e0f2fe;   /* light blue */
    color: #075985;              /* blue-800 */
}

/* Processed */
.status-badge.processed {
    background-color: #ede9fe;   /* violet-100 */
    color: #5b21b6;              /* violet-800 */
}
.status-badge.processing {
    background-color: #fef3c7;   /* amber */
    color: #92400e;
}
/* Transformed to contract */
.status-badge.transformed-to-contract {
    background-color: #e0f2fe;   /* light blue */
    color: #075985;              /* blue-800 */
}
/* Simple Frost tables (single header row) */
.frost-container .frost-table.simple thead th,
.frost-container.simple .frost-table thead th {
    top: 0 !important;
}
/* ===============================
   SIMPLE FROST TABLE HEADER STYLE
   =============================== */

.frost-table.simple thead th {
    background: #00517B !important;
    color: #ffffff !important;
    text-align: center !important;
}
.frost-table.simple tbody td{
    text-align: center !important;
}
/* Frozen header columns */
.frost-table.simple thead th[style*="position: sticky"] {
    background: #00517B !important;

}
.frost-table.simple thead th[data-sort="budget"],
.frost-table.simple thead th[data-sort="expense"] {
    background-color: rgb(3, 161, 170) !important;
}

/* Sort icons */
.frost-table.simple thead th .table-sort-icon,
.frost-table.simple thead th .table-sort-icon::before,
.frost-table.simple thead th .table-sort-icon::after {
 filter: brightness(0) invert(1);
}
/* STRONG override — simple tables only */
.frost-container .frost-table.simple thead tr.frost-sort-row th {
    border-bottom: 1px solid #ffffff !important;
    border-top: none !important;
    border-left: none !important;
    font-size: 12px;
    font-weight: 600;
    white-space: normal !important;
    line-height: 1.2;
}

/* Sticky (frozen) header columns */
.frost-container .frost-table.simple thead tr.frost-sort-row th[style*="position: sticky"] {
    background-color: #00517B !important;
}

/* Remove right border on last frozen column */
.frost-container .frost-table.simple thead tr.frost-sort-row th[style*="box-shadow"] {
    border-right: none !important;
}

.frost-input {
    width: 100%;
    border: none;
    border-bottom: 1px solid #d0d5dd;
    background: transparent;
    text-align: center;
}

.frost-input:focus {
    outline: none;
    border-bottom-color: #667085;
}

.frost-select {
    width: 70px;
    height: 28px;
}
.price-error,
.qty-error {
    color: #dc3545;
    font-size: 11px;
    margin-top: 4px;
}
/* Header main text */
.frost-header-main {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
}

/* SAR line */
.frost-header-sub {
    font-size: 13px;
    color: #70d7dc;
    margin-top: 2px;
}
/* ===============================
   Export button loading spinner
   =============================== */

.frost-action-btn.export-disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.frost-action-btn.export-active {
  pointer-events: none;
}

.export-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(0, 0, 0, 0.25);   /* gray ring */
  border-top-color: #6b7280;
  border-radius: 50%;
  animation: export-spin 0.8s linear infinite;
  display: inline-block;
  vertical-align: middle;
  margin-right: 6px;
}
@keyframes export-spin {
  to {
    transform: rotate(360deg);
  }
}
.frost-container.is-simple {
  margin-bottom: 2rem;
}

/* Base header layer */
.frost-container .frost-table.simple thead {
  position: sticky !important;
  top: 0 !important;
  z-index: 1000 !important;
  isolation: isolate;
}

/* Normal (non-frozen) header cells */
.frost-container .frost-table.simple thead th {
  z-index: 1001;
}

/* 🔑 Frozen HEADER cells (left columns) */
.frost-container .frost-table.simple thead th[style*="left"] {
  z-index: 1100 !important;
}

/* Frozen BODY cells must stay under header */
.frost-container .frost-table.simple tbody td[style*="left"] {
  z-index: 500 !important;
}
.frost-table.simple thead th.th-budget,
.frost-table.simple thead th.th-expense {
    background: #03A1AA !important;
}
.approve-badge {
    background-color: #fff1eb;
    color: #9a3412;
    border: 1px solid #fed7aa;
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.approve-badge::before {
    background-color: #fb923c;
}

/* Document link columns (GRN, Bill, Pending Bill, etc.) */
.frost-table .document-link-cell {
    font-size: 13px;
    white-space: nowrap;
}
.frost-table .frost-doc-link {
    color: #00517B;
    font-weight: 500;
    text-decoration: none;
}
.frost-table .frost-doc-link:hover {
    text-decoration: underline;
    color: #003d5c;
}

/* ==================== COLUMN RESIZE HANDLES ==================== */

.frost-sort-row th {
    position: relative;
}

.frost-resize-handle {
    position: absolute;
    top: 0;
    right: -4px;
    bottom: 0;
    width: 9px;
    cursor: col-resize;
    z-index: 130;
    user-select: none;
    touch-action: none;
}

/* ==================== COLUMN DRAG-TO-REORDER (opt-in tables) ==================== */
.frost-table .frost-sort-row th.frost-col-draggable { cursor: grab; }
.frost-table .frost-sort-row th.frost-col-draggable:active { cursor: grabbing; }
.frost-table .frost-sort-row th.frost-col-dragging { opacity: 0.45; }
/* Drop-target indicator: a cyan bar on the left edge of the column being dropped onto. */
.frost-table .frost-sort-row th.frost-col-drop-target { box-shadow: inset 3px 0 0 0 #0ea5e9 !important; }

/* Main vertical bar */
.frost-resize-handle::before {
    content: '';
    position: absolute;
    top: 25%;
    bottom: 25%;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    border-radius: 2px;
    background: #b0b8c4;
    opacity: 0.5;
    transition: opacity 0.2s ease, background 0.2s ease, width 0.2s ease, top 0.15s ease, bottom 0.15s ease;
}

/* Grip dots — 3 small dots inside the bar */
.frost-resize-handle::after {
    content: '⋮';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10px;
    line-height: 1;
    color: #667085;
    opacity: 0;
    transition: opacity 0.2s ease, color 0.2s ease;
    pointer-events: none;
}

/* Hover state — make the bar prominent */
.frost-resize-handle:hover::before {
    background: #0ea5e9;
    opacity: 1;
    width: 3px;
    top: 10%;
    bottom: 10%;
}

.frost-resize-handle:hover::after {
    opacity: 1;
    color: #fff;
}

/* Active (dragging) state */
.frost-resize-handle.active::before {
    background: #0284c7;
    opacity: 1;
    width: 3px;
    top: 0;
    bottom: 0;
}

.frost-resize-handle.active::after {
    opacity: 1;
    color: #fff;
}

body.frost-col-resizing {
    cursor: col-resize !important;
    user-select: none !important;
    -webkit-user-select: none !important;
}

body.frost-col-resizing * {
    cursor: col-resize !important;
    user-select: none !important;
    -webkit-user-select: none !important;
}

.frost-reset-widths-btn {
    display: block;
    width: calc(100% - 16px);
    margin: 6px 8px;
    padding: 7px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #f8fafc;
    color: #64748b;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s ease;
}

.frost-reset-widths-btn:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
}

@media print {
    .frost-resize-handle {
        display: none !important;
    }
}
