/*
 * Rule groups read as one undifferentiated white column once an account has
 * several professions configured. Tint every other group so the eye can tell
 * where one ends and the next begins, the way table rows do.
 *
 * Filament styles the item at .fi-fo-repeater .fi-fo-repeater-item (two
 * classes, and its dark rule adds only :where(), which carries no weight), so
 * a two-class selector plus :nth-child outranks both without !important.
 *
 * nth-child counts every <li>, and the repeater interleaves an "add between"
 * <li> when that action is visible — the rule group repeater hides it, which
 * is what keeps this parity honest.
 */

.bude-billing-rule-groups .fi-fo-repeater-item:nth-child(even) {
    background-color: #00000008;
}

@supports (color: color-mix(in lab, red, red)) {
    .bude-billing-rule-groups .fi-fo-repeater-item:nth-child(even) {
        background-color: color-mix(in oklab, var(--gray-950) 4%, var(--color-white));
    }
}

.bude-billing-rule-groups .fi-fo-repeater-item:nth-child(even):where(.dark, .dark *) {
    background-color: #ffffff1a;
}

/*
 * Three nested surfaces, the way the compliance kanban stacks its board:
 * one white panel holds every group, each group is a tinted board inside it,
 * and the rule cards are white again on top. Each level is told apart by the
 * one behind it, so the cards need no fill of their own to stand out.
 *
 * Written out rather than composed from Tailwind utilities: a utility only
 * exists in the host's build if a template it scans uses it literally.
 */

.bude-billing-rule-groups {
    padding: 1.25rem;
    border-radius: 0.75rem;
    background-color: var(--color-white, #fff);
    box-shadow: 0 0 0 1px var(--gray-200, #e5e7eb);
}

.bude-billing-rule-groups:where(.dark, .dark *) {
    background-color: var(--gray-900, #18181b);
    box-shadow: 0 0 0 1px #ffffff1a;
}

.bude-billing-rule-groups > * + * {
    margin-top: 1rem;
}

.bude-billing-rule-group {
    padding: 1rem;
    border-radius: 0.5rem;
    background-color: #f3f7f9;
    box-shadow: 0 0 0 1px var(--gray-200, #e5e7eb);
}

.bude-billing-rule-group:where(.dark, .dark *) {
    background-color: #00000040;
    box-shadow: 0 0 0 1px #ffffff1a;
}

.bude-billing-rule-group-header {
    display: grid;
    row-gap: 0.25rem;
    margin-bottom: 0.75rem;
}

.bude-billing-rule-group-heading {
    font-size: 1rem;
    line-height: 1.5rem;
    font-weight: 600;
    color: var(--gray-950, #030712);
}

.bude-billing-rule-group-heading:where(.dark, .dark *) {
    color: var(--color-white, #fff);
}

.bude-billing-rule-group-description {
    font-size: 0.875rem;
    line-height: 1.25rem;
    overflow-wrap: break-word;
    color: var(--gray-500, #6b7280);
}

.bude-billing-rule-group-description:where(.dark, .dark *) {
    color: var(--gray-400, #9ca3af);
}

/*
 * A card is white on a tinted board — close enough in fill that the line
 * around it is what holds it together. Filament rings a card at 5% of
 * gray-950, which disappears at this size; the kanban outlines its own cards
 * in gray-200.
 */

.bude-billing-rule-card {
    --tw-ring-color: var(--gray-200, #e5e7eb);
}

.bude-billing-rule-card:where(.dark, .dark *) {
    --tw-ring-color: #ffffff26;
}

/* A card the user may edit opens its rule from anywhere on it. */
.bude-billing-rule-card-clickable {
    cursor: pointer;
    transition: box-shadow 150ms ease;
}

.bude-billing-rule-card-clickable:hover {
    --tw-ring-color: var(--primary-500, #3b82f6);
}
