@font-face {
    font-family: IRANSans;
    src: url('../fonts/IRANSansWeb_Bold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    color-scheme: light;
    --primary: #14213D;
    --primary-soft: rgba(20, 33, 61, 0.08);
    --primary-hover: rgba(20, 33, 61, 0.12);
    --text: #25272C;
    --bg: #FFFFFF;
    --surface: #FFFFFF;
    --soft: #F7F8FA;
    --line: #E8EAF0;
    --muted: rgba(37, 39, 44, 0.68);
    --danger: #B42318;
    --danger-bg: #FEF3F2;
    --success: #027A48;
    --success-bg: #ECFDF3;
    --warning: #B54708;
    --warning-bg: #FFFAEB;
    --info: #175CD3;
    --info-bg: #EFF8FF;
    --shadow: 0 24px 80px rgba(20, 33, 61, 0.08);
    --canvas-shadow: -28px 0 80px rgba(20, 33, 61, 0.16);
}

html[data-color-scheme="dark"] {
    color-scheme: dark;
    --text: #F6F7FB;
    --bg: #0F1218;
    --surface: #151A23;
    --soft: #1B2230;
    --line: rgba(255, 255, 255, 0.10);
    --muted: rgba(246, 247, 251, 0.68);
    --primary-soft: rgba(255, 255, 255, 0.07);
    --primary-hover: rgba(255, 255, 255, 0.12);
    --danger: #FDA29B;
    --danger-bg: rgba(180, 35, 24, 0.16);
    --success: #6CE9A6;
    --success-bg: rgba(2, 122, 72, 0.16);
    --warning: #FDB022;
    --warning-bg: rgba(181, 71, 8, 0.16);
    --info: #84CAFF;
    --info-bg: rgba(23, 92, 211, 0.16);
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
    --canvas-shadow: -28px 0 80px rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: IRANSans, Tahoma, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.9;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

body.ds-canvas-open {
    overflow: hidden;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    color: inherit;
}

[hidden] {
    display: none !important;
}

.page-shell {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    background: var(--bg);
}

.page-shell.is-dashboard {
    display: block;
    padding: 0;
}

.auth-card {
    width: 100%;
    max-width: 460px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 28px;
    padding: 32px;
    box-shadow: var(--shadow);
}

.auth-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 28px;
}

.auth-logo img {
    width: auto;
    height: 42px;
    max-width: 210px;
    display: block;
    object-fit: contain;
}

h1 {
    margin: 0 0 10px;
    color: var(--text);
    font-size: 24px;
    line-height: 1.7;
    font-weight: 700;
    text-align: center;
}

.muted {
    margin: 0 0 24px;
    color: var(--muted);
    font-size: 14px;
    line-height: 2.1;
    text-align: center;
}

.form-stack {
    display: grid;
    gap: 16px;
}

.form-stack label {
    display: grid;
    gap: 8px;
}

.form-stack span {
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.8;
}

.form-stack input {
    width: 100%;
    height: 52px;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 0 16px;
    background: var(--soft);
    color: var(--text);
    outline: none;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.form-stack input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(20, 33, 61, 0.08);
    background: var(--surface);
}

.form-stack button,
.simple-link {
    height: 52px;
    border: 0;
    border-radius: 16px;
    background: var(--primary);
    color: #FFFFFF;
    cursor: pointer;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.alert {
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.9;
    margin-bottom: 18px;
}

.alert.danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.ds-admin-shell {
    width: 100%;
    min-height: 100vh;
    background: var(--bg);
}

.ds-admin-topbar {
    height: 76px;
    padding: 0 30px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: var(--surface);
    position: sticky;
    top: 0;
    z-index: 30;
}

.ds-admin-brand,
.ds-mobile-canvas-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    min-width: 140px;
}

.ds-admin-brand img,
.ds-mobile-canvas-brand img {
    width: auto;
    height: 36px;
    max-width: 180px;
    display: block;
    object-fit: contain;
}

.ds-admin-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.ds-user-dropdown {
    position: relative;
}

.ds-user-trigger,
.ds-mobile-menu-trigger,
.ds-mobile-canvas-close {
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--soft);
    color: var(--primary);
    cursor: pointer;
    transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.ds-mobile-menu-trigger {
    display: none;
}

.ds-user-trigger:hover,
.ds-mobile-menu-trigger:hover,
.ds-mobile-canvas-close:hover,
.ds-user-dropdown.is-open .ds-user-trigger {
    background: var(--primary-soft);
    border-color: rgba(20, 33, 61, 0.20);
    box-shadow: 0 10px 26px rgba(20, 33, 61, 0.08);
}

.ds-user-trigger:active,
.ds-mobile-menu-trigger:active,
.ds-mobile-canvas-close:active {
    transform: translateY(1px);
}

.ds-user-menu {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    width: 294px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 16px;
    box-shadow: var(--shadow);
    z-index: 60;
}

.ds-user-menu::before {
    content: '';
    position: absolute;
    top: -7px;
    left: 18px;
    width: 12px;
    height: 12px;
    background: var(--surface);
    border-top: 1px solid var(--line);
    border-right: 1px solid var(--line);
    transform: rotate(-45deg);
}

.ds-user-greeting {
    display: grid;
    gap: 3px;
    padding: 4px 2px 2px;
}

.ds-user-greeting span {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.8;
}

.ds-user-greeting strong {
    color: var(--text);
    font-size: 15px;
    line-height: 1.9;
    font-weight: 700;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.ds-user-line {
    width: 100%;
    height: 1px;
    background: var(--line);
    margin: 14px 0;
}

.ds-theme-panel {
    display: grid;
    gap: 10px;
}

.ds-theme-title {
    color: var(--text);
    font-size: 13px;
    line-height: 1.8;
    font-weight: 700;
}

.ds-theme-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.ds-theme-option {
    min-height: 66px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: var(--soft);
    color: var(--muted);
    cursor: pointer;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 12px;
    line-height: 1.6;
    font-weight: 700;
    transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.ds-theme-option:hover,
.ds-theme-option.is-active {
    background: var(--primary);
    border-color: var(--primary);
    color: #FFFFFF;
}

.ds-admin-layout {
    display: grid;
    grid-template-columns: 264px minmax(0, 1fr);
    min-height: calc(100vh - 76px);
}

.ds-admin-sidebar {
    border-left: 1px solid var(--line);
    background: var(--surface);
    padding: 18px 16px;
    min-height: calc(100vh - 76px);
    position: sticky;
    top: 76px;
    align-self: start;
}

.ds-admin-menu {
    min-height: calc(100vh - 112px);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ds-admin-menu-main,
.ds-admin-menu-bottom {
    display: grid;
    gap: 8px;
}

.ds-admin-menu-bottom {
    margin-top: auto;
}

.ds-admin-menu-item {
    min-height: 40px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    border-radius: 13px;
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    line-height: 1.7;
    font-weight: 700;
    transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.ds-admin-menu-item:hover,
.ds-admin-menu-item.is-active {
    background: var(--primary);
    color: #FFFFFF;
}

.ds-admin-menu-item:active {
    transform: translateY(1px);
}

.ds-admin-logout {
    color: var(--muted);
}

.ds-admin-menu-icon {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 24px;
}

.ds-admin-menu-icon svg,
.ds-user-trigger svg,
.ds-mobile-menu-trigger svg,
.ds-mobile-canvas-close svg,
.ds-theme-option svg,
.ds-button svg,
.ds-notice svg,
.ds-table-actions svg,
.ds-pagination svg {
    display: block;
    flex: 0 0 auto;
}

.ds-admin-content {
    padding: 28px;
    background: var(--bg);
    min-height: calc(100vh - 76px);
}

.ds-canvas-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 18, 24, 0.44);
    z-index: 80;
}

.ds-mobile-canvas {
    position: fixed;
    top: 0;
    right: 0;
    width: min(318px, calc(100vw - 44px));
    height: 100vh;
    background: var(--surface);
    border-left: 1px solid var(--line);
    box-shadow: var(--canvas-shadow);
    z-index: 90;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    transform: translateX(108%);
    transition: transform 220ms ease;
}

.ds-mobile-canvas.is-open {
    transform: translateX(0);
}

.ds-mobile-canvas-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.ds-mobile-canvas .ds-admin-menu {
    min-height: 0;
    height: 100%;
}

.ds-page-header {
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.ds-page-title {
    margin: 0;
    text-align: right;
    font-size: 22px;
    line-height: 1.8;
    font-weight: 700;
}

.ds-page-desc {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 2;
}

.ds-page-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.ds-card,
.ds-table-card {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: 0 16px 50px rgba(20, 33, 61, 0.04);
}

.ds-card {
    padding: 20px;
}

.ds-button {
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.7;
    transition: background 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.ds-button:active {
    transform: translateY(1px);
}

.ds-button-primary {
    background: var(--primary);
    color: #FFFFFF;
    border-color: var(--primary);
}

.ds-button-secondary {
    background: var(--soft);
    color: var(--text);
    border-color: var(--line);
}

.ds-button-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: transparent;
}

.ds-field {
    display: grid;
    gap: 7px;
}

.ds-field-label {
    color: var(--text);
    font-size: 13px;
    line-height: 1.8;
    font-weight: 700;
}

.ds-field input,
.ds-field select,
.ds-field textarea,
.ds-table-search input,
.ds-bulk-actions select {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 13px;
    padding: 0 13px;
    background: var(--soft);
    color: var(--text);
    outline: none;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.ds-field textarea {
    min-height: 124px;
    padding-top: 12px;
    resize: vertical;
}

.ds-field input:focus,
.ds-field select:focus,
.ds-field textarea:focus,
.ds-table-search input:focus,
.ds-bulk-actions select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(20, 33, 61, 0.08);
    background: var(--surface);
}

.ds-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 15px;
    font-size: 13px;
    line-height: 1.9;
}

.ds-notice-info {
    background: var(--info-bg);
    color: var(--info);
}

.ds-notice-success {
    background: var(--success-bg);
    color: var(--success);
}

.ds-notice-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.ds-notice-danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.ds-table-card {
    overflow: hidden;
}

.ds-table-toolbar {
    padding: 14px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.ds-table-search {
    width: min(420px, 100%);
    display: flex;
    align-items: center;
    gap: 8px;
}

.ds-table-search span {
    width: 40px;
    height: 40px;
    border-radius: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--soft);
    color: var(--muted);
    border: 1px solid var(--line);
}

.ds-table-search button,
.ds-bulk-actions button {
    min-height: 40px;
    border: 0;
    border-radius: 13px;
    padding: 0 14px;
    background: var(--primary);
    color: #FFFFFF;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
}

.ds-bulk-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ds-bulk-actions select {
    width: 180px;
    min-height: 40px;
}

.ds-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.ds-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 720px;
}

.ds-table th,
.ds-table td {
    padding: 13px 14px;
    text-align: right;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
    line-height: 1.8;
    vertical-align: middle;
    white-space: nowrap;
}

.ds-table th {
    color: var(--muted);
    font-weight: 700;
    background: var(--soft);
}

.ds-table tr:last-child td {
    border-bottom: 0;
}

.ds-table-actions,
.ds-table-actions-head {
    width: 1%;
    text-align: left !important;
}

.ds-table-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.ds-table-actions a {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    color: var(--text);
    background: var(--soft);
    text-decoration: none;
}

.ds-table-empty {
    color: var(--muted);
    text-align: center !important;
    padding: 28px 14px !important;
}

.ds-pagination {
    width: max-content;
    max-width: 100%;
    margin: 24px auto 0;
    padding: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: 0 10px 28px rgba(20, 33, 61, 0.06);
}

.ds-page-number {
    width: 36px;
    height: 36px;
    border-radius: 13px;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    background: transparent;
    text-decoration: none;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
}

.ds-page-number:hover {
    color: var(--primary);
    background: var(--soft);
    border-color: var(--line);
}

.ds-page-number.is-active {
    color: #FFFFFF;
    background: var(--primary);
    border-color: var(--primary);
}

@media (max-width: 900px) {
    .ds-admin-topbar {
        height: 70px;
        padding: 0 16px;
    }

    .ds-admin-brand {
        min-width: auto;
    }

    .ds-admin-brand img {
        height: 30px;
        max-width: 150px;
    }

    .ds-admin-actions {
        gap: 8px;
    }

    .ds-mobile-menu-trigger {
        display: inline-flex;
    }

    .ds-admin-layout {
        grid-template-columns: 1fr;
        min-height: calc(100vh - 70px);
    }

    .ds-admin-sidebar {
        display: none;
    }

    .ds-admin-content {
        padding: 18px 16px 28px;
        min-height: calc(100vh - 70px);
    }

    .ds-user-menu {
        left: 0;
        width: min(294px, calc(100vw - 32px));
    }

    .ds-page-header {
        display: grid;
        gap: 12px;
    }

    .ds-page-actions {
        justify-content: flex-start;
    }

    .ds-table-toolbar,
    .ds-table-search,
    .ds-bulk-actions {
        width: 100%;
    }

    .ds-bulk-actions select {
        flex: 1;
    }
}

@media (max-width: 640px) {
    body {
        font-size: 13px;
    }

    .page-shell {
        padding: 20px 14px;
    }

    .auth-card {
        padding: 24px;
        border-radius: 22px;
    }

    .auth-logo img {
        height: 36px;
        max-width: 180px;
    }

    .ds-admin-topbar {
        padding: 0 14px;
    }

    .ds-user-trigger,
    .ds-mobile-menu-trigger,
    .ds-mobile-canvas-close {
        width: 42px;
        height: 42px;
        border-radius: 15px;
    }

    .ds-admin-brand img {
        height: 28px;
        max-width: 138px;
    }

    .ds-mobile-canvas-brand {
        min-width: auto;
    }

    .ds-mobile-canvas-brand img {
        height: 28px;
        max-width: 138px;
    }

    .ds-user-menu {
        top: calc(100% + 10px);
        width: min(292px, calc(100vw - 28px));
    }

    .ds-mobile-canvas {
        width: min(304px, calc(100vw - 32px));
        padding: 16px;
    }

    .ds-button,
    .ds-table-search button,
    .ds-bulk-actions button {
        min-height: 40px;
    }
}

.ds-admin-menu-label {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ds-admin-menu-group {
    border-radius: 14px;
    overflow: hidden;
}

.ds-admin-menu-group summary {
    list-style: none;
}

.ds-admin-menu-group summary::-webkit-details-marker {
    display: none;
}

.ds-admin-menu-summary {
    cursor: pointer;
    width: 100%;
}

.ds-admin-menu-caret {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: auto;
    flex: 0 0 20px;
}

.ds-caret-up {
    display: none;
}

.ds-admin-menu-group[open] {
    background: var(--primary);
}

.ds-admin-menu-group[open] .ds-admin-menu-summary,
.ds-admin-menu-group.is-active .ds-admin-menu-summary {
    background: var(--primary);
    color: #FFFFFF;
}

.ds-admin-menu-group[open] .ds-caret-down {
    display: none;
}

.ds-admin-menu-group[open] .ds-caret-up {
    display: inline-flex;
}

.ds-admin-submenu {
    display: grid;
    gap: 4px;
    padding: 0 10px 10px;
    background: var(--primary);
}

.ds-admin-submenu-item {
    min-height: 36px;
    border-radius: 11px;
    padding: 0 10px;
    display: flex;
    align-items: center;
    gap: 9px;
    color: rgba(255, 255, 255, 0.84);
    text-decoration: none;
    font-size: 13px;
    line-height: 1.7;
    font-weight: 700;
    transition: background 160ms ease, color 160ms ease;
}

.ds-admin-submenu-item:hover,
.ds-admin-submenu-item.is-active {
    background: rgba(255, 255, 255, 0.12);
    color: #FFFFFF;
}

.ds-page-stack {
    display: grid;
    gap: 16px;
}

.ds-plugin-compare h2,
.ds-modal-head h2 {
    margin: 0;
    color: var(--text);
    font-size: 18px;
    line-height: 1.8;
    font-weight: 700;
    text-align: right;
}

.ds-plugin-compare p,
.ds-modal-head p,
.ds-compare-box p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 2;
}

.ds-compare-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.ds-compare-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.ds-compare-box {
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 16px;
    background: var(--soft);
}

.ds-compare-label {
    display: block;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.8;
    font-weight: 700;
    margin-bottom: 6px;
}

.ds-compare-box strong {
    color: var(--text);
    font-size: 15px;
    line-height: 1.9;
    font-weight: 700;
}

.ds-compare-box ul {
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 5px;
}

.ds-compare-box li {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.8;
}

.ds-compare-box b {
    color: var(--text);
    font-weight: 700;
}

.ds-plugins-table .ds-plugin-desc {
    white-space: normal;
    min-width: 260px;
}

.ds-plugin-title-cell {
    display: grid;
    gap: 2px;
}

.ds-plugin-title-cell strong {
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.8;
}

.ds-plugin-title-cell span {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
}

.ds-status-badge {
    min-height: 28px;
    padding: 0 10px;
    border-radius: 99px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    line-height: 1.6;
    font-weight: 700;
}

.ds-status-badge.is-active {
    background: var(--success-bg);
    color: var(--success);
}

.ds-status-badge.is-inactive {
    background: var(--soft);
    color: var(--muted);
    border: 1px solid var(--line);
}

.ds-status-badge.is-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.ds-plugin-row-actions form {
    margin: 0;
}

.ds-table-actions button,
.ds-table-actions a {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    color: var(--text);
    background: var(--soft);
    border: 0;
    text-decoration: none;
    cursor: pointer;
}

.ds-row-muted {
    color: var(--muted);
}

.ds-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 18, 24, 0.48);
    z-index: 120;
}

