/* WorkLine 1.11.10 — Учётные записи: чистый поиск без чёрной плашки, свёрнутые карточки прав как ТТК,
   единая строка «Разрешить вход / Вкл. всё / Выкл. всё», описания для каждого тумблера, свайп ролей. */

/* ---------- 4.1: Убираем лишнее непрозрачное тёмное поле вокруг поиска ---------- */
#account-admin-overlay .acc-seg-b {
    padding: 0 7px;
    gap: 5px;
    font-size: 13px;
}
#account-admin-overlay .acc-tools {
    position: static !important;
    top: auto !important;
    margin: 0 0 10px !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    border: 0 !important;
}
#account-admin-overlay .acc-search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 12px;
    border-radius: 14px;
    border: 1.5px solid var(--i-edge, var(--border));
    background: var(--card);
    box-shadow: var(--i-drop, none);
    transition: border-color .15s ease, box-shadow .15s ease;
}
#account-admin-overlay .acc-search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .14);
}
#account-admin-overlay .acc-search-ico {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    opacity: .55;
    pointer-events: none;
}
#account-admin-overlay .acc-search-box .acc-search {
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    padding: 0;
    margin: 0;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--text);
    font: inherit;
    font-size: 15px;
    outline: none;
}
#account-admin-overlay .acc-search-box .acc-search::placeholder {
    color: var(--text);
    opacity: .48;
}
#account-admin-overlay .acc-search-box .acc-count {
    flex: 0 0 auto;
    font-size: 11.5px;
    font-weight: 700;
    opacity: .62;
    white-space: nowrap;
    padding-left: 6px;
    border-left: 1px solid var(--border);
}

/* ---------- 4.4: «Разрешить вход» + «Вкл. всё» + «Выкл. всё» в одну строчку ---------- */
#account-permission-editor .ap-top-row {
    display: flex;
    align-items: stretch;
    gap: 6px;
    margin: 0 0 10px;
}
#account-permission-editor .ap-top-entry {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 13px;
    border: 1.5px solid rgba(var(--primary-rgb), .38);
    background: var(--card);
    color: var(--text);
    cursor: pointer;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    transition: border-color .15s ease, background-color .15s ease;
}
#account-permission-editor .ap-top-entry:has(input:checked) {
    border-color: rgba(var(--primary-rgb), .58);
    background: rgba(var(--primary-rgb), .08);
}
#account-permission-editor .ap-top-entry:has(input:disabled) {
    opacity: .65;
    cursor: default;
}
#account-permission-editor .ap-top-entry-lbl {
    font-size: 13px;
    font-weight: 800;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#account-permission-editor .ap-top-entry .wl-switch {
    flex: 0 0 auto;
}
#account-permission-editor .ap-top-bulk {
    flex: 0 0 auto;
    display: flex;
    align-items: stretch;
    gap: 6px;
}
#account-permission-editor .ap-bulk-btn {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 0 10px;
    border-radius: 13px;
    border: 1.5px solid var(--border);
    background: var(--card);
    color: var(--text);
    font: inherit;
    font-size: 12.5px;
    font-weight: 800;
    white-space: nowrap;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    transition: background-color .15s ease, border-color .15s ease, transform .1s ease;
}
#account-permission-editor .ap-bulk-btn:active {
    transform: scale(.97);
    background: rgba(var(--primary-rgb), .12);
    border-color: rgba(var(--primary-rgb), .45);
}
#account-permission-editor .ap-top-row-role {
    margin: 8px 0 10px;
}
#account-permission-editor .ap-top-row-role .ap-bulk-btn {
    flex: 1 1 0;
    font-size: 13px;
}
#account-permission-editor .ap-self-note {
    margin: -4px 0 10px;
    padding: 0 4px;
    font-size: 11.5px;
    font-weight: 600;
    opacity: .65;
}
@media (max-width: 375px) {
    #account-permission-editor .ap-top-row { gap: 5px; }
    #account-permission-editor .ap-top-entry { padding: 6px 8px; gap: 6px; }
    #account-permission-editor .ap-top-entry-lbl { font-size: 12px; }
    #account-permission-editor .ap-top-bulk { gap: 5px; }
    #account-permission-editor .ap-bulk-btn { padding: 0 8px; font-size: 11.5px; }
}

