/* --- Directory Main Container --- */
.main-container {
    padding: 32px 48px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    flex: 1;
}

/* --- Toolbar (Search & Filters) --- */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.search-input {
    width: 350px;
    padding: 10px 16px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(33, 37, 41, 0.1);
}

.active-filters {
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 13px;
    color: #495057;
}

.filter-tag {
    background: #dc3545;
    color: #fff;
    padding: 4px 10px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.clear-btn {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    text-decoration: underline;
    font-size: 13px;
}

/* --- Data Table --- */
.table-wrapper {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow-x: auto;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

[dir="rtl"] .data-table {
    text-align: right;
}

.data-table th {
    background: var(--bg-color);
    padding: 12px 16px;
    font-size: 13px;
    color: #495057;
    border-bottom: 2px solid var(--border-color);
    cursor: pointer;
    user-select: none;
    font-weight: 600;
    white-space: nowrap;
}

.data-table th:hover {
    background: var(--border-light);
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background: var(--bg-color);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.desc-col {
    max-width: 350px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-muted);
}

.name-cell {
    font-weight: 600;
}

/* --- Interactive Elements in Table --- */
.sort-icon {
    display: inline-block;
    width: 12px;
    font-size: 14px;
    opacity: 0.6;
    margin-inline-start: 4px;
}

.clickable {
    color: var(--link-color);
    cursor: pointer;
    font-weight: 500;
    transition: color 0.2s;
}

.clickable:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

/* رابط فتح صفحة الصانع */
.action-builder {
    color: inherit;
    text-decoration: none;
    display: block;
    cursor: pointer;
    transition: color 0.2s;
}

.action-builder:hover {
    color: var(--link-color);
}

/* زر السحب الصغير في الجدول */
.btn-drag-sm {
    display: inline-flex;
    align-items: center;
    background: var(--primary-color);
    color: #fff;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: grab;
    transition: 0.2s;
    white-space: nowrap;
}

.btn-drag-sm::before {
    content: attr(data-drag-text);
    /* هيعرض النص اللي جاي من الترجمة هنا */
}

.btn-drag-sm:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-drag-sm:active {
    cursor: grabbing;
}

.btn-drag-sm::after {
    content: '\2261';
    margin-inline-start: 8px;
    font-size: 16px;
    font-weight: 300;
}