@layer infine.components {
/* Grid view tip line — sits between the sticky toolbar and the grid.
   No background or border: the toolbar above already provides the framed
   surface, so the tip just rides as a thin info line.
   Layout: [kbd-icon] tip text [All shortcuts]   [Export] [Import] */
.connect-grid-tip {
    display: flex;
    align-items: center;
    gap: var(--mantine-spacing-sm);
    padding: 6px 0;
    margin: 0 0 var(--mantine-spacing-xs);
    color: var(--infine-blue);
    font-size: var(--mantine-font-size-sm);
}

.connect-grid-tip-actions {
    display: flex;
    align-items: center;
    gap: var(--mantine-spacing-sm);
    margin-left: auto;
}

.connect-grid-tip kbd,
.connect-grid-shortcuts kbd {
    background: white;
    border: 1px solid var(--mantine-color-gray-3);
    border-radius: 3px;
    padding: 1px 5px;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 11px;
    color: var(--infine-blue);
}

.connect-grid-tip-shortcuts {
    background: transparent;
    border: 0;
    color: var(--infine-blue-bright);
    font-weight: 600;
    font-size: var(--mantine-font-size-sm);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 3px;
    white-space: nowrap;
}

.connect-grid-tip-shortcuts:hover {
    background-color: white;
    text-decoration: underline;
}

/* Grid view toolbar — rendered inside the shared #sticky-bar-inner panel,
   so vertical padding is light. Two row modifiers:
   --filters: search + Status: + status pills + product counter (filter icon at start)
   --columns: column-group toggle pills (columns-3 icon at start) */
.connect-grid-toolbar {
    display: flex;
    align-items: center;
    gap: var(--mantine-spacing-lg);
    flex-wrap: wrap;
    padding: 4px 8px;
}

.connect-grid-toolbar--columns {
    border-top: 1px dashed var(--infine-blue-light-fade);
}

/* Tight pill clusters within the toolbar — outer toolbar uses lg gap so the
   leading icon has the same breathing room as on the filters row, while the
   pills themselves remain tightly packed. */
.connect-grid-toolbar .status-chip-row,
.connect-grid-toolbar .column-chip-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.connect-grid-product-count {
    font-family: Raleway;
    margin-left: auto;
    line-height: 24px;
}

.connect-grid-product-count .count {
    font-weight: 700;
    font-size: 22px;
}

.connect-grid-product-count .label {
    font-weight: 700;
    font-size: 10px;
    text-transform: uppercase;
}

/* Column-group toggle pill — shape mirrors .connect-grid-status-chip but with
   no leading dot and no per-status colour vars; just plain on/off. */
.connect-grid-column-chip {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 14px;
    background: white;
    border: 1px solid var(--mantine-color-gray-3);
    color: var(--mantine-color-gray-7);
    font-size: var(--mantine-font-size-xs);
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.connect-grid-column-chip:hover {
    background: var(--infine-blue-bg);
    color: var(--infine-blue);
    border-color: var(--infine-blue);
}

/* Active state must beat :hover specificity (class+pseudo > class), so the
   active rule is doubled with :hover to keep the active visualization once
   the user has clicked — no flicker back to the hover style. */
.connect-grid-column-chip--active,
.connect-grid-column-chip--active:hover {
    background: var(--infine-blue);
    color: white;
    border-color: var(--infine-blue);
}

/* Coloured status chips — driven by inline --chip-color / --chip-bg vars from JS */
.connect-grid-status-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 14px;
    background: white;
    border: 1px solid var(--mantine-color-gray-3);
    color: var(--mantine-color-gray-7);
    font-size: var(--mantine-font-size-xs);
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.connect-grid-status-chip .dot {
    width: 8px; height: 8px; border-radius: 4px;
    background-color: var(--chip-color);
    flex-shrink: 0;
}

.connect-grid-status-chip:hover {
    color: var(--chip-color);
    border-color: var(--chip-color);
}

/* Active state must beat :hover specificity (class+pseudo > class), so the
   active rule is doubled with :hover to keep the active visualization once
   the user has clicked — no flicker back to the hover style. */
.connect-grid-status-chip--active,
.connect-grid-status-chip--active:hover {
    background: var(--chip-bg);
    color: var(--chip-color);
    border-color: var(--chip-color);
}

/* Filter dropdown — chip-shaped trigger that opens a checklist popover.
   Reclaims horizontal space when the option list is long (e.g. 11+ supplier
   categories). Visually matches `.connect-grid-status-chip` but carries an
   inline label + selected value + caret. */
.connect-filter-dropdown {
    gap: 4px;
    padding-right: 6px;
}

.connect-filter-dropdown__label {
    color: var(--mantine-color-gray-6);
    font-weight: 500;
}

.connect-filter-dropdown__value {
    color: var(--infine-blue);
    font-weight: 600;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.connect-filter-dropdown__caret {
    color: var(--mantine-color-gray-6);
    flex-shrink: 0;
}

.connect-grid-status-chip--active .connect-filter-dropdown__label,
.connect-grid-status-chip--active .connect-filter-dropdown__caret {
    color: var(--infine-blue);
}

.connect-filter-dropdown__option {
    display: block;
    width: 100%;
    text-align: left;
    padding: 6px 10px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--infine-blue);
    font-family: var(--mantine-font-family);
    font-size: var(--mantine-font-size-sm);
    cursor: pointer;
    transition: background-color 0.1s ease;
}

.connect-filter-dropdown__option:hover {
    background: var(--infine-blue-bg);
}

.connect-filter-dropdown__option--active {
    background: var(--infine-blue-bg);
    color: var(--infine-blue);
    font-weight: 600;
}
}