/* ---------- 4.6: Выбор роли — свайп вправо-влево в одну строчку ---------- */
#account-permission-editor .ap-role {
    margin: 0 0 12px;
    padding: 11px 12px;
    border-radius: 15px;
    background: rgba(var(--primary-rgb), .06);
    border: 1px solid rgba(var(--primary-rgb), .16);
}
#account-permission-editor .ap-role-title {
    margin-bottom: 8px;
}
#account-permission-editor .ap-role-chips {
    display: flex;
    flex-wrap: nowrap;
    gap: 7px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 2px 1px;
    margin: 0 -1px;
}
#account-permission-editor .ap-role-chips::-webkit-scrollbar {
    display: none;
}
#account-permission-editor .ap-role-chip {
    flex: 0 0 auto;
    white-space: nowrap;
    height: 36px;
    padding: 0 13px;
    border-radius: 11px;
}
#account-permission-editor .ap-role-chip.on {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--on-primary, #fff);
}
:where([data-theme="dark"]) #account-permission-editor .ap-role-chip.on {
    color: var(--on-primary, #111318);
}

/* ---------- 4.3 & 4.5: Свёрнутые разделы прав в стиле ТТК (Напитки) + описания тумблеров ---------- */
#account-permission-editor .account-permission-block-title {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .03em;
    text-transform: uppercase;
    opacity: .62;
    margin: 14px 2px 8px;
}
#account-permission-editor .ap-cards-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
#account-permission-editor .ap-card {
    border: 1px solid var(--i-edge, var(--border));
    border-radius: 13px;
    background: var(--card);
    box-shadow: var(--i-drop, none);
    padding: 0;
    overflow: hidden;
    transition: border-color .15s ease, box-shadow .15s ease;
}
#account-permission-editor .ap-card.is-open {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb), .16);
}
#account-permission-editor .ap-card-top {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 12px;
    border: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
#account-permission-editor .ap-card-top:active {
    background: rgba(var(--primary-rgb), .06);
}
#account-permission-editor .ap-card-head-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
#account-permission-editor .ap-card-title {
    font-weight: 800;
    font-size: 14.5px;
    line-height: 1.25;
}
#account-permission-editor .ap-card-meta {
    font-size: 11.5px;
    font-weight: 700;
    opacity: .6;
    line-height: 1.2;
}
#account-permission-editor .ap-card-meta.has-on {
    color: var(--primary);
    opacity: .95;
}
#account-permission-editor .ap-card-chev {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(127, 127, 127, .09);
    color: var(--text);
    opacity: .72;
    transition: transform .18s ease, background-color .15s ease, color .15s ease;
}
#account-permission-editor .ap-card.is-open .ap-card-chev {
    transform: rotate(180deg);
    background: rgba(var(--primary-rgb), .14);
    color: var(--primary);
    opacity: 1;
}
#account-permission-editor .ap-card-body {
    display: none;
    margin: 0 12px 12px;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
}
#account-permission-editor .ap-card.is-open .ap-card-body {
    display: block;
}
#account-permission-editor .ap-sec-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0 0 9px;
}
#account-permission-editor .ap-sec-bar > span:first-child {
    font-size: 12px;
    font-weight: 700;
    opacity: .62;
}
#account-permission-editor .ap-sec-bar-btns {
    display: flex;
    gap: 6px;
}
#account-permission-editor .ap-sec-bar-btns .orders-small-btn {
    min-height: 30px;
    padding: 0 10px;
    font-size: 12px;
    font-weight: 700;
    border-radius: 9px;
}

/* Все тумблеры с описаниями — в одну колонку для ровной читаемости на любых экранах */
#account-permission-editor .account-permission-grid,
#account-permission-editor .account-permission-actions-grid {
    display: grid;
    grid-template-columns: 1fr !important;
    gap: 7px;
}
#account-permission-editor .ap-card-body .ap-sw {
    min-height: 48px;
    padding: 9px 11px;
    border-radius: 11px;
    border: 1px solid var(--border);
    background: rgba(127, 127, 127, .04);
    align-items: center;
    gap: 10px;
}
#account-permission-editor .ap-card-body .ap-sw:has(input:checked) {
    border-color: rgba(var(--primary-rgb), .52);
    background: rgba(var(--primary-rgb), .08);
}
#account-permission-editor .ap-card-body .ap-sw .ap-sw-t {
    font-size: 13.5px;
    font-weight: 800;
    line-height: 1.25;
}
#account-permission-editor .ap-card-body .ap-sw .ap-sw-t small {
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.35;
    opacity: .68;
    margin-top: 3px;
}
#account-permission-editor .ap-chat.is-off .ap-chat-subs {
    opacity: .48;
}