.ds-modal {
    position: fixed;
    inset: 0;
    z-index: 130;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
}

.ds-modal-dialog {
    width: min(520px, 100%);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: var(--shadow);
    padding: 20px;
}

.ds-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.ds-modal-close {
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--soft);
    color: var(--primary);
    cursor: pointer;
    flex: 0 0 40px;
}

.ds-upload-form {
    display: grid;
    gap: 16px;
}

.ds-upload-box {
    min-height: 170px;
    border: 1px dashed rgba(20, 33, 61, 0.28);
    border-radius: 20px;
    background: var(--soft);
    display: grid;
    place-items: center;
    text-align: center;
    gap: 6px;
    padding: 20px;
    cursor: pointer;
    color: var(--text);
}

.ds-upload-icon {
    width: 52px;
    height: 52px;
    border-radius: 17px;
    background: var(--primary-soft);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ds-upload-box strong {
    font-size: 15px;
    line-height: 1.8;
}

.ds-upload-box small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.8;
}

.ds-upload-box input {
    width: 100%;
    max-width: 280px;
    color: var(--muted);
}

.ds-modal-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

@media (max-width: 900px) {
    .ds-compare-head,
    .ds-compare-grid {
        display: grid;
        grid-template-columns: 1fr;
    }

    .ds-modal {
        align-items: flex-end;
        padding: 14px;
    }

    .ds-modal-dialog {
        border-radius: 22px;
    }
}

