/* ═══════════════════════════════════════════════════════════
   Zuwad Workflow Board — CSS
   Colors: #820c22 (primary), #fac40d (gold), black
   RTL Arabic layout
═══════════════════════════════════════════════════════════ */

/* ── Root & Reset ── */
#zuwad-workflow-board {
    direction: rtl;
    max-width: 100%;
    margin: 0 auto;
    padding: 24px 16px 100px;
    background: #f4f5f7;
    min-height: 80vh;
    box-sizing: border-box;
}

#zuwad-workflow-board *,
#zuwad-workflow-board *::before,
#zuwad-workflow-board *::after {
    box-sizing: border-box;
    font-family: 'Qatar';
}

/* ── Header ── */
.workflow-header {
    margin-bottom: 20px;
}

.workflow-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.workflow-page-title {
    font-size: 24px;
    font-weight: 700;
    color: #820c22;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.workflow-page-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 28px;
    background: #820c22;
    border-radius: 2px;
}

/* ── Admin Buttons ── */
.workflow-admin-btns {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-wf-admin {
    padding: 9px 18px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-wf-sections {
    background: #820c22;
    color: white;
    box-shadow: 0 2px 8px rgba(130, 12, 34, 0.3);
}
.btn-wf-sections:hover {
    background: #a50e2a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(130, 12, 34, 0.4);
}

.btn-wf-roles {
    background: #fac40d;
    color: #1a1a1a;
    box-shadow: 0 2px 8px rgba(250, 196, 13, 0.35);
}
.btn-wf-roles:hover {
    background: #e6b309;
    transform: translateY(-1px);
}

/* ── Section Tabs ── */
.workflow-section-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 0;
}

.workflow-tab {
    padding: 10px 20px;
    border: none;
    border-bottom: 3px solid transparent;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #555;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 7px;
    position: relative;
    bottom: -2px;
    border-radius: 6px 6px 0 0;
}

.workflow-tab:hover {
    color: #820c22;
    background: rgba(130, 12, 34, 0.05);
}

.workflow-tab.active {
    color: #820c22;
    border-bottom-color: #820c22;
    background: white;
}

.workflow-tab-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
}

.workflow-tab-count {
    background: #e0e0e0;
    color: #555;
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: bold;
}
.workflow-tab.active .workflow-tab-count {
    background: #820c22;
    color: white;
}

/* ── Filters Bar ── */
.workflow-filters-bar {
    background: white;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    border: 1px solid #e8e8e8;
}

.wf-filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: stretch;
}

.wf-date-row {
    padding-top: 12px;
    margin-top: 12px;
    border-top: 1px solid #f0f0f0;
}

/* ── Unified height for all filter row elements ── */
.wf-filter-search,
.wf-filter-select,
.wf-toggle-advanced-btn,
.wf-reset-btn {
    height: 38px;
    box-sizing: border-box;
}

