/*
 * The country picker (App\Filament\Support\CountryMultiSelect, owner decision
 * 2026-10-16): every option reads "DE · Germany", a chosen country shows as
 * its code alone. The name sits in its own span, hidden inside the chips.
 */
.fi-select-input-value-badges-ctn .ap-country-name {
    display: none;
}

.fi-select-input-option .ap-country-code {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

/*
 * A chosen country stays in the list with a tick at its right edge, and
 * choosing it again takes it off (country-select.js marks it
 * `ap-country-picked`). Copper is the signal on light grounds, Brass on dark
 * (docs/Brand/tokens.css, registered for the panels as adspatch-tokens).
 */
.ap-country-select .fi-select-input-option.ap-country-picked {
    position: relative;
    padding-inline-end: 2.25rem;
}

.ap-country-select .fi-select-input-option.ap-country-picked::after {
    content: '';
    position: absolute;
    inset-inline-end: 0.75rem;
    top: 50%;
    width: 1rem;
    height: 1rem;
    transform: translateY(-50%);
    background-color: var(--ap-copper);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='black' fill-rule='evenodd' d='M16.7 5.3a1 1 0 0 1 0 1.4l-8 8a1 1 0 0 1-1.4 0l-4-4a1 1 0 1 1 1.4-1.4L8 12.58l7.3-7.3a1 1 0 0 1 1.4 0Z' clip-rule='evenodd'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='black' fill-rule='evenodd' d='M16.7 5.3a1 1 0 0 1 0 1.4l-8 8a1 1 0 0 1-1.4 0l-4-4a1 1 0 1 1 1.4-1.4L8 12.58l7.3-7.3a1 1 0 0 1 1.4 0Z' clip-rule='evenodd'/%3E%3C/svg%3E") center / contain no-repeat;
    pointer-events: none;
}

.dark .ap-country-select .fi-select-input-option.ap-country-picked::after {
    background-color: var(--ap-brass);
}

/*
 * A whitelist request's landing pages with their countries (owner decision
 * 2026-10-22; the provider list's not approved hint still uses the red): a gap
 * between pages, and the countries a page was not approved for in Filament's
 * danger colour.
 */
.ap-wl-pages .ap-wl-page + .ap-wl-page {
    margin-top: 0.75rem;
}

.ap-wl-not-approved {
    color: var(--danger-600);
}

.dark .ap-wl-not-approved {
    color: var(--danger-400);
}

.ap-wl-page-app {
    display: flex;
    flex-direction: column;
    row-gap: 0.125rem;
    min-width: 0;
}

.ap-wl-pages a {
    color: var(--primary-600);
}

.ap-wl-pages a:hover {
    text-decoration: underline;
}

.dark .ap-wl-pages a {
    color: var(--primary-400);
}

/*
 * The apps whitelisted on an ad account (ClickUp 86bcwf7pj,
 * `WhitelistAppsSection`), client and admin pages and the "Update apps"
 * popup alike (owner review 2026-11-02: compact): each app a short block
 * divided by a hairline, its name (a link to the page), the address on one
 * muted line cut with an ellipsis (whole on hover), then its countries as
 * small chips; a removed app dimmed with its date.
 */
.ap-wl-app + .ap-wl-app {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--gray-100);
}

.dark .ap-wl-app + .ap-wl-app {
    border-top-color: rgb(255 255 255 / 0.06);
}