@media (max-width: 640px) {
    .ds-modal-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .ds-modal-actions .ds-button {
        width: 100%;
    }
}

.ds-plugin-actions-inline {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ds-plugin-actions-inline form {
    display: inline-flex;
    margin: 0;
}

.ds-plugin-actions-inline button {
    border: 0;
    background: transparent;
    color: var(--primary);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    padding: 0;
}

.ds-plugin-actions-inline button:hover {
    text-decoration: underline;
}

.ds-plugin-meta-line {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.ds-plugin-meta-line span:not(:last-child)::after {
    content: '';
    width: 4px;
    height: 4px;
    border-radius: 999px;
    background: currentColor;
    display: inline-block;
    margin-right: 10px;
    opacity: .45;
}

.ds-status-text.is-active {
    color: var(--primary);
}

.ds-auto-update-muted {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.ds-plugins-table tr.is-plugin-active td:first-child {
    position: relative;
    border-right: 4px solid var(--primary);
    border-start-start-radius: 16px;
    border-start-end-radius: 0;
    border-end-start-radius: 16px;
    border-end-end-radius: 0;
    overflow: hidden;
    background-clip: padding-box;
}

.ds-plugins-table tr.is-plugin-active td:first-child::before {
    content: '';
    position: absolute;
    inset-block: 8px;
    inset-inline-start: 0;
    width: 4px;
    border-radius: 999px;
    background: var(--primary);
}

.ds-plugins-table tr.is-plugin-active td:first-child + td {
    border-start-start-radius: 0;
    border-end-start-radius: 0;
}

.ds-admin-menu-group[open] .ds-admin-submenu-item,
.ds-admin-menu-group.is-active .ds-admin-submenu-item {
    color: rgba(255, 255, 255, 0.88);
}

@media (max-width: 700px) {
    .ds-plugins-table thead {
        display: none;
    }

    .ds-plugins-table,
    .ds-plugins-table tbody,
    .ds-plugins-table tr,
    .ds-plugins-table td {
        display: block;
        width: 100%;
    }

    .ds-plugins-table tr {
        border-bottom: 1px solid var(--line);
    }

    .ds-plugins-table td {
        border-bottom: 0;
        padding: 12px 14px;
    }
}

/* Dorsino unified plugin manager refinements */
html[data-color-scheme="dark"] {
    --muted: #FFFFFF;
}

html[data-color-scheme="dark"] .ds-admin-shell,
html[data-color-scheme="dark"] .ds-admin-shell a,
html[data-color-scheme="dark"] .ds-admin-shell button,
html[data-color-scheme="dark"] .ds-admin-shell svg,
html[data-color-scheme="dark"] .ds-user-menu,
html[data-color-scheme="dark"] .ds-user-menu svg,
html[data-color-scheme="dark"] .ds-modal,
html[data-color-scheme="dark"] .ds-modal svg,
html[data-color-scheme="dark"] .ds-table,
html[data-color-scheme="dark"] .ds-table svg,
html[data-color-scheme="dark"] .ds-card,
html[data-color-scheme="dark"] .ds-card svg {
    color: #FFFFFF;
}

html[data-color-scheme="dark"] .ds-user-trigger,
html[data-color-scheme="dark"] .ds-mobile-menu-trigger,
html[data-color-scheme="dark"] .ds-mobile-canvas-close,
html[data-color-scheme="dark"] .ds-modal-close,
html[data-color-scheme="dark"] .ds-upload-icon,
html[data-color-scheme="dark"] .ds-table-search span,
html[data-color-scheme="dark"] .ds-table-actions button,
html[data-color-scheme="dark"] .ds-row-action {
    color: #FFFFFF;
}

html[data-color-scheme="dark"] .ds-status-badge,
html[data-color-scheme="dark"] .ds-notice,
html[data-color-scheme="dark"] .ds-notice svg {
    color: #FFFFFF;
}

.ds-plugin-toolbar {
    align-items: center;
}

.ds-check-column {
    width: 44px;
    text-align: center !important;
}

.ds-check-column input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.ds-plugins-table .ds-plugin-desc {
    white-space: normal;
    min-width: 320px;
    color: var(--text);
    line-height: 2;
}

.ds-plugins-table th,
.ds-plugins-table td {
    vertical-align: top;
}

.ds-row-actions-wrap {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.ds-row-actions-wrap form {
    margin: 0;
}

.ds-row-action {
    min-height: 34px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--soft);
    color: var(--text);
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.6;
    transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.ds-row-action:hover {
    background: var(--primary);
    color: #FFFFFF;
    border-color: var(--primary);
}

.ds-row-action.is-danger:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: #FFFFFF;
}

.ds-compare-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.ds-compare-actions form {
    margin: 0;
}

.ds-compare-single {
    max-width: 620px;
}

.ds-plugin-title-cell strong {
    font-size: 14px;
    line-height: 1.9;
}

.ds-table-search {
    margin-right: auto;
}

.ds-bulk-actions {
    margin-left: auto;
}

@media (max-width: 900px) {
    .ds-plugin-toolbar {
        display: grid;
        grid-template-columns: 1fr;
    }

    .ds-table-search,
    .ds-bulk-actions {
        margin: 0;
    }

    .ds-table-search {
        order: 1;
    }

    .ds-bulk-actions {
        order: 2;
    }

    .ds-compare-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 700px) {
    .ds-plugins-table .ds-check-column {
        display: none;
    }

    .ds-plugins-table td:nth-child(2)::before { content: 'افزونه'; }
    .ds-plugins-table td:nth-child(3)::before { content: 'توضیحات'; }
    .ds-plugins-table td:nth-child(4)::before { content: 'نسخه'; }
    .ds-plugins-table td:nth-child(5)::before { content: 'نویسنده'; }
    .ds-plugins-table td:nth-child(6)::before { content: 'وضعیت'; }
    .ds-plugins-table td:nth-child(7)::before { content: 'عملیات'; }

    .ds-plugins-table td::before {
        display: block;
        color: var(--muted);
        font-size: 12px;
        font-weight: 700;
        margin-bottom: 4px;
    }

    .ds-row-actions-wrap {
        justify-content: flex-start;
    }
}

/* Dorsino plugin manager final refinements */
.ds-compare-single {
    width: 100%;
    max-width: none;
}

html[data-color-scheme="dark"] .ds-admin-shell,
html[data-color-scheme="dark"] .ds-admin-shell *,
html[data-color-scheme="dark"] .ds-admin-shell svg,
html[data-color-scheme="dark"] .ds-admin-shell svg * {
    color: #FFFFFF;
    stroke: currentColor;
}

html[data-color-scheme="dark"] .ds-admin-shell input,
html[data-color-scheme="dark"] .ds-admin-shell select,
html[data-color-scheme="dark"] .ds-admin-shell textarea {
    color: #FFFFFF;
    background: var(--soft);
    border-color: var(--line);
}

html[data-color-scheme="dark"] .ds-admin-shell input::placeholder,
html[data-color-scheme="dark"] .ds-admin-shell textarea::placeholder {
    color: rgba(255, 255, 255, 0.58);
}

html[data-color-scheme="dark"] .ds-button-primary,
html[data-color-scheme="dark"] .ds-admin-menu-item.is-active,
html[data-color-scheme="dark"] .ds-admin-menu-item:hover,
html[data-color-scheme="dark"] .ds-admin-menu-group[open],
html[data-color-scheme="dark"] .ds-admin-menu-group[open] .ds-admin-menu-summary,
html[data-color-scheme="dark"] .ds-admin-menu-group.is-active .ds-admin-menu-summary {
    color: #FFFFFF;
}

html[data-color-scheme="dark"] .ds-status-badge.is-active,
html[data-color-scheme="dark"] .ds-status-badge.is-inactive,
html[data-color-scheme="dark"] .ds-status-badge.is-warning {
    color: #FFFFFF;
}

/* Dorsino smooth visual refinements - no movement effects */
:root {
    --soft: #F8F9FB;
    --line: #EEF1F5;
    --shadow: 0 18px 54px rgba(20, 33, 61, 0.075);
    --canvas-shadow: -18px 0 52px rgba(20, 33, 61, 0.14);
}

html[data-color-scheme="dark"] {
    --line: rgba(255, 255, 255, 0.12);
    --shadow: 0 18px 54px rgba(0, 0, 0, 0.28);
}

.ds-card,
.ds-table-card,
.auth-card,
.ds-user-menu,
.ds-modal-dialog,
.ds-compare-box {
    border-color: var(--line);
    box-shadow: 0 14px 42px rgba(20, 33, 61, 0.045);
}

.ds-admin-topbar,
.ds-admin-sidebar,
.ds-mobile-canvas {
    border-color: var(--line);
}

.ds-admin-menu-item,
.ds-admin-submenu-item,
.ds-button,
.ds-row-action,
.ds-theme-option,
.ds-user-trigger,
.ds-mobile-menu-trigger,
.ds-mobile-canvas-close,
.ds-modal-close,
.ds-table-search span,
.ds-table-search button,
.ds-bulk-actions button,
.form-stack button,
.simple-link {
    transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease, box-shadow 180ms ease, opacity 180ms ease !important;
}

.ds-admin-menu-item:active,
.ds-user-trigger:active,
.ds-mobile-menu-trigger:active,
.ds-mobile-canvas-close:active,
.ds-button:active,
.ds-row-action:active {
    transform: none !important;
}

.ds-admin-menu-item,
.ds-admin-submenu-item {
    border-radius: 15px;
}

.ds-admin-menu-item:hover,
.ds-admin-menu-item.is-active,
.ds-row-action:hover,
.ds-button-secondary:hover,
.ds-theme-option:hover {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.ds-button-primary:hover,
.ds-table-search button:hover,
.ds-bulk-actions button:hover,
.form-stack button:hover,
.simple-link:hover {
    opacity: 0.94;
}

.ds-table tbody tr {
    transition: background-color 180ms ease;
}

.ds-table tbody tr:hover {
    background: var(--primary-soft);
}

.ds-field input,
.ds-field select,
.ds-field textarea,
.ds-table-search input,
.ds-bulk-actions select,
.form-stack input {
    transition: background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease, color 180ms ease;
}

html[data-color-scheme="dark"] .ds-admin-shell,
html[data-color-scheme="dark"] .ds-admin-shell *,
html[data-color-scheme="dark"] .ds-admin-shell svg,
html[data-color-scheme="dark"] .ds-admin-shell svg *,
html[data-color-scheme="dark"] .ds-page-shell,
html[data-color-scheme="dark"] .ds-page-shell *,
html[data-color-scheme="dark"] .page-shell,
html[data-color-scheme="dark"] .page-shell *,
html[data-color-scheme="dark"] .ds-modal,
html[data-color-scheme="dark"] .ds-modal *,
html[data-color-scheme="dark"] .ds-modal svg,
html[data-color-scheme="dark"] .ds-modal svg * {
    color: #FFFFFF;
    stroke: currentColor;
}

html[data-color-scheme="dark"] .ds-button-primary,
html[data-color-scheme="dark"] .ds-table-search button,
html[data-color-scheme="dark"] .ds-bulk-actions button,
html[data-color-scheme="dark"] .form-stack button,
html[data-color-scheme="dark"] .simple-link,
html[data-color-scheme="dark"] .ds-admin-menu-item:hover,
html[data-color-scheme="dark"] .ds-admin-menu-item.is-active,
html[data-color-scheme="dark"] .ds-admin-menu-group[open] .ds-admin-menu-summary,
html[data-color-scheme="dark"] .ds-admin-menu-group.is-active .ds-admin-menu-summary,
html[data-color-scheme="dark"] .ds-admin-menu-group[open] .ds-admin-submenu-item,
html[data-color-scheme="dark"] .ds-admin-menu-group.is-active .ds-admin-submenu-item {
    color: #FFFFFF;
}

html[data-color-scheme="dark"] .ds-notice,
html[data-color-scheme="dark"] .ds-status-badge {
    color: #FFFFFF;
}

/* Dorsino unified submenu and row action architecture */
.ds-admin-submenu-item .ds-admin-menu-icon {
    width: 18px;
    height: 18px;
    flex-basis: 18px;
}

.ds-admin-submenu-item .ds-admin-menu-icon svg {
    width: 10px;
    height: 10px;
}

.ds-plugin-row-actions,
.ds-table-actions,
.ds-table-actions-head {
    width: 1%;
    min-width: 116px;
    text-align: center !important;
    vertical-align: middle !important;
}

.ds-row-actions-wrap,
.ds-table-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.ds-icon-action {
    position: relative;
    width: 36px;
    height: 36px;
    min-width: 36px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--soft);
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
    padding: 0;
    font: inherit;
    transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.ds-icon-action:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #FFFFFF;
}

.ds-icon-action-danger:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: #FFFFFF;
}

.ds-icon-action svg,
.ds-icon-action svg * {
    display: block;
    stroke: currentColor;
}

.ds-icon-action[data-tooltip]::before,
.ds-icon-action[data-tooltip]::after {
    position: absolute;
    left: 50%;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity 160ms ease, visibility 160ms ease;
    z-index: 250;
}

.ds-icon-action[data-tooltip]::before {
    content: attr(data-tooltip);
    bottom: calc(100% + 9px);
    transform: translateX(-50%);
    background: #25272C;
    color: #FFFFFF;
    border-radius: 10px;
    padding: 5px 9px;
    font-size: 12px;
    line-height: 1.7;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 10px 24px rgba(15, 18, 24, 0.16);
}

.ds-icon-action[data-tooltip]::after {
    content: '';
    bottom: calc(100% + 4px);
    transform: translateX(-50%) rotate(45deg);
    width: 9px;
    height: 9px;
    background: #25272C;
}

.ds-icon-action[data-tooltip]:hover::before,
.ds-icon-action[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}

html[data-color-scheme="dark"] .ds-icon-action,
html[data-color-scheme="dark"] .ds-icon-action svg,
html[data-color-scheme="dark"] .ds-icon-action svg * {
    color: #FFFFFF;
    stroke: currentColor;
}

html[data-color-scheme="dark"] .ds-icon-action[data-tooltip]::before,
html[data-color-scheme="dark"] .ds-icon-action[data-tooltip]::after {
    background: #FFFFFF;
    color: #25272C;
}

@media (max-width: 700px) {
    .ds-plugin-row-actions,
    .ds-table-actions,
    .ds-table-actions-head {
        width: 100%;
        min-width: 0;
        text-align: right !important;
    }

    .ds-row-actions-wrap,
    .ds-table-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

/* Dorsino table overflow fix */
.ds-table-card,
.ds-table-wrap {
    max-width: 100%;
}

.ds-table-wrap {
    overflow: visible;
}

.ds-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
}

.ds-table th,
.ds-table td {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
}

.ds-check-column {
    width: 44px;
    min-width: 44px;
    max-width: 44px;
    text-align: center !important;
    white-space: nowrap !important;
}

.ds-table-actions,
.ds-plugin-row-actions,
.ds-table-actions-head {
    width: 108px;
    min-width: 108px;
    max-width: 108px;
    text-align: center !important;
    white-space: nowrap !important;
}

.ds-table-actions {
    display: table-cell !important;
    vertical-align: middle !important;
}

.ds-table-actions .ds-row-actions-wrap,
.ds-plugin-row-actions .ds-row-actions-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: nowrap;
    width: auto;
    max-width: 100%;
}

.ds-table-actions > .ds-icon-action,
.ds-table-actions > a,
.ds-table-actions > button {
    margin-inline: 3px;
}

.ds-plugins-table {
    table-layout: fixed;
}

.ds-plugins-table th:nth-child(1),
.ds-plugins-table td:nth-child(1) {
    width: 44px;
}

.ds-plugins-table th:nth-child(2),
.ds-plugins-table td:nth-child(2) {
    width: 18%;
}

.ds-plugins-table th:nth-child(4),
.ds-plugins-table td:nth-child(4) {
    width: 90px;
}

.ds-plugins-table th:nth-child(5),
.ds-plugins-table td:nth-child(5) {
    width: 120px;
}

.ds-plugins-table th:nth-child(6),
.ds-plugins-table td:nth-child(6) {
    width: 118px;
}

.ds-plugins-table th:nth-child(7),
.ds-plugins-table td:nth-child(7) {
    width: 108px;
}

.ds-plugins-table .ds-plugin-desc {
    min-width: 0;
    max-width: none;
}

.ds-status-badge {
    max-width: 100%;
    white-space: nowrap;
}

@media (max-width: 700px) {
    .ds-table {
        table-layout: auto;
    }

    .ds-table th,
    .ds-table td {
        padding: 11px 10px;
        font-size: 12px;
    }

    .ds-table-actions,
    .ds-plugin-row-actions,
    .ds-table-actions-head {
        width: 96px;
        min-width: 96px;
        max-width: 96px;
        text-align: center !important;
    }

    .ds-row-actions-wrap,
    .ds-table-actions .ds-row-actions-wrap,
    .ds-plugin-row-actions .ds-row-actions-wrap {
        justify-content: center;
        flex-wrap: nowrap;
        gap: 6px;
    }

    .ds-icon-action {
        width: 32px;
        height: 32px;
        min-width: 32px;
        border-radius: 10px;
    }
}

/* Compact operation menu architecture */
.ds-table-card,
.ds-table-wrap,
.ds-table,
.ds-table tbody,
.ds-table tr,
.ds-table td,
.ds-plugin-row-actions,
.ds-table-actions {
    overflow: visible;
}

.ds-plugin-row-actions,
.ds-table-actions,
.ds-table-actions-head {
    width: 72px !important;
    min-width: 72px !important;
    max-width: 72px !important;
    text-align: center !important;
    vertical-align: middle !important;
    white-space: nowrap !important;
}

.ds-table-actions,
.ds-plugin-row-actions {
    display: table-cell !important;
    position: relative;
}

.ds-action-menu {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    min-width: 38px;
    overflow: visible;
}

.ds-action-menu-trigger {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    font: inherit;
}

.ds-action-menu-trigger:hover,
.ds-action-menu.is-open .ds-action-menu-trigger {
    background: var(--primary);
    border-color: var(--primary);
    color: #FFFFFF;
}

.ds-action-menu-trigger svg,
.ds-action-menu-trigger svg * {
    stroke: currentColor;
}

.ds-action-menu-panel {
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    right: auto;
    inset-inline-end: auto;
    width: max-content;
    min-width: 168px;
    max-width: calc(100vw - 24px);
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: 0 18px 44px rgba(15, 18, 24, 0.14);
    text-align: right;
    transform: none !important;
}

.ds-action-menu-panel[hidden] {
    display: none !important;
}

.ds-action-menu-panel form {
    margin: 0;
}

.ds-action-menu-item {
    width: 100%;
    min-height: 38px;
    padding: 0 10px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 9px;
    text-decoration: none;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    line-height: 1.8;
    font-weight: 700;
    white-space: nowrap;
    text-align: right;
}

.ds-action-menu-item:hover,
.ds-action-menu-item:focus-visible {
    background: var(--soft);
    color: var(--primary);
    outline: none;
}

.ds-action-menu-item-danger:hover,
.ds-action-menu-item-danger:focus-visible,
.ds-action-menu-item-danger:hover svg,
.ds-action-menu-item-danger:focus-visible svg {
    color: var(--danger);
}

.ds-action-menu-item svg,
.ds-action-menu-item svg * {
    width: 18px;
    height: 18px;
    min-width: 18px;
    stroke: currentColor;
}

.ds-plugins-table th:nth-child(7),
.ds-plugins-table td:nth-child(7) {
    width: 72px !important;
}

html[data-color-scheme="dark"] .ds-action-menu-trigger,
html[data-color-scheme="dark"] .ds-action-menu-trigger svg,
html[data-color-scheme="dark"] .ds-action-menu-trigger svg *,
html[data-color-scheme="dark"] .ds-action-menu-panel,
html[data-color-scheme="dark"] .ds-action-menu-panel *,
html[data-color-scheme="dark"] .ds-action-menu-panel svg,
html[data-color-scheme="dark"] .ds-action-menu-panel svg * {
    color: #FFFFFF;
    stroke: currentColor;
}

html[data-color-scheme="dark"] .ds-action-menu-panel {
    background: var(--surface);
    border-color: var(--line);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
}

html[data-color-scheme="dark"] .ds-action-menu-item:hover,
html[data-color-scheme="dark"] .ds-action-menu-item:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    color: #FFFFFF;
}