/* Search group */
.wf-filter-search {
    flex: 1;
    min-width: 200px;
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 0 10px;
    gap: 6px;
    transition: border-color 0.2s;
}
.wf-filter-search:focus-within {
    border-color: #820c22;
    box-shadow: 0 0 0 3px rgba(130,12,34,0.08);
}
.wf-filter-icon { font-size: 14px; flex-shrink: 0; color: #aaa; }

.wf-filter-search input[type="text"] {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0;
    height: 100%;
    font-size: 14px;
    outline: none;
    direction: rtl;
    font-family: inherit;
    line-height: 38px;
    margin: 0;
}

.wf-clear-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: #aaa;
    line-height: 1;
    padding: 0 2px;
    flex-shrink: 0;
    transition: color 0.15s;
}
.wf-clear-btn:hover { color: #820c22; }

/* Select filters */
.wf-filter-group { display: flex; align-items: center; gap: 6px; }

.wf-filter-select {
    padding: 0 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 13px;
    background: white;
    color: #333;
    cursor: pointer;
    direction: rtl;
    font-family: inherit;
    transition: border-color 0.2s;
    min-width: 130px;
    appearance: auto;
}
.wf-filter-select:focus {
    outline: none;
    border-color: #820c22;
}

/* Highlight active selects */
.wf-filter-select.has-value {
    border-color: #820c22;
    background: #fff5f5;
    color: #820c22;
    font-weight: 600;
}

.wf-sort-dir { min-width: 100px; }

/* Toggle advanced button */
.wf-toggle-advanced-btn {
    padding: 0 14px;
    border: 1px dashed #aaa;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    color: #666;
    transition: all 0.2s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.wf-toggle-advanced-btn:hover {
    border-color: #820c22;
    color: #820c22;
    background: #fff5f5;
}

/* Reset button */
.wf-reset-btn {
    padding: 0 14px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #f8f9fa;
    cursor: pointer;
    font-size: 13px;
    color: #666;
    transition: all 0.2s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
}
.wf-reset-btn:hover {
    background: #fde8e8;
    color: #820c22;
    border-color: #f5b7b1;
}

/* Advanced date section */
.wf-advanced-filters { overflow: hidden; }

.wf-date-label {
    font-size: 13px;
    font-weight: 600;
    color: #555;
    white-space: nowrap;
}

.wf-date-range {
    display: flex;
    align-items: center;
    gap: 6px;
}

.wf-date-input {
    height: 38px;
    padding: 0 10px;
    border: 1px solid #ddd;
    border-radius: 7px;
    font-size: 13px;
    direction: rtl;
    font-family: inherit;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.wf-date-input:focus {
    outline: none;
    border-color: #820c22;
}

.wf-date-sep { color: #aaa; font-size: 13px; }

/* Active filters summary */
.wf-active-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 10px;
    margin-top: 10px;
    border-top: 1px dashed #e8e8e8;
}

.wf-filter-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: #fff5f5;
    border: 1px solid #f5c6c6;
    border-radius: 14px;
    font-size: 12px;
    color: #820c22;
    font-weight: 600;
    white-space: nowrap;
}

/* ── Kanban Board Container ── */
.workflow-kanban-wrapper {
    margin-top: 20px;
}

.workflow-kanban-board {
    display: flex;
    flex-direction: row;
    gap: 12px;
    min-height: 550px;
    overflow-x: auto;
    padding-bottom: 16px;
}

/* ── Section Label (combined view) ── */
.workflow-section-label {
    font-size: 13px;
    font-weight: 700;
    color: #555;
    margin: 0 0 16px;
    padding: 8px 12px;
    background: #f0f0f0;
    border-radius: 6px;
    border-right: 3px solid #820c22;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Column ── */
.workflow-column {
    flex: 1;
    min-width: 270px;
    max-width: 340px;
}

/* Section column in combined view — slightly wider */
.workflow-column.wf-col-section {
    min-width: 300px;
    max-width: 380px;
    background: #ebecf0;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.workflow-column-header {
    padding: 14px 16px;
    background: #820c22;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.workflow-column-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
}

.wf-count-badge {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: bold;
    min-width: 26px;
    text-align: center;
}

/* Column color variants */
.workflow-column:nth-child(1) .workflow-column-header { background: #820c22; }
.workflow-column:nth-child(2) .workflow-column-header { background: #1a6fa3; }
.workflow-column:nth-child(3) .workflow-column-header { background: #117a65; }
.workflow-column:nth-child(4) .workflow-column-header { background: #555; }

.workflow-column-content {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    min-height: 400px;
    transition: background 0.2s;
}

.workflow-column-content.drag-over {
    background: #d8f3e4;
    border: 2px dashed #27ae60;
    border-radius: 0 0 10px 10px;
}

/* ── Task Card ── */
.workflow-task-card {
    background: white;
    border-radius: 8px;
    padding: 14px 14px 12px;
    margin-bottom: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.10);
    cursor: move;
    transition: transform 0.15s, box-shadow 0.15s;
    border-right: 4px solid #820c22;
    position: relative;
}

.workflow-task-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0,0,0,0.14);
}

.workflow-task-card.dragging {
    opacity: 0.65;
    transform: rotate(2deg) scale(0.96);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

/* Priority border variants */
.workflow-task-card.priority-عالية  { border-right-color: #c0392b; }
.workflow-task-card.priority-متوسطة { border-right-color: #e67e22; }
.workflow-task-card.priority-منخفضة { border-right-color: #27ae60; }

.wf-task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
}

.wf-task-title {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.4;
    flex: 1;
}

.wf-priority-badge {
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: bold;
    color: white;
    flex-shrink: 0;
    white-space: nowrap;
}
.wf-priority-badge.priority-عالية  { background: #c0392b; }
.wf-priority-badge.priority-متوسطة { background: #e67e22; }
.wf-priority-badge.priority-منخفضة { background: #27ae60; }

.wf-task-preview {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 10px;
    word-break: break-word;
}

/* ── Task Meta Row ── */
.wf-task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.wf-section-badge {
    padding: 3px 9px;
    border-radius: 8px;
    font-size: 11px;
    color: white;
    font-weight: bold;
}

.wf-source-badge {
    padding: 3px 9px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: bold;
}
.wf-source-badge.source-auto   { background: #fac40d; color: #1a1a1a; }
.wf-source-badge.source-manual { background: #85929e; color: white; }

.wf-task-date {
    font-size: 11px;
    color: #999;
    margin-right: auto;
}

/* ── Multi-section checkboxes ── */
.wf-sections-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
    max-height: 150px;
    overflow-y: auto;
}

.wf-sec-checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    background: white;
    transition: all 0.15s;
    user-select: none;
}

.wf-sec-checkbox-label:hover {
    border-color: #820c22;
    background: #fff5f5;
}

.wf-sec-checkbox-label input[type="checkbox"] {
    display: none;
}

.wf-sec-checkbox-label:has(input:checked) {
    background: #820c22;
    color: white;
    border-color: #820c22;
}

.wf-sec-checkbox-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.wf-hint-small {
    font-size: 11px;
    color: #999;
    font-weight: normal;
}

/* ── Deadline Badge ── */
.wf-deadline-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 8px;
}

.wf-deadline-badge.deadline-normal   { background: #eaf4fb; color: #1a6fa3; }
.wf-deadline-badge.deadline-tomorrow { background: #fef9e7; color: #b7950b; }
.wf-deadline-badge.deadline-today    { background: #fef5e7; color: #d35400; border: 1px solid #f0b27a; }
.wf-deadline-badge.deadline-overdue  {
    background: #fde8e8;
    color: #c0392b;
    border: 1px solid #f5b7b1;
    animation: wf-pulse-deadline 2s infinite;
}

@keyframes wf-pulse-deadline {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.65; }
}

/* Status badge shown inside card (combined view) */
.wf-status-inline-badge {
    padding: 3px 9px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: bold;
    color: white;
}

.wf-task-creator {
    font-size: 11px;
    color: #aaa;
    margin-bottom: 10px;
}

/* ── Task Actions ── */
.wf-task-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 6px;
    border-top: 1px solid #f0f0f0;
    padding-top: 8px;
}

.btn-wf-task {
    padding: 5px 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.15s;
}

.btn-wf-details {
    background: #820c22;
    color: white;
}
.btn-wf-details:hover { background: #a50e2a; }

.btn-wf-advance {
    background: #fac40d;
    color: #1a1a1a;
    flex: 1;
}
.btn-wf-advance:hover { background: #e6b309; }

.btn-wf-edit {
    background: #eaf4fb;
    color: #1a6fa3;
    border: 1px solid #aed6f1;
}
.btn-wf-edit:hover { background: #aed6f1; }

.btn-wf-delete {
    background: #fde8e8;
    color: #c0392b;
    border: 1px solid #f5b7b1;
    margin-right: auto;
}
.btn-wf-delete:hover { background: #f5b7b1; }

/* ── Loading ── */
.workflow-loading {
    text-align: center;
    padding: 60px 20px;
    color: #820c22;
}

.wf-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f0d0d5;
    border-top-color: #820c22;
    border-radius: 50%;
    animation: wf-spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes wf-spin {
    to { transform: rotate(360deg); }
}

/* ── Empty ── */
.workflow-empty {
    text-align: center;
    padding: 60px 20px;
    color: #888;
    font-size: 16px;
}

/* ── Floating Add Button ── */
#workflow-add-task-btn {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 9998;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, #820c22 0%, #b01030 100%);
    border: none;
    cursor: pointer;
    color: white;
    font-size: 32px;
    line-height: 1;
    box-shadow: 0 4px 18px rgba(130, 12, 34, 0.45);
    transition: bottom 0.3s ease, transform 0.25s, box-shadow 0.25s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#workflow-add-task-btn:hover {
    transform: scale(1.12) rotate(90deg);
    box-shadow: 0 6px 24px rgba(130, 12, 34, 0.55);
}

#workflow-add-task-btn span {
    display: block;
    line-height: 1;
}

/* ── Modals ── */
.wf-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    direction: rtl;
    animation: wf-fade-in 0.2s ease;
}

@keyframes wf-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.wf-modal-content {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    animation: wf-slide-up 0.25s ease;
}

.wf-modal-large { max-width: 750px; }

@keyframes wf-slide-up {
    from { transform: translateY(30px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.wf-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    background: #820c22;
    color: white;
    border-radius: 12px 12px 0 0;
}

.wf-modal-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
}

.wf-close-modal {
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    color: rgba(255,255,255,0.8);
    transition: color 0.15s;
    user-select: none;
}
.wf-close-modal:hover { color: white; }

.wf-modal-body {
    padding: 24px;
}

.wf-modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
    margin-top: 20px;
}

/* ── Form Elements ── */
.wf-form-group {
    margin-bottom: 16px;
}

.wf-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}

.required { color: #c0392b; }

.wf-form-group input[type="text"],
.wf-form-group input[type="color"],
.wf-form-group select,
.wf-form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 7px;
    font-size: 14px;
    font-family: inherit;
    direction: rtl;
    transition: border-color 0.2s;
    background: white;
}

.wf-form-group input:focus,
.wf-form-group select:focus,
.wf-form-group textarea:focus {
    outline: none;
    border-color: #820c22;
    box-shadow: 0 0 0 3px rgba(130, 12, 34, 0.1);
}

.wf-form-row {
    display: flex;
    gap: 14px;
}
.wf-half { flex: 1; }

/* ── Modal Buttons ── */
.btn-wf-primary {
    padding: 10px 20px;
    background: #820c22;
    color: white;
    border: none;
    border-radius: 7px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-wf-primary:hover { background: #a50e2a; }

.btn-wf-cancel {
    padding: 10px 20px;
    background: #f0f0f0;
    color: #555;
    border: none;
    border-radius: 7px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-wf-cancel:hover { background: #e0e0e0; }

.btn-wf-add-row {
    padding: 8px 16px;
    background: transparent;
    color: #820c22;
    border: 2px dashed #820c22;
    border-radius: 7px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    margin-top: 10px;
}
.btn-wf-add-row:hover { background: rgba(130, 12, 34, 0.05); }

/* ── Task Details Modal ── */
.wf-detail-row {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
    align-items: flex-start;
}
.wf-detail-row:last-child { border-bottom: none; }

.wf-detail-label {
    font-size: 13px;
    font-weight: 700;
    color: #820c22;
    min-width: 120px;
    flex-shrink: 0;
}

.wf-detail-value {
    font-size: 13px;
    color: #333;
    line-height: 1.6;
    word-break: break-word;
}

.wf-detail-status-badge {
    padding: 4px 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: bold;
    color: white;
}
.wf-detail-status-badge.status-مهمة-جديدة   { background: #3498db; }
.wf-detail-status-badge.status-جاري-المتابعة { background: #e67e22; }
.wf-detail-status-badge.status-جاري-المراجعة { background: #8e44ad; }
.wf-detail-status-badge.status-تم-التنفيذ    { background: #27ae60; }

/* ── Section Manager (Admin) ── */
.wf-section-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 8px;
    background: #fafafa;
}

.wf-section-item input[type="color"] {
    width: 42px;
    height: 38px;
    padding: 2px;
    border-radius: 5px;
    cursor: pointer;
    flex-shrink: 0;
}

.wf-section-item input[type="text"] {
    flex: 1;
    padding: 8px 12px;
}

.btn-wf-delete-section {
    width: 34px;
    height: 34px;
    border: none;
    background: #fde8e8;
    color: #c0392b;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
}
.btn-wf-delete-section:hover { background: #f5b7b1; }

/* ── Role Assignment Matrix ── */
.wf-hint {
    font-size: 13px;
    color: #777;
    margin-bottom: 16px;
}

.wf-role-matrix-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.wf-role-matrix-table th,
.wf-role-matrix-table td {
    border: 1px solid #e0e0e0;
    padding: 10px 8px;
    text-align: center;
    white-space: nowrap;
}

.wf-role-matrix-table th {
    background: #820c22;
    color: white;
    font-weight: 600;
}

.wf-role-matrix-table th.role-header {
    text-align: right;
    padding-right: 14px;
}

.wf-role-matrix-table tr:hover td {
    background: #fff5f5;
}

.wf-role-matrix-table input[type="checkbox"] {
    width: 17px;
    height: 17px;
    cursor: pointer;
    accent-color: #820c22;
}

/* ── Responsive ── */
@media (max-width: 1100px) {
    .workflow-kanban-board {
        flex-wrap: wrap;
    }
    .workflow-column {
        min-width: calc(50% - 6px);
        max-width: none;
    }
}

@media (max-width: 700px) {
    .workflow-kanban-board {
        flex-direction: column;
    }
    .workflow-column {
        min-width: 100%;
        max-width: 100%;
    }
    .wf-form-row {
        flex-direction: column;
    }
    .workflow-title-row {
        flex-direction: column;
        align-items: flex-start;
    }
    #workflow-add-task-btn {
        bottom: 20px;
        left: 20px;
        width: 50px;
        height: 50px;
        font-size: 26px;
    }
    .wf-modal-content {
        max-height: 95vh;
    }
}

/* ═══════════════════════════════════════════════════════════
   Multi-Select: Selected Card State
═══════════════════════════════════════════════════════════ */
.workflow-task-card.wf-selected {
    outline: 3px solid #fac40d;
    outline-offset: -1px;
    box-shadow: 0 0 0 2px #fac40d, 0 4px 14px rgba(250, 196, 13, 0.3);
    background: #fffef5;
    position: relative;
}

.workflow-task-card.wf-selected::after {
    content: '✓';
    position: absolute;
    top: 6px;
    left: 6px;
    width: 22px;
    height: 22px;
    background: #fac40d;
    color: #1a1a1a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: bold;
    z-index: 2;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.workflow-task-card.wf-selected:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 0 2px #fac40d, 0 6px 18px rgba(250, 196, 13, 0.4);
}

/* ═══════════════════════════════════════════════════════════
   Bulk Actions Toolbar
═══════════════════════════════════════════════════════════ */
.wf-bulk-toolbar {
    background: linear-gradient(135deg, #1a1a1a 0%, #333 100%);
    border-radius: 10px;
    margin-bottom: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    animation: wf-slide-down 0.25s ease;
    overflow: hidden;
}

@keyframes wf-slide-down {
    from { transform: translateY(-10px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.wf-bulk-toolbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 16px;
}

.wf-bulk-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fac40d;
    font-size: 15px;
    font-weight: 700;
}

.wf-bulk-info span:first-child {
    font-size: 22px;
    min-width: 24px;
    text-align: center;
}

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

.wf-bulk-label {
    color: #aaa;
    font-size: 13px;
    font-weight: 600;
}

.wf-bulk-sep {
    color: #555;
    font-size: 18px;
    margin: 0 4px;
}

.wf-bulk-btn {
    padding: 6px 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    transition: all 0.15s;
    white-space: nowrap;
}

.wf-bulk-btn-sm {
    padding: 4px 10px;
    font-size: 12px;
    background: rgba(255,255,255,0.1);
    color: #ccc;
    border: 1px solid rgba(255,255,255,0.15);
}

.wf-bulk-btn-sm:hover {
    background: rgba(255,255,255,0.2);
    color: white;
}

.wf-bulk-move-btn {
    background: rgba(255,255,255,0.12);
    color: #e0e0e0;
    border: 1px solid rgba(255,255,255,0.2);
}

.wf-bulk-move-btn:hover {
    background: #fac40d;
    color: #1a1a1a;
    border-color: #fac40d;
    transform: translateY(-1px);
}

.wf-bulk-delete-btn {
    background: rgba(192, 57, 43, 0.25);
    color: #ff6b6b;
    border: 1px solid rgba(192, 57, 43, 0.5);
}

.wf-bulk-delete-btn:hover {
    background: #c0392b;
    color: white;
    border-color: #c0392b;
    transform: translateY(-1px);
}

/* Status-specific move button accents */
.wf-bulk-move-btn[data-target-status="مهمة جديدة"]    { border-right: 3px solid #3498db; }
.wf-bulk-move-btn[data-target-status="جاري المتابعة"] { border-right: 3px solid #e67e22; }
.wf-bulk-move-btn[data-target-status="جاري المراجعة"] { border-right: 3px solid #8e44ad; }
.wf-bulk-move-btn[data-target-status="تم التنفيذ"]    { border-right: 3px solid #27ae60; }

@media (max-width: 700px) {
    .wf-bulk-toolbar-inner {
        flex-direction: column;
        align-items: stretch;
    }
    .wf-bulk-info {
        justify-content: space-between;
    }
    .wf-bulk-actions {
        justify-content: center;
    }
}
