/* ═══════════════════════════════════════════════════════════
   WORKFLOW DASHBOARD — Refined industrial data interface
   ═══════════════════════════════════════════════════════════ */

/* ── Filter Panel ── */
.wf-filters {
    background: #f7f8fa;
    border: 1px solid #e2e5ea;
    border-radius: 6px;
    margin-bottom: 12px;
    overflow: hidden;
}

.wf-filters__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: linear-gradient(180deg, #fafbfc 0%, #f3f4f7 100%);
    border-bottom: 1px solid #e2e5ea;
}

.wf-filters__toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 600;
    color: #3b4252;
    padding: 4px 8px 4px 4px;
    border-radius: 4px;
    transition: background 0.15s;
}

.wf-filters__toggle:hover {
    background: rgba(0,0,0,0.04);
}

.wf-filters__icon {
    width: 16px;
    height: 16px;
    color: #667085;
}

.wf-filters__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--color-orange);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 9px;
    line-height: 1;
}

.wf-filters__summary {
    font-size: 12px;
    color: #667085;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.wf-filters__body {
    padding: 12px 14px 14px;
}

.wf-filters__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 10px 14px;
}

.wf-filters__actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #e8eaee;
}

/* ── Field ── */
.wf-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.wf-field__label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #8b95a5;
}

.wf-field__input,
.wf-field__select {
    width: 100%;
    height: 32px;
    padding: 0 8px;
    border: 1px solid #d5d9e0;
    border-radius: 4px;
    font-family: var(--font-family);
    font-size: 12.5px;
    color: var(--color-text-primary);
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.wf-field__input:focus,
.wf-field__select:focus {
    outline: none;
    border-color: var(--color-blue);
    box-shadow: 0 0 0 2px rgba(69,151,201,0.12);
}

.wf-field__select {
    padding-right: 24px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%23777'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    cursor: pointer;
}

/* ── Button ── */
.wf-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border: none;
    border-radius: 4px;
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
}

.wf-btn--primary {
    background: #336699;
    color: #fff;
}

.wf-btn--primary:hover {
    background: #2a547d;
}

.wf-btn--ghost {
    background: transparent;
    color: #667085;
    border: 1px solid #d5d9e0;
}

.wf-btn--ghost:hover {
    background: #f0f1f3;
    color: #3b4252;
}

.wf-btn--outline {
    background: #fff;
    color: #475467;
    border: 1px solid #d5d9e0;
}

.wf-btn--outline:hover {
    background: #f7f8fa;
    border-color: #b0b8c6;
    color: #333;
}

.wf-btn--sm {
    padding: 4px 10px;
    font-size: 11.5px;
}

/* ── Stats Bar ── */
.wf-stats {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #e2e5ea;
    border-radius: 6px;
    margin-bottom: 8px;
}

.wf-stats__ranges {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.wf-range {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: #f0f4f8;
    border: 1px solid #d5dce5;
    border-radius: 4px;
    font-size: 11px;
}

.wf-range__label {
    font-weight: 600;
    color: #5a6577;
    margin-right: 2px;
}

.wf-range__val {
    font-family: "Cascadia Code", "Fira Code", "Consolas", monospace;
    font-size: 10.5px;
    color: #334155;
    letter-spacing: -0.2px;
}

.wf-range__div {
    color: #b0b8c6;
}

/* ── Pending counts ── */
.wf-stats__pending {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.wf-pending-label {
    font-size: 11.5px;
    font-weight: 600;
    color: #dc6803;
    text-decoration: none;
    cursor: pointer;
    padding: 2px 8px;
    border: 1px solid #dc6803;
    border-radius: 4px;
    transition: background .15s, color .15s;
}
.wf-pending-label:hover {
    background: #dc6803;
    color: #fff;
}

.wf-pending-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    background: #dc6803;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 10px;
    font-variant-numeric: tabular-nums;
}

.wf-pending-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 7px;
    font-size: 10.5px;
    color: #667085;
    background: #f2f4f7;
    border: 1px solid #e4e7ec;
    border-radius: 3px;
    font-variant-numeric: tabular-nums;
}

.wf-pending-chip b {
    color: #344054;
    font-weight: 700;
}

.wf-stats__actions {
    margin-left: auto;
    display: flex;
    gap: 6px;
}

/* ── Pager wrapper ── */
.wf-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 0;
}

/* ── Table action icons ── */
.wf-actions {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.wf-act {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 26px;
    border: none;
    background: none;
    color: #667085;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.12s;
    text-decoration: none;
    padding: 0;
    font-size: 0;
}

.wf-act:hover {
    background: #eef1f6;
    color: #334155;
}

.wf-act--warn:hover {
    background: #fff3e0;
    color: #b45309;
}

.wf-act--ok:hover {
    background: #e8f5e9;
    color: #2d7a50;
}

/* ── CF ID link ── */
.wf-cfid {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #336699;
    text-decoration: none;
    font-size: 12.5px;
}

.wf-cfid:hover {
    text-decoration: underline;
    color: #1e4d7a;
}

.wf-color-link {
    color: var(--color-text-primary);
    text-decoration: none;
    font-size: 12.5px;
}

.wf-color-link:hover {
    color: #336699;
    text-decoration: underline;
}

/* ── Edit Links / Next Stage cells ── */
.wf-links {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 6px;
    align-items: center;
    font-size: 11.5px;
    line-height: 1.4;
}

.wf-links a {
    color: #336699;
    text-decoration: none;
    white-space: nowrap;
    padding: 1px 3px;
    border-radius: 3px;
    transition: background 0.15s, color 0.15s;
}

.wf-links a:hover {
    background: #e8f0fb;
    color: #1e4d7a;
    text-decoration: underline;
}

/* ── Wide viewport enhancements ── */
@media (min-width: 1600px) {
    .wf-filters__grid {
        grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
    }
}

@media (min-width: 1920px) {
    .wf-filters__grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 10px 18px;
    }
}

@media (min-width: 2400px) {
    .wf-filters__grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .wf-filters__grid {
        grid-template-columns: 1fr 1fr;
    }
    .wf-stats {
        flex-direction: column;
        align-items: flex-start;
    }
    .wf-stats__actions {
        margin-left: 0;
        width: 100%;
    }
    .wf-stats__actions .wf-btn {
        flex: 1;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .wf-filters__grid {
        grid-template-columns: 1fr;
    }
}

/* ── Autocomplete (scoped) ── */
.cf-autocomplete-wrap {
    position: relative;
}
.cf-autocomplete-list,
.cf-autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 50;
    max-height: 200px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #d5d9e0;
    border-top: none;
    border-radius: 0 0 5px 5px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
    list-style: none;
    margin: 0;
    padding: 0;
}
.cf-autocomplete-list li {
    padding: 6px 10px;
    cursor: pointer;
    font-size: 12px;
    color: #334155;
    transition: background 0.08s;
}
.cf-autocomplete-list li:hover,
.cf-autocomplete-list li.cf-autocomplete-active,
.cf-autocomplete-item:hover {
    background: #eef4fb;
    color: #1e4d7a;
}
.cf-autocomplete-item {
    padding: 6px 10px;
    cursor: pointer;
    font-size: 12px;
    color: #334155;
    transition: background 0.08s;
}
[x-cloak] { display: none !important; }
