/* =========================================================================
   WorkflowStatus Page – KPI Cards, Filter Bar, Status Table
   ========================================================================= */

/* ── KPI Filter Cards ── */
.kpi-row {
    display: flex;
    gap: 0.625rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.kpi-row .kpi-card {
    display: block;
    flex: 1;
    min-width: 110px;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    background: #fff;
    text-align: center;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
    opacity: 1;
    transform: none;
}
.kpi-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); transform: translateY(-1px); }
.kpi-card.selected { border-bottom: 3px solid currentColor; box-shadow: 0 2px 12px rgba(0,0,0,0.1); }
.kpi-card .kpi-val { font-size: 1.5rem; font-weight: 700; line-height: 1; }
.kpi-card .kpi-lbl { font-size: 0.75rem; color: #64748b; margin-top: 0.2rem; display: flex; align-items: center; justify-content: center; gap: 0.3rem; }
.kpi-card.k-overdue { background: #fff5f5; border-color: #fecaca; }
.kpi-card.k-overdue .kpi-val { color: #dc3545; }
.kpi-card.k-overdue.selected { border-color: #dc3545; }
.kpi-card.k-at-risk { background: #fffbeb; border-color: #fde68a; }
.kpi-card.k-at-risk .kpi-val { color: #d97706; }
.kpi-card.k-at-risk.selected { border-color: #d97706; }
.kpi-card.k-on-target { background: #f0fdf4; border-color: #bbf7d0; }
.kpi-card.k-on-target .kpi-val { color: #198754; }
.kpi-card.k-on-target.selected { border-color: #198754; }
.kpi-card.k-no-sla { background: #f8f9fa; border-color: #dee2e6; }
.kpi-card.k-no-sla .kpi-val { color: #6c757d; }
.kpi-card.k-no-sla.selected { border-color: #6c757d; }
.kpi-card.k-all { background: #f8fafc; border-color: #e2e8f0; }
.kpi-card.k-all .kpi-val { color: #475569; }
.kpi-card.k-all.selected { border-color: #475569; }
.kpi-card.k-completed { background: #eff6ff; border-color: #bfdbfe; }
.kpi-card.k-completed .kpi-val { color: #0d6efd; }
.kpi-card.k-completed.selected { border-color: #0d6efd; }

/* ── Filter Bar ── */
.wfs-filter-bar {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}
.wfs-filter-bar .filter-input {
    flex: 1;
    min-width: 160px;
    position: relative;
}
.wfs-filter-bar .filter-input i {
    position: absolute;
    left: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.85rem;
}
.wfs-filter-bar .filter-input input {
    padding-left: 2rem;
    font-size: 0.85rem;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    height: 36px;
    width: 100%;
}
.wfs-filter-bar .filter-input input:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.2rem rgba(13,110,253,0.15);
    outline: none;
}
.wfs-filter-bar .filter-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    color: #475569;
    white-space: nowrap;
    flex-shrink: 0;
}
.wfs-filter-bar .filter-toggle .form-check-input { width: 2rem; height: 1.1rem; cursor: pointer; }
.wfs-filter-bar .filter-toggle label { cursor: pointer; user-select: none; margin-bottom: 0; }
.wfs-filter-bar .filter-clear {
    flex-shrink: 0;
    font-size: 0.8rem;
    color: #64748b;
    cursor: pointer;
    text-decoration: none;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
}
.wfs-filter-bar .filter-clear:hover { background: #e9ecef; color: #1e293b; }
.wfs-filter-bar .filter-input-date {
    display: flex;
    align-items: center;
    min-width: 240px;
    gap: 0;
}
.wfs-filter-bar .filter-input-date i {
    position: static;
    transform: none;
    margin-right: 0.4rem;
    flex-shrink: 0;
}
.wfs-filter-bar .filter-input-date input[type="date"] {
    padding-left: 0.5rem;
    font-size: 0.82rem;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    height: 36px;
    min-width: 0;
    flex: 1;
}
.wfs-filter-bar .filter-input-date input[type="date"]:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.2rem rgba(13,110,253,0.15);
    outline: none;
}

/* ── Sort Buttons ── */
.sort-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
}
.sort-btn:hover { color: #0d6efd; }
.sort-btn:focus-visible { outline: 2px solid #0d6efd; outline-offset: 2px; border-radius: 2px; }
.sort-btn .sort-icon { font-size: 0.7rem; opacity: 0.4; transition: opacity 0.15s; }
.sort-btn .sort-icon.active { opacity: 1; color: #0d6efd; }
.sort-btn:hover .sort-icon { opacity: 0.8; }

/* ── Loading State ── */
.wfs-loading {
    transition: opacity 0.2s;
}

/* ── KPI card as button (AJAX mode) ── */
.kpi-row button.kpi-card {
    font-family: inherit;
    font-size: inherit;
}
.kpi-row button.kpi-card:focus-visible {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* ── Status Table ── */
.wfs-table { width: 100%; background: white; border: 1px solid #e9ecef; border-radius: 8px; overflow: hidden; }
.wfs-table thead { background: #f8f9fa; }
.wfs-table th { padding: 0.65rem 0.75rem; font-size: 0.75rem; font-weight: 600; color: #475569; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 2px solid #dee2e6; white-space: nowrap; }
.wfs-table tbody tr { border-bottom: 1px solid #f1f5f9; transition: background-color 0.15s; }
.wfs-table tbody tr:hover { background: #f8fafc; }
.wfs-table tbody tr:last-child { border-bottom: none; }
.wfs-table td { padding: 0.65rem 0.75rem; vertical-align: middle; font-size: 0.84rem; }

/* ── Row highlight ── */
.wfs-table tbody tr.row-overdue { border-left: 4px solid #dc3545; }
.wfs-table tbody tr.row-at-risk { border-left: 4px solid #ffc107; }
.wfs-table tbody tr.row-on-target { border-left: 4px solid #198754; }
.wfs-table tbody tr.row-no-sla { border-left: 4px solid #dee2e6; }
.wfs-table tbody tr.row-completed { border-left: 4px solid #0d6efd; opacity: 0.85; }

/* ── No SLA muted cells ── */
.wfs-table tbody tr.row-no-sla td.sla-cell { color: #cbd5e1; }

/* ── SLA Badge ── */
.sla-badge { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.25rem 0.55rem; border-radius: 6px; font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
.sla-badge.overdue { background: #f8d7da; color: #842029; }
.sla-badge.at-risk { background: #fff3cd; color: #664d03; }
.sla-badge.on-target { background: #d1e7dd; color: #0f5132; }
.sla-badge.no-sla { background: #f1f5f9; color: #94a3b8; }
.sla-badge.completed { background: #cfe2ff; color: #084298; }
.sla-badge.rejected { background: #f8d7da; color: #842029; }
.sla-badge.cancelled { background: #e9ecef; color: #495057; }

/* ── Mini Progress Bar ── */
.step-progress { display: flex; align-items: center; gap: 0.35rem; }
.step-progress .step-label { font-size: 0.82rem; font-weight: 500; color: #475569; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
.step-bar { display: flex; gap: 2px; margin-top: 3px; }
.step-bar .seg { height: 4px; border-radius: 2px; flex: 1; min-width: 12px; }
.step-bar .seg.filled { background: #0d6efd; }
.step-bar .seg.empty { background: #e2e8f0; }
.step-bar .seg.done { background: #198754; }

/* ── User Avatar ── */
.user-avatar { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 0.68rem; font-weight: 700; color: #fff; flex-shrink: 0; letter-spacing: 0.3px; }
.assignee-cell { display: flex; align-items: center; gap: 0.5rem; font-size: 0.84rem; }
.parallel-indicator { font-size: 0.68rem; color: #0369a1; font-weight: 600; display: flex; align-items: center; gap: 0.2rem; margin-bottom: 0.15rem; }
.parallel-row { display: flex; align-items: center; gap: 0.35rem; margin-bottom: 0.1rem; font-size: 0.8rem; }

/* ── Completion summary ── */
.completion-summary { font-size: 0.8rem; color: #475569; }
.completion-summary .elapsed { font-weight: 600; }

/* ── Days indicator ── */
.days-indicator { font-size: 0.84rem; font-weight: 600; }
.days-indicator.critical { color: #dc3545; }
.days-indicator.warning { color: #d97706; }
.days-indicator.normal { color: #64748b; }

/* ── Doc link ── */
.doc-title a { color: #1e293b; text-decoration: none; font-weight: 500; }
.doc-title a:hover { color: #0d6efd; text-decoration: underline; }

/* ── Actions dropdown ── */
.wfs-actions-btn { background: none; border: 1px solid transparent; border-radius: 4px; padding: 0.2rem 0.45rem; cursor: pointer; color: #64748b; transition: all 0.15s; }
.wfs-actions-btn:hover { background: #f1f5f9; border-color: #dee2e6; color: #1e293b; }
.wfs-actions-menu { min-width: 180px; font-size: 0.84rem; border: 1px solid #e9ecef; box-shadow: 0 4px 16px rgba(0,0,0,0.1); border-radius: 8px; }
.wfs-actions-menu .dropdown-item { padding: 0.5rem 0.85rem; display: flex; align-items: center; gap: 0.5rem; }
.wfs-actions-menu .dropdown-item i { width: 16px; text-align: center; font-size: 0.85rem; }
.wfs-actions-menu .dropdown-divider { margin: 0.3rem 0; }

/* ── Table footer ── */
.wfs-table-footer { padding: 0.65rem 0.75rem; background: #f8f9fa; border-top: 1px solid #e9ecef; display: flex; justify-content: space-between; align-items: center; font-size: 0.82rem; color: #64748b; }

/* ── Empty state ── */
.wfs-empty-state { text-align: center; padding: 3rem 2rem; color: #94a3b8; }
.wfs-empty-state i { font-size: 2.5rem; margin-bottom: 0.75rem; opacity: 0.5; }
.wfs-empty-state h5 { font-weight: 600; color: #64748b; }

/* ── Dark Mode ── */
[data-bs-theme="dark"] .kpi-card { background: #2d2d2d; border-color: #3d3d3d; color: #cccccc; }
[data-bs-theme="dark"] .kpi-card .kpi-lbl { color: #9d9d9d; }
[data-bs-theme="dark"] .kpi-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.3); }
[data-bs-theme="dark"] .kpi-card.selected { box-shadow: 0 2px 12px rgba(0,0,0,0.3); }
[data-bs-theme="dark"] .kpi-card.k-overdue { background: #3a2020; border-color: #5c2d2d; }
[data-bs-theme="dark"] .kpi-card.k-at-risk { background: #3a3420; border-color: #5c4d20; }
[data-bs-theme="dark"] .kpi-card.k-on-target { background: #1e3a20; border-color: #2d5c2d; }
[data-bs-theme="dark"] .kpi-card.k-no-sla { background: #2d2d2d; border-color: #3d3d3d; }
[data-bs-theme="dark"] .kpi-card.k-all { background: #252526; border-color: #3d3d3d; }
[data-bs-theme="dark"] .kpi-card.k-completed { background: #1e2a3a; border-color: #2d3d5c; }
[data-bs-theme="dark"] .wfs-filter-bar { background: #252526; border-color: #3d3d3d; }
[data-bs-theme="dark"] .wfs-filter-bar .filter-input input { background: #1e1e1e; border-color: #3d3d3d; color: #cccccc; }
[data-bs-theme="dark"] .wfs-filter-bar .filter-toggle { color: #9d9d9d; }
[data-bs-theme="dark"] .wfs-table { background: #252526; border-color: #3d3d3d; }
[data-bs-theme="dark"] .wfs-table thead { background: #2d2d2d; }
[data-bs-theme="dark"] .wfs-table th { color: #9d9d9d; border-bottom-color: #3d3d3d; }
[data-bs-theme="dark"] .wfs-table tbody tr { border-bottom-color: #2d2d2d; }
[data-bs-theme="dark"] .wfs-table tbody tr:hover { background: #2d2d2d; }
[data-bs-theme="dark"] .wfs-table td { color: #cccccc; }
[data-bs-theme="dark"] .wfs-table-footer { background: #2d2d2d; border-top-color: #3d3d3d; color: #9d9d9d; }
[data-bs-theme="dark"] .doc-title a { color: #cccccc; }
[data-bs-theme="dark"] .doc-title a:hover { color: #4da6ff; }
[data-bs-theme="dark"] .wfs-actions-btn { color: #9d9d9d; }
[data-bs-theme="dark"] .wfs-actions-btn:hover { background: #3d3d3d; border-color: #4d4d4d; color: #cccccc; }
[data-bs-theme="dark"] .wfs-empty-state { color: #6d6d6d; }
[data-bs-theme="dark"] .wfs-empty-state h5 { color: #9d9d9d; }

/* =========================================================================
   WorkflowStatusDetails Page – Visualizer, Activity Log, Admin Actions
   ========================================================================= */

/* ── Workflow Step Visualizer ── */
.workflow-visualizer {
    gap: 0.5rem;
    align-items: flex-start;
}
.workflow-step {
    position: relative;
    min-width: 100px;
    max-width: 150px;
    flex: 1;
}
.workflow-step .step-icon {
    width: 42px;
    height: 42px;
    margin: 0 auto;
    font-size: 0.95rem;
    font-weight: 700;
    transition: all 0.2s;
}
.workflow-step.complete .step-icon {
    background: #198754;
    color: #fff;
}
.workflow-step.current .step-icon {
    background: #0d6efd;
    color: #fff;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25);
    animation: pulse-step 2s ease-in-out infinite;
}
.workflow-step.pending .step-icon {
    background: #e9ecef;
    color: #6c757d;
}
.workflow-step.rejected .step-icon {
    background: #dc3545;
    color: #fff;
}
.workflow-step.irrelevant .step-icon {
    background: #f1f5f9;
    color: #cbd5e1;
}
.workflow-step .step-label {
    font-size: 0.78rem;
    color: #475569;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin: 0 auto;
}
.workflow-step.current .step-label { color: #0d6efd; }
.workflow-step.irrelevant .step-label { color: #cbd5e1; }
.workflow-step .step-actor {
    font-size: 0.7rem;
    color: #94a3b8;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin: 0.1rem auto 0;
}

@@keyframes pulse-step {
    0%, 100% { box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25); }
    50% { box-shadow: 0 0 0 6px rgba(13, 110, 253, 0.1); }
}

/* ── Activity Log ── */
.activity-log {
    list-style: none;
    padding: 0;
    margin: 0;
    position: relative;
}
.activity-log::before {
    content: '';
    position: absolute;
    left: 19px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e9ecef;
}
.activity-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.6rem 0;
    position: relative;
}
.activity-item:last-child { padding-bottom: 0; }
.activity-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    z-index: 1;
    font-size: 0.85rem;
}
.activity-body {
    flex: 1;
    font-size: 0.84rem;
    line-height: 1.4;
}
.activity-body .actor {
    font-weight: 600;
    color: #1e293b;
}
.activity-body .timestamp {
    font-size: 0.72rem;
    color: #94a3b8;
    margin-top: 0.15rem;
}

/* ── Admin Actions Card ── */
.card.border-warning { border-width: 2px; }

/* ── Filter clear as button ── */
button.filter-clear {
    background: none;
    border: none;
    font-family: inherit;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .wfs-table { display: block; overflow-x: auto; }
    .kpi-row { flex-direction: column; }
    .wfs-filter-bar { flex-direction: column; }
    .wfs-filter-bar .filter-input { min-width: 100%; }
    .wfs-filter-bar .filter-input-date { min-width: 100%; }
    .workflow-visualizer { flex-direction: column; align-items: stretch; }
    .workflow-step { max-width: none; }
}

/* ── Dark Mode for Details Page ── */
[data-bs-theme="dark"] .workflow-step .step-label { color: #9d9d9d; }
[data-bs-theme="dark"] .workflow-step.current .step-label { color: #4da6ff; }
[data-bs-theme="dark"] .workflow-step.irrelevant .step-label { color: #4d4d4d; }
[data-bs-theme="dark"] .workflow-step.pending .step-icon { background: #3d3d3d; color: #6d6d6d; }
[data-bs-theme="dark"] .workflow-step.irrelevant .step-icon { background: #2d2d2d; color: #4d4d4d; }
[data-bs-theme="dark"] .activity-log::before { background: #3d3d3d; }
[data-bs-theme="dark"] .activity-body .actor { color: #cccccc; }
[data-bs-theme="dark"] .sort-btn { color: #9d9d9d; }
[data-bs-theme="dark"] .sort-btn:hover { color: #4da6ff; }
[data-bs-theme="dark"] .wfs-filter-bar .filter-input-date input[type="date"] { background: #1e1e1e; border-color: #3d3d3d; color: #cccccc; }

/* =========================================================================
   WorkflowStatusDetails Page – Redesigned UX/UI
   ========================================================================= */

/* ── Card Styling ── */
.wsd-card {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    overflow: hidden;
}
.wsd-card .card-header {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
}
.wsd-card .card-body {
    padding: 1rem;
}

/* ── Header Area ── */
.wsd-header h1 {
    color: #0f172a;
}

/* ── Tab Styling ── */
.wsd-tabs {
    border-bottom: none;
    padding: 0 1rem;
}
.wsd-tabs .nav-link {
    font-size: 0.82rem;
    font-weight: 500;
    color: #64748b;
    border: none;
    padding: 0.75rem 1rem;
    position: relative;
}
.wsd-tabs .nav-link.active {
    color: #0d6efd;
    font-weight: 600;
    background: none;
    border: none;
}
.wsd-tabs .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0.5rem;
    right: 0.5rem;
    height: 2px;
    background: #0d6efd;
    border-radius: 1px;
}
.wsd-tabs .nav-link:hover:not(.active) {
    color: #334155;
}

/* ── Step Track (Vertical) ── */
.wsd-step-track {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
}
.wsd-step {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0;
    position: relative;
}
.wsd-step:last-child .wsd-step-connector { display: none; }

.wsd-step-connector {
    position: absolute;
    left: 18px;
    top: 44px;
    bottom: -4px;
    width: 2px;
    background: #e2e8f0;
}

.wsd-step.complete .wsd-step-connector { background: #198754; }
.wsd-step.rejected .wsd-step-connector { background: #dc3545; }

.wsd-step-node {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.82rem;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    transition: all 0.2s;
}

.wsd-step.complete .wsd-step-node {
    background: #198754;
    color: #fff;
}
.wsd-step.current .wsd-step-node {
    background: #0d6efd;
    color: #fff;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.2);
}
.wsd-step.pending .wsd-step-node {
    background: #f1f5f9;
    color: #94a3b8;
    border: 2px solid #e2e8f0;
}
.wsd-step.rejected .wsd-step-node {
    background: #dc3545;
    color: #fff;
}
.wsd-step.irrelevant .wsd-step-node {
    background: #f8fafc;
    color: #cbd5e1;
    border: 2px dashed #e2e8f0;
}

/* Pulse animation for current step */
.wsd-step-pulse {
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 2px solid rgba(13, 110, 253, 0.3);
    animation: wsd-pulse 2s ease-in-out infinite;
}
@keyframes wsd-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.15); opacity: 0.4; }
}

.wsd-step-info {
    flex: 1;
    min-width: 0;
}
.wsd-step-label {
    font-weight: 600;
    font-size: 0.875rem;
    color: #1e293b;
}
.wsd-step.current .wsd-step-label { color: #0d6efd; }
.wsd-step.irrelevant .wsd-step-label { color: #cbd5e1; }
.wsd-step.irrelevant .wsd-step-info .badge { opacity: 0.4; }

.wsd-step-actor {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.2rem;
}

/* ── Approval Table ── */
.wsd-approval-table thead th {
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
    padding: 0.5rem 0.75rem;
}
.wsd-approval-table tbody td {
    padding: 0.5rem 0.75rem;
    vertical-align: middle;
    font-size: 0.82rem;
}
.wsd-approval-table tbody tr {
    border-bottom: 1px solid #f1f5f9;
}
.wsd-approval-table tbody tr:last-child {
    border-bottom: none;
}

.wsd-step-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #475569;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* ── Timeline (Previous Instances) ── */
.wsd-timeline {
    position: relative;
    padding-left: 1.5rem;
}
.wsd-timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.5rem;
    bottom: 0.5rem;
    width: 2px;
    background: #e2e8f0;
    border-radius: 1px;
}

.wsd-timeline-item {
    position: relative;
    padding: 0.5rem 0;
}
.wsd-timeline-marker {
    position: absolute;
    left: -1.5rem;
    top: 1rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid #fff;
    transform: translateX(-4px);
    z-index: 1;
}
.wsd-timeline-marker.marker-danger { background: #dc3545; }
.wsd-timeline-marker.marker-warning { background: #f59e0b; }
.wsd-timeline-marker.marker-success { background: #198754; }

.wsd-timeline-content {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.75rem 1rem;
}

.wsd-timeline-header {
    cursor: pointer;
}
.wsd-timeline-header:hover {
    opacity: 0.85;
}

.wsd-rejection-reason {
    font-size: 0.82rem;
    color: #64748b;
    font-style: italic;
    border-left: 3px solid #e2e8f0;
    padding-left: 0.5rem;
}

/* ── Admin Actions Card ── */
.wsd-admin-card .card-body .btn {
    justify-content: flex-start;
    font-size: 0.82rem;
}

/* ── Responsive ── */
@media (max-width: 991.98px) {
    .wsd-step-track {
        gap: 0;
    }
    .wsd-header {
        flex-direction: column;
        align-items: stretch !important;
    }
}

@media (max-width: 575.98px) {
    .wsd-approval-table {
        font-size: 0.75rem;
    }
    .wsd-approval-table thead th {
        font-size: 0.65rem;
    }
    .wsd-step-node {
        width: 32px;
        height: 32px;
        font-size: 0.72rem;
    }
    .wsd-step-label {
        font-size: 0.8rem;
    }
}

/* ── Dark Mode for WSD ── */
[data-bs-theme="dark"] .wsd-card {
    border-color: #334155;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
[data-bs-theme="dark"] .wsd-card .card-header {
    background: #1e293b;
    border-bottom-color: #334155;
}
[data-bs-theme="dark"] .wsd-header h1 { color: #e2e8f0; }
[data-bs-theme="dark"] .wsd-step-label { color: #e2e8f0; }
[data-bs-theme="dark"] .wsd-step.current .wsd-step-label { color: #60a5fa; }
[data-bs-theme="dark"] .wsd-step.irrelevant .wsd-step-label { color: #475569; }
[data-bs-theme="dark"] .wsd-step.pending .wsd-step-node {
    background: #334155;
    color: #64748b;
    border-color: #475569;
}
[data-bs-theme="dark"] .wsd-step.irrelevant .wsd-step-node {
    background: #1e293b;
    color: #475569;
    border-color: #334155;
}
[data-bs-theme="dark"] .wsd-step-connector { background: #334155; }
[data-bs-theme="dark"] .wsd-step.complete .wsd-step-connector { background: #166534; }
[data-bs-theme="dark"] .wsd-step-actor { color: #94a3b8; }
[data-bs-theme="dark"] .wsd-tabs .nav-link { color: #94a3b8; }
[data-bs-theme="dark"] .wsd-tabs .nav-link.active { color: #60a5fa; }
[data-bs-theme="dark"] .wsd-tabs .nav-link.active::after { background: #60a5fa; }
[data-bs-theme="dark"] .wsd-approval-table thead th { color: #94a3b8; border-bottom-color: #334155; }
[data-bs-theme="dark"] .wsd-approval-table tbody tr { border-bottom-color: #1e293b; }
[data-bs-theme="dark"] .wsd-step-badge { background: #334155; color: #94a3b8; }
[data-bs-theme="dark"] .wsd-timeline::before { background: #334155; }
[data-bs-theme="dark"] .wsd-timeline-content { background: #1e293b; border-color: #334155; }
[data-bs-theme="dark"] .wsd-rejection-reason { color: #94a3b8; border-left-color: #334155; }
[data-bs-theme="dark"] .wsd-timeline-marker { border-color: #0f172a; }
