.app-dropdown { position: relative; }
.app-dropdown__chevron { font-size: 12px; color: var(--app-text-muted); }
.app-dropdown__menu { position: absolute; top: calc(100% + 6px); inset-inline-start: 0; min-width: 220px; padding: 6px; background: var(--app-surface); border: 1px solid var(--app-border); border-radius: var(--app-radius-md); box-shadow: var(--app-shadow-md); z-index: var(--z-dropdown); display: none; }
.app-dropdown__menu--end { inset-inline-start: auto; inset-inline-end: 0; }
.app-dropdown.is-open > .app-dropdown__menu { display: block; }
.app-dropdown__item { display: flex; align-items: center; min-height: 34px; padding: 7px 10px; border-radius: var(--app-radius-sm); color: var(--app-text); font-size: 14px; }
.app-dropdown__item:hover, .app-dropdown__item.is-active { background: var(--app-surface-muted); color: var(--app-primary); }
.app-dropdown__heading { padding: 8px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--app-text-muted); }
.app-dropdown__heading:not(:first-child) { margin-top: 4px; border-top: 1px solid var(--app-border); padding-top: 10px; }
.app-dropdown__item--placeholder { color: var(--app-text-muted); cursor: default; opacity: 0.72; }

.app-user-menu.app-dropdown__menu {
    width: min(18rem, calc(100vw - 1rem));
    min-width: 17rem;
    padding: 0.55rem;
    border-color: color-mix(in srgb, var(--app-border) 82%, var(--app-primary));
    border-radius: 0.75rem;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.14), 0 2px 8px rgba(15, 23, 42, 0.06);
}

.app-user-menu .app-dropdown__section {
    padding: 0.2rem 0.2rem 0.65rem;
    border-bottom: 1px solid var(--app-border);
}

.app-user-menu .app-dropdown__label {
    margin: 0 0 0.45rem;
    padding-inline: 0.15rem;
    color: var(--app-text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.2;
    text-transform: none;
}

.app-user-menu .app-ui-scale-control {
    min-width: 0;
}

.app-user-menu .app-ui-scale-control__options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.35rem;
}

.app-user-menu .app-ui-scale-control__option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 2rem;
    padding: 0 0.65rem;
    border-radius: 0.55rem;
    text-align: start;
    white-space: normal;
}

.app-user-menu .app-ui-scale-control__option.is-active::after {
    content: "";
    width: 0.45rem;
    height: 0.45rem;
    flex: 0 0 auto;
    border-radius: 999px;
    background: currentColor;
}

.app-user-menu .app-dropdown__item {
    min-height: 2.15rem;
    margin-top: 0.15rem;
    padding: 0.45rem 0.65rem;
    border-radius: 0.55rem;
    font-weight: 500;
    text-decoration: none;
}

.app-dropdown__menu--grouped {
    width: min(44rem, calc(100vw - 2rem));
    max-height: min(70vh, 32rem);
    overflow: auto;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.4rem;
    padding: 0.4rem;
}
.app-dropdown.is-open > .app-dropdown__menu--grouped { display: grid; }
.app-dropdown__group { min-width: 0; }
.app-dropdown__menu--grouped .app-dropdown__heading {
    margin: 0 0 0.2rem;
    padding: 0.45rem 0.6rem;
    border: 0;
    border-bottom: 1px solid var(--app-border);
}
.app-dropdown__menu--grouped .app-dropdown__item {
    white-space: normal;
    line-height: 1.35;
}

.app-dropdown__menu--nested {
    min-width: 220px;
    padding: 6px;
    overflow: visible;
}

.app-dropdown__sub {
    position: relative;
}

.app-dropdown__sub-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 34px;
    padding: 7px 10px;
    border: 0;
    border-radius: var(--app-radius-sm);
    background: transparent;
    color: var(--app-text);
    font: inherit;
    font-size: 14px;
    text-align: inherit;
    cursor: pointer;
}

.app-dropdown__sub-toggle:hover,
.app-dropdown__sub.is-active > .app-dropdown__sub-toggle,
.app-dropdown__sub.is-open > .app-dropdown__sub-toggle {
    background: var(--app-surface-muted);
    color: var(--app-primary);
}

.app-dropdown__sub-chevron {
    color: var(--app-text-muted);
    font-size: 16px;
    line-height: 1;
}

[dir="rtl"] .app-dropdown__sub-chevron {
    transform: scaleX(-1);
}