/* Whitelisting requests: one short wrapping row a request. */
.ap-wl-req {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 0.625rem;
    row-gap: 0.25rem;
    padding-block: 0.5rem;
    border-top: 1px solid var(--gray-100);
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.ap-wl-req:first-child {
    padding-top: 0;
    border-top: 0;
}

.ap-wl-req:last-child {
    padding-bottom: 0;
}

.dark .ap-wl-req {
    border-top-color: rgb(255 255 255 / 0.06);
}

.ap-wl-req-code {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

a.ap-wl-req-code {
    color: var(--primary-600);
}

a.ap-wl-req-code:hover {
    text-decoration: underline;
}

.dark a.ap-wl-req-code {
    color: var(--primary-400);
}

.ap-wl-req-meta {
    color: var(--gray-500);
    font-size: 0.8125rem;
}

.ap-wl-req-note {
    flex-basis: 100%;
    color: var(--gray-500);
    font-size: 0.8125rem;
}

.ap-wl-app.ap-wl-app-is-removed {
    opacity: 0.65;
}

.ap-wl-app-line {
    display: block;
    min-width: 0;
}

.ap-wl-app-link,
.ap-wl-app-name {
    font-weight: 600;
    overflow-wrap: anywhere;
}

.ap-wl-app-link {
    color: var(--primary-600);
}

.ap-wl-app-link:hover {
    text-decoration: underline;
}

.dark .ap-wl-app-link {
    color: var(--primary-400);
}

.ap-wl-app-url {
    display: block;
    max-width: 100%;
    font-size: 0.75rem;
    line-height: 1.125rem;
    color: var(--gray-500);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ap-wl-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.375rem;
}

.ap-wl-chips-label {
    font-size: 0.75rem;
    line-height: 1.125rem;
    color: var(--gray-500);
    margin-inline-end: 0.125rem;
}

.ap-wl-chip + .ap-wl-chips-label {
    margin-inline-start: 0.5rem;
}

.ap-wl-chip {
    display: inline-flex;
    padding: 0 0.375rem;
    border-radius: 0.375rem;
    font-size: 0.6875rem;
    line-height: 1.125rem;
    font-weight: 500;
    white-space: nowrap;
    background: var(--gray-50);
    color: var(--gray-600);
    box-shadow: inset 0 0 0 1px var(--gray-200);
}

.ap-wl-chip-ok {
    background: var(--success-50);
    color: var(--success-700);
    box-shadow: inset 0 0 0 1px var(--success-200);
}

.ap-wl-chip-no {
    background: var(--danger-50);
    color: var(--danger-700);
    box-shadow: inset 0 0 0 1px var(--danger-200);
}

.dark .ap-wl-chip {
    background: rgb(255 255 255 / 0.05);
    color: var(--gray-300);
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.1);
}

.dark .ap-wl-chip-ok {
    color: var(--success-400);
    box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--success-400) 30%, transparent);
}

.dark .ap-wl-chip-no {
    color: var(--danger-400);
    box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--danger-400) 30%, transparent);
}

/*
 * The account's apps as Added (To whitelist, Waiting for approval), Removed
 * and Staying for the desk and the provider (`WhitelistAppChanges`, owner
 * request 2026-11-02): each group a dot, its name and count, then its apps
 * divided by a hairline; a removed app dimmed with its day.
 */
.ap-wl-group + .ap-wl-group {
    margin-top: 1rem;
}

.ap-wl-group-head {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    line-height: 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--gray-600);
}

.dark .ap-wl-group-head {
    color: var(--gray-300);
}

.ap-wl-group-dot {
    width: 0.5rem;
    height: 0.5rem;
    flex: none;
    border-radius: 9999px;
    background: var(--gray-400);
}

.ap-wl-group-added .ap-wl-group-dot {
    background: var(--success-500);
}

.ap-wl-group-removed .ap-wl-group-dot {
    background: var(--danger-500);
}

.ap-wl-group-count {
    padding: 0 0.375rem;
    border-radius: 9999px;
    background: var(--gray-100);
    color: var(--gray-600);
    font-size: 0.6875rem;
    line-height: 1rem;
    font-variant-numeric: tabular-nums;
}

.dark .ap-wl-group-count {
    background: rgb(255 255 255 / 0.08);
    color: var(--gray-300);
}

.ap-wl-group .ap-wl-app,
.ap-wl-group .ap-wl-app-line {
    min-width: 0;
}

/* The provider's list row: "+2 · −1" muted under the landing page. */
.ap-wl-changes {
    color: var(--gray-500);
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
}

/* A request page's address with its copy icon, cut with an ellipsis. */
.ap-wl-app-url-row {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    min-width: 0;
    max-width: 100%;
}