html[data-color-scheme="dark"] .ds-action-menu-item-danger:hover,
html[data-color-scheme="dark"] .ds-action-menu-item-danger:focus-visible {
    color: #FFFFFF;
    background: rgba(220, 38, 38, 0.22);
}

@media (max-width: 700px) {
    .ds-plugin-row-actions,
    .ds-table-actions,
    .ds-table-actions-head {
        width: 64px !important;
        min-width: 64px !important;
        max-width: 64px !important;
    }

    .ds-action-menu-panel {
        min-width: 160px;
    }
}

/* Dorsino enforced row operation menu */
.ds-table th.ds-table-actions-head,
.ds-table th:last-child:where(.ds-table-actions-head),
.ds-table td.ds-table-actions,
.ds-table td.ds-plugin-row-actions {
    width: 64px !important;
    min-width: 64px !important;
    max-width: 64px !important;
    text-align: center !important;
    vertical-align: middle !important;
}

.ds-table td.ds-table-actions > .ds-row-actions-wrap,
.ds-table td.ds-plugin-row-actions > .ds-row-actions-wrap {
    max-width: 64px;
    margin-inline: auto;
}

.ds-action-menu-panel .ds-row-action,
.ds-action-menu-panel .ds-icon-action,
.ds-action-menu-panel .ds-button,
.ds-action-menu-panel a,
.ds-action-menu-panel button:not(.ds-action-menu-trigger) {
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 38px !important;
    padding: 0 10px !important;
    border: 0 !important;
    border-radius: 12px !important;
    background: transparent !important;
    color: var(--text) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 9px !important;
    box-shadow: none !important;
    transform: none !important;
    text-decoration: none !important;
    font-size: 13px !important;
    line-height: 1.8 !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
    text-align: right !important;
}