.app-dropdown__sub-menu {
    position: absolute;
    top: 0;
    inset-inline-start: calc(100% - 6px);
    display: none;
    min-width: 220px;
    padding: 6px;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-md);
    box-shadow: var(--app-shadow-md);
    z-index: calc(var(--z-dropdown) + 1);
}

.app-dropdown__sub.is-open > .app-dropdown__sub-menu {
    display: block;
}

@media (hover: hover) {
    .app-dropdown__sub:hover > .app-dropdown__sub-menu {
        display: block;
    }
}

.app-dropdown__sub-menu .app-dropdown__item {
    white-space: nowrap;
}

@media (max-width: 760px) {
    .app-dropdown__menu--grouped {
        width: min(22rem, calc(100vw - 1.25rem));
        grid-template-columns: 1fr;
    }

    .app-dropdown__sub-menu {
        position: static;
        inset-inline-start: auto;
        margin-top: 2px;
        margin-inline-start: 10px;
        box-shadow: none;
        border: 0;
        padding: 0 0 4px;
    }
}

.collections-report-dropdown.app-dropdown__menu--reports {
    width: min(20rem, calc(100vw - 2rem));
    min-width: 15rem;
    max-height: min(70vh, 26rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0.25rem;
}

.collections-report-dropdown .app-dropdown__group-heading {
    padding: 0.4rem 0.55rem 0.15rem;
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--app-text-muted);
}

.collections-report-dropdown .app-dropdown__group-heading:not(:first-child) {
    margin-top: 0.2rem;
    border-top: 1px solid var(--app-border);
    padding-top: 0.45rem;
}

.collections-report-dropdown .app-dropdown__report-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 4.75rem;
    align-items: center;
    gap: 0.35rem 0.5rem;
    padding: 0.38rem 0.55rem;
    border-radius: var(--app-radius-sm);
    color: var(--app-text);
    text-decoration: none;
}

.collections-report-dropdown .app-dropdown__report-item:hover,
.collections-report-dropdown .app-dropdown__report-item.is-active {
    background: var(--app-surface-muted);
    color: var(--app-primary);
}

.collections-report-dropdown .app-dropdown__report-item--index {
    margin-bottom: 0.1rem;
    border-bottom: 1px solid var(--app-border);
    border-radius: var(--app-radius-sm) var(--app-radius-sm) 0 0;
    font-weight: 600;
}

.collections-report-dropdown .app-dropdown__report-item--planned {
    opacity: 0.72;
    cursor: default;
    grid-template-columns: minmax(0, 1fr) 4.75rem;
    padding: 0.28rem 0.55rem;
}

.collections-report-dropdown .app-dropdown__report-item--planned-compact .app-dropdown__report-title {
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.3;
}

.collections-report-dropdown .app-dropdown__report-copy {
    display: grid;
    gap: 0.08rem;
    min-width: 0;
}

.collections-report-dropdown .app-dropdown__report-title {
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.3;
    color: inherit;
}

.collections-report-dropdown .app-dropdown__report-desc {
    font-size: 0.7rem;
    line-height: 1.3;
    color: var(--app-text-muted);
}

.collections-report-dropdown .app-dropdown__report-item--planned .app-dropdown__report-title {
    color: var(--app-text-muted);
}

.collections-report-dropdown .app-dropdown__badge {
    justify-self: end;
    align-self: center;
    padding: 0.1rem 0.38rem;
    border-radius: 999px;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
    line-height: 1.25;
    text-align: center;
}

.collections-report-dropdown .app-dropdown__badge--live {
    color: #166534;
    background: #dcfce7;
}

.collections-report-dropdown .app-dropdown__badge--soon {
    color: #6b7280;
    background: #f3f4f6;
}

[dir="rtl"] .collections-report-dropdown .app-dropdown__report-item {
    direction: rtl;
}

[dir="rtl"] .collections-report-dropdown .app-dropdown__badge {
    justify-self: start;
}

.collections-report-dropdown .app-dropdown__report-item--compact {
    display: block;
    padding: 0.32rem 0.55rem;
    border-radius: var(--app-radius-sm);
    color: var(--app-text);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.collections-report-dropdown .app-dropdown__report-item--compact:hover,
.collections-report-dropdown .app-dropdown__report-item--compact.is-active {
    background: var(--app-surface-muted);
    color: var(--app-primary);
}

.collections-report-dropdown .app-dropdown__report-item--compact .app-dropdown__report-title {
    font-size: inherit;
    font-weight: inherit;
}
