/* Shared action controls. Legacy authentication controls are intentionally not targeted. */
:is(a, button, summary).rv-action.rv-action {
    --action-color: #9b731c;
    --action-soft: rgba(184, 146, 63, .1);
    --action-on: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    min-height: 36px;
    max-width: 100%;
    padding: .42rem .85rem;
    margin: 0;
    border: 1px solid var(--action-color);
    border-radius: 999px;
    background: transparent;
    color: var(--action-color);
    box-shadow: none;
    font-family: inherit;
    font-size: .8125rem;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    appearance: none;
    transition: background-color .15s, color .15s, border-color .15s, box-shadow .15s;
}

:is(a, button, summary).rv-action.rv-action:hover {
    background: var(--action-soft);
    color: var(--action-color);
    border-color: var(--action-color);
    text-decoration: none
}

:is(a, button, summary).rv-action.rv-action:focus-visible {
    outline: 3px solid var(--action-color);
    outline-offset: 3px;
    box-shadow: none
}

:is(a, button, summary).rv-action.rv-action:disabled,
:is(a, button, summary).rv-action.rv-action[disabled],
:is(a, button, summary).rv-action.rv-action[aria-disabled=true] {
    opacity: .5;
    cursor: not-allowed;
    pointer-events: none
}

:is(a, button, summary).rv-action.rv-action--secondary {
    --action-color: #596579;
    --action-soft: rgba(89, 101, 121, .1)
}

:is(a, button, summary).rv-action.rv-action--success {
    --action-color: #18734b;
    --action-soft: rgba(24, 115, 75, .1)
}

:is(a, button, summary).rv-action.rv-action--danger {
    --action-color: #b02a37;
    --action-soft: rgba(176, 42, 55, .1)
}

:is(a, button, summary).rv-action.rv-action--warning {
    --action-color: #956200;
    --action-soft: rgba(149, 98, 0, .1)
}

:is(a, button, summary).rv-action.rv-action--info {
    --action-color: #176b88;
    --action-soft: rgba(23, 107, 136, .1)
}

[data-bs-theme=dark] :is(a, button, summary).rv-action.rv-action {
    --action-color: #dfbf75;
    --action-soft: rgba(223, 191, 117, .12);
    --action-on: #181b20
}

[data-bs-theme=dark] :is(a, button, summary).rv-action.rv-action--secondary {
    --action-color: #b4bdcc;
    --action-soft: rgba(180, 189, 204, .12)
}

[data-bs-theme=dark] :is(a, button, summary).rv-action.rv-action--success {
    --action-color: #72d4a2;
    --action-soft: rgba(114, 212, 162, .12)
}

[data-bs-theme=dark] :is(a, button, summary).rv-action.rv-action--danger {
    --action-color: #ef929b;
    --action-soft: rgba(239, 146, 155, .12)
}

[data-bs-theme=dark] :is(a, button, summary).rv-action.rv-action--warning {
    --action-color: #edc477;
    --action-soft: rgba(237, 196, 119, .12)
}

[data-bs-theme=dark] :is(a, button, summary).rv-action.rv-action--info {
    --action-color: #79cbe6;
    --action-soft: rgba(121, 203, 230, .12)
}

:is(a, button, summary).rv-action.rv-action--solid {
    background: var(--action-color);
    color: var(--action-on)
}

:is(a, button, summary).rv-action.rv-action--solid:hover {
    background: var(--action-color);
    color: var(--action-on);
    cursor: default;
    filter: none !important;
}

:is(a, button, summary).rv-action.rv-action--plain {
    border-color: transparent;
    background: transparent;
    color: inherit
}

:is(a, button, summary).rv-action.rv-action--plain:hover,
:is(a, button, summary).rv-action.rv-action.is-active,
:is(a, button, summary).rv-action.rv-action.active {
    background: var(--action-soft);
    color: var(--action-color);
    border-color: var(--action-color)
}

:is(a, button, summary).rv-action.rv-action--sm {
    min-height: 32px;
    padding: .3rem .7rem;
    font-size: .75rem
}

:is(a, button, summary).rv-action.rv-action--icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    padding: 0;
    flex: 0 0 auto
}

.rv-action .rv-action__icon,
.rv-action>.icon {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    margin: 0
}

summary.rv-action {
    list-style: none
}

summary.rv-action::-webkit-details-marker {
    display: none
}

.rv-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem
}

@media(prefers-reduced-motion:reduce) {
    .rv-action {
        transition: none !important
    }
}

/* Structural controls share interaction states while retaining their required layout. */
button.rv-action.rv-action.nav-group-toggle {
    width: 100%;
    justify-content: flex-start;
    border-radius: 12px;
    white-space: normal
}

button.rv-action.rv-action.notification-item,
button.rv-action.rv-action.notification-open {
    display: flex;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    text-align: start;
    white-space: normal;
    border-radius: 12px
}

button.rv-action.rv-action.sidebar-backdrop {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
    background: #0008;
    padding: 0;
    z-index: 1050
}

button.rv-action.rv-action.builder-field-select {
    flex: 1;
    text-align: start;
    justify-content: flex-start;
    white-space: normal
}

button.rv-action.rv-action.builder-drag {
    cursor: grab;
    align-self: stretch
}

button.rv-action.rv-action.rv-password-toggle {
    position: absolute;
    inset-inline-end: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
    padding: 6px
}

button.rv-password-toggle.rv-action .rv-password-eye {
    width: 20px;
    height: 20px
}

table .rv-action.rv-action {
    min-height: 32px;
    padding: .3rem .7rem;
    font-size: .75rem
}

@media(min-width:992px) {

    button.rv-action.rv-action.sidebar-close,
    button.rv-action.rv-action.menu-toggle,
    button.rv-action.rv-action.sidebar-backdrop {
        display: none
    }
}

:is(a, button).rv-action.rv-action.dropdown-item {
    width: 100%;
    justify-content: flex-start;
    border-radius: 10px;
    color: var(--action-color)
}

button.rv-action.rv-action.leaflet-control-locate {
    width: 30px;
    height: 30px;
    min-width: 30px;
    min-height: 30px;
    border-radius: 0;
    padding: 5px
}

/* Shared RTL modal layout, including custom action buttons. */
.modal-header {
    direction: rtl;
    justify-content: space-between;
    gap: 1rem;
}

.modal-header .modal-title {
    margin: 0;
    min-width: 0;
}

.modal-header> :is(button, a)[data-bs-dismiss="modal"] {
    margin-inline-start: auto;
    margin-inline-end: 0;
    flex-shrink: 0;
}

.modal-dialog-scrollable .modal-content>form {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.modal-dialog-scrollable .modal-body {
    min-height: 0;
    overscroll-behavior: contain;
}