.ap-wl-app-url-row > .ap-wl-app-url {
    min-width: 0;
}

.ap-wl-app-url-row > .ap-copy-id {
    flex: none;
    color: var(--gray-400);
    cursor: pointer;
}

.ap-wl-app-url-row .ap-copy-id-icon {
    width: 0.875rem;
    height: 0.875rem;
}

.ap-wl-changes-added {
    color: var(--success-600);
    font-weight: 600;
}

.ap-wl-changes-removed {
    color: var(--danger-600);
    font-weight: 600;
}

.dark .ap-wl-changes-added {
    color: var(--success-400);
}

.dark .ap-wl-changes-removed {
    color: var(--danger-400);
}

/* "Update apps": a ticked app reads "Will be removed", struck in red. */
.ap-wl-will-remove {
    display: none;
    margin-top: 0.25rem;
    color: var(--danger-600);
    font-size: 0.75rem;
    font-weight: 600;
}

.dark .ap-wl-will-remove {
    color: var(--danger-400);
}

.ap-wl-update-app:has(input[type='checkbox']:checked) .ap-wl-will-remove {
    display: block;
}

.ap-wl-update-app:has(input[type='checkbox']:checked) .ap-wl-app-link,
.ap-wl-update-app:has(input[type='checkbox']:checked) .ap-wl-app-url {
    text-decoration: line-through;
    color: var(--danger-600);
}

.ap-wl-update-app:has(input[type='checkbox']:checked) .ap-wl-chips {
    opacity: 0.5;
}

/* "Update apps": a new app's box, green "New" in its legend. */
.ap-wl-new-badge {
    display: inline-flex;
    padding: 0 0.375rem;
    border-radius: 0.375rem;
    background: var(--success-50);
    color: var(--success-700);
    box-shadow: inset 0 0 0 1px var(--success-200);
    font-size: 0.6875rem;
    line-height: 1.125rem;
    font-weight: 600;
}

.dark .ap-wl-new-badge {
    background: transparent;
    color: var(--success-400);
    box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--success-400) 30%, transparent);
}

.ap-wl-new-app-is-new.fi-fieldset {
    border-color: var(--success-200);
}

.dark .ap-wl-new-app-is-new.fi-fieldset {
    border-color: color-mix(in oklab, var(--success-400) 30%, transparent);
}

/* "Update apps": a new app's box, tighter than a default fieldset. */
.ap-wl-new-app.fi-fieldset {
    padding: 0.75rem;
    row-gap: 0.5rem;
}

.ap-wl-new-app.fi-fieldset > legend {
    font-size: 0.8125rem;
}

/* "Update apps": each current app beside its Remove tick, the apps
   divided by a hairline (each sits in its own grid column wrapper). */
.fi-section-content:has(.ap-wl-update-app) {
    row-gap: 0;
}

.ap-wl-update-app {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.fi-grid-col:has(> .fi-sc-component > .ap-wl-update-app) + .fi-grid-col:has(> .fi-sc-component > .ap-wl-update-app) {
    margin-top: 0.625rem;
    padding-top: 0.625rem;
    border-top: 1px solid var(--gray-100);
}

.dark .fi-grid-col:has(> .fi-sc-component > .ap-wl-update-app) + .fi-grid-col:has(> .fi-sc-component > .ap-wl-update-app) {
    border-top-color: rgb(255 255 255 / 0.06);
}

.ap-wl-update-app > :first-child {
    flex: 1 1 auto;
    min-width: 0;
}

.ap-wl-update-app > :last-child {
    flex: none;
}

.ap-wl-app-removed {
    display: inline-block;
    margin-inline-start: 0.375rem;
    padding: 0 0.375rem;
    border-radius: 0.375rem;
    background: var(--gray-100);
    color: var(--gray-600);
    font-size: 0.75rem;
    font-weight: 500;
}

.dark .ap-wl-app-removed {
    background: rgb(255 255 255 / 0.08);
    color: var(--gray-300);
}
