﻿/* =============================================================================
   SHARED TOKENS
   ============================================================================= */

:root {
    /* Velzon's --vz-warning (#f7b84b) is a FILL colour. Used as ink on white it
       lands around 1.9:1 — well under the 4.5:1 needed to read comfortably —
       and it was being used on the one string in the app that exists purely to
       be read: the financial-year mismatch. Posting a year into the wrong books
       is expensive to unwind and invisible once done, so the warning has to be
       legible before it is pretty.

       Same hue, darkened until it passes. */
    --erp-amber-ink: #b07b12;
}

/* On a dark ground the relationship inverts — the bright amber is the readable
   one and the darkened version disappears. */
[data-bs-theme="dark"] {
    --erp-amber-ink: #f7b84b;
}


/* =============================================================================
   SELECT2 — scrollbar
   The results list scrolls natively, so it inherits the OS scrollbar. Slim it
   to match the rest of the app.
   ============================================================================= */

.select2-container--default .select2-results > .select2-results__options {
    max-height: 240px;
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: var(--vz-border-color) transparent;
}

    /* WebKit — Chrome, Edge, Safari */
    .select2-container--default .select2-results > .select2-results__options::-webkit-scrollbar {
        width: 6px;
    }

    .select2-container--default .select2-results > .select2-results__options::-webkit-scrollbar-track {
        background: transparent;
    }

    .select2-container--default .select2-results > .select2-results__options::-webkit-scrollbar-thumb {
        background: var(--vz-border-color);
        border-radius: 3px;
    }

        .select2-container--default .select2-results > .select2-results__options::-webkit-scrollbar-thumb:hover {
            background: var(--vz-secondary-color);
        }
/* Match the height and radius of .form-control */
.select2-container--default .select2-selection--single {
    height: calc(1.5em + 1rem + 2px);
    padding: .5rem .9rem;
    border: 1px solid var(--vz-border-color);
    border-radius: var(--vz-border-radius);
}

    .select2-container--default .select2-selection--single .select2-selection__rendered {
        line-height: 1.5;
        padding: 0;
        color: var(--vz-body-color);
    }

    .select2-container--default .select2-selection--single .select2-selection__arrow {
        height: 100%;
        right: 8px;
    }

/* The highlighted option should use the theme primary, not Select2's blue */
.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: rgba(var(--vz-primary-rgb), .1);
    color: var(--vz-primary);
}

.select2-container--default .select2-results__option[aria-selected="true"] {
    background: var(--vz-primary);
    color: #fff;
}

.select2-dropdown {
    border-color: var(--vz-border-color);
    border-radius: var(--vz-border-radius);
    box-shadow: 0 6px 20px rgba(0, 0, 0, .1);
}

.select2-search--dropdown .select2-search__field {
    border: 1px solid var(--vz-border-color);
    border-radius: 5px;
    padding: 6px 10px;
}