/*!
 * smit-actions — кнопка действий с выпадающим меню. Пара с smit-actions.js.
 * Вид взят у списка почтовых ящиков и списка услуг: неприметная кнопка «⋮»
 * в строке, меню — с иконками и разделителем перед опасным действием.
 */

.smit-actions { display: inline-block; line-height: 1; }

.smit-actions-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 34px;
    min-height: 34px;
    padding: 4px 10px;
    border: 1px solid var(--sc-border, #dee2e6);
    border-radius: 6px;
    background: transparent;
    color: var(--sc-text-muted, #64748b);
    cursor: pointer;
    font-size: .9rem;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.smit-actions-btn.is-sm { min-width: 30px; min-height: 30px; padding: 2px 8px; font-size: .82rem; }
.smit-actions-btn-text { font-size: .84rem; }

.smit-actions-btn:hover,
.smit-actions-btn[aria-expanded="true"] {
    background: rgba(100, 116, 139, .12);
    color: inherit;
}

.smit-actions-btn:focus-visible {
    outline: 2px solid var(--sc-brand, #43b77a);
    outline-offset: 2px;
}

/* ── меню ── */
.smit-actions-menu {
    position: fixed;
    z-index: 2600;
    min-width: 200px;
    max-width: calc(100vw - 16px);
    padding: .25rem;
    border: 1px solid var(--sc-border, #e2e8f0);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .18);
}

.smit-actions-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    width: 100%;
    padding: .34rem .6rem;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--sc-text, #212529);
    cursor: pointer;
    font-size: .84rem;
    line-height: 1.35;
    text-align: left;
    text-decoration: none;
    white-space: nowrap;
}

.smit-actions-item i { width: 1.1rem; text-align: center; flex: 0 0 auto; }
.smit-actions-noicon { display: inline-block; }

.smit-actions-item:hover,
.smit-actions-item:focus {
    background: rgba(67, 183, 122, .12);
    color: var(--sc-text, #212529);
    outline: none;
}

.smit-actions-item:focus-visible { box-shadow: inset 0 0 0 2px var(--sc-brand, #43b77a); }

.smit-actions-item.is-danger { color: #dc3545; }
.smit-actions-item.is-danger:hover,
.smit-actions-item.is-danger:focus { background: rgba(220, 53, 69, .1); color: #dc3545; }

.smit-actions-item.is-disabled {
    opacity: .5;
    cursor: not-allowed;
    pointer-events: none;
}

.smit-actions-sep {
    height: 1px;
    margin: .25rem 0;
    background: var(--sc-border, #e2e8f0);
}

/* ── тёмная тема ── */
/* Общее правило темы для выпадающих списков живёт в мобильном media-блоке,
   поэтому цвета задаём здесь — иначе меню светится белым на тёмной странице. */
body.dark-theme .smit-actions-menu,
[data-bs-theme="dark"] .smit-actions-menu {
    background: #1e2530;
    border-color: #2f3742;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .55);
}

body.dark-theme .smit-actions-item,
[data-bs-theme="dark"] .smit-actions-item { color: #cfd8e3; }

body.dark-theme .smit-actions-item:hover,
body.dark-theme .smit-actions-item:focus,
[data-bs-theme="dark"] .smit-actions-item:hover,
[data-bs-theme="dark"] .smit-actions-item:focus {
    background: rgba(67, 183, 122, .16);
    color: #fff;
}

body.dark-theme .smit-actions-item.is-danger,
[data-bs-theme="dark"] .smit-actions-item.is-danger { color: #ff8b8b; }

body.dark-theme .smit-actions-sep,
[data-bs-theme="dark"] .smit-actions-sep { background: #2f3742; }

body.dark-theme .smit-actions-btn,
[data-bs-theme="dark"] .smit-actions-btn { border-color: #2f3742; color: #9aaab4; }

body.dark-theme .smit-actions-btn:hover,
body.dark-theme .smit-actions-btn[aria-expanded="true"],
[data-bs-theme="dark"] .smit-actions-btn:hover,
[data-bs-theme="dark"] .smit-actions-btn[aria-expanded="true"] {
    background: rgba(148, 163, 184, .18);
    color: #e8eef5;
}

/* ── телефон: крупнее пункты, меню прижато к краям экрана ── */
@media (max-width: 575.98px) {
    .smit-actions-btn { min-width: 38px; min-height: 38px; }
    .smit-actions-menu {
        left: 10px !important;
        right: 10px;
        min-width: 0;
    }
    .smit-actions-item { padding: .55rem .7rem; font-size: .95rem; }
}

@media (prefers-reduced-motion: reduce) {
    .smit-actions-btn { transition: none; }
}