.ds-action-menu-panel .ds-row-action:hover,
.ds-action-menu-panel .ds-icon-action:hover,
.ds-action-menu-panel .ds-button:hover,
.ds-action-menu-panel a:hover,
.ds-action-menu-panel button:not(.ds-action-menu-trigger):hover {
    background: var(--soft) !important;
    color: var(--primary) !important;
}

.ds-action-menu-panel .ds-row-action.is-danger,
.ds-action-menu-panel .ds-action-menu-item-danger,
.ds-action-menu-panel .is-danger {
    color: var(--danger) !important;
}

.ds-action-menu-panel svg,
.ds-action-menu-panel svg * {
    width: 18px;
    height: 18px;
    min-width: 18px;
    stroke: currentColor;
}

.ds-action-menu-panel form {
    width: 100%;
    margin: 0 !important;
}

html[data-color-scheme="dark"] .ds-action-menu-panel .ds-row-action,
html[data-color-scheme="dark"] .ds-action-menu-panel .ds-icon-action,
html[data-color-scheme="dark"] .ds-action-menu-panel .ds-button,
html[data-color-scheme="dark"] .ds-action-menu-panel a,
html[data-color-scheme="dark"] .ds-action-menu-panel button:not(.ds-action-menu-trigger) {
    color: #FFFFFF !important;
}


/* Dorsino fixed action-menu placement: menus float above layout and never stretch tables */
.ds-table th.ds-table-actions-head,
.ds-table td.ds-table-actions,
.ds-table td.ds-plugin-row-actions,
.ds-plugins-table th:nth-child(7),
.ds-plugins-table td:nth-child(7) {
    width: 64px !important;
    min-width: 64px !important;
    max-width: 64px !important;
    text-align: center !important;
    vertical-align: middle !important;
    white-space: nowrap !important;
    overflow: visible !important;
}

.ds-action-menu {
    margin-inline: auto !important;
}

.ds-action-menu-panel {
    pointer-events: auto;
}

.ds-action-menu-panel[hidden] {
    display: none !important;
}

.ds-action-menu-panel form,
.ds-action-menu-panel .ds-action-menu-item {
    width: 100% !important;
}

@media (max-width: 700px) {
    .ds-table th.ds-table-actions-head,
    .ds-table td.ds-table-actions,
    .ds-table td.ds-plugin-row-actions,
    .ds-plugins-table th:nth-child(7),
    .ds-plugins-table td:nth-child(7) {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        text-align: right !important;
    }

    .ds-action-menu {
        margin-inline: 0 !important;
    }
}


/* Dorsino plugin active row final polish */
.ds-table-card .ds-plugins-table {
    border-radius: 18px;
    overflow: hidden;
}

.ds-plugins-table tr.is-plugin-active td:first-child {
    border-start-start-radius: 16px !important;
    border-end-start-radius: 16px !important;
}

.ds-plugins-table tr.is-plugin-active td:first-child::before {
    inset-inline-start: 0 !important;
}

html[dir="rtl"] .ds-plugins-table tr.is-plugin-active td:first-child,
body[dir="rtl"] .ds-plugins-table tr.is-plugin-active td:first-child,
.ds-admin-shell[dir="rtl"] .ds-plugins-table tr.is-plugin-active td:first-child {
    border-top-right-radius: 16px !important;
    border-bottom-right-radius: 16px !important;
}
