/*
 * EWER 2.0 CMS — Workflow Pipeline V5
 * Government-grade, responsive Kanban layout.
 * Scope is intentionally limited to #pipelineView.
 */

#pipelineView {
    --pipeline-primary: #4f46e5;
    --pipeline-primary-soft: rgba(79, 70, 229, 0.10);
    --pipeline-blue: #2563eb;
    --pipeline-danger: #ef4444;
    --pipeline-warning: #f59e0b;
    --pipeline-success: #10b981;
    --pipeline-purple: #8b5cf6;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    padding: clamp(1rem, 1.6vw, 1.6rem);
    box-sizing: border-box;
}

/* ===== Page header and entity navigation ===== */
#pipelineView .pipeline-page-header {
    display: flex !important;
    align-items: flex-end !important;
    justify-content: space-between !important;
    gap: 1.25rem;
    width: 100%;
    min-width: 0;
    margin-bottom: 1rem;
}

#pipelineView .pipeline-page-heading {
    min-width: 0;
}

#pipelineView .pipeline-page-heading h1 {
    margin: 0;
    color: var(--text-primary, #1e293b);
    font-size: clamp(1.65rem, 2.2vw, 2.15rem);
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.15;
}

#pipelineView .pipeline-page-heading p {
    margin: .55rem 0 0;
    max-width: 720px;
    color: var(--text-muted, #64748b);
    font-size: .94rem;
    line-height: 1.55;
}

#pipelineView .pipeline-navigation {
    display: inline-flex !important;
    align-items: center;
    justify-content: flex-start;
    flex: 0 0 auto;
    gap: .35rem;
    max-width: 100%;
    padding: .35rem;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 15px;
    background: rgba(255, 255, 255, .76);
    box-shadow: 0 8px 24px rgba(15, 23, 42, .055);
    overflow-x: auto;
    scrollbar-width: none;
}

#pipelineView .pipeline-navigation::-webkit-scrollbar {
    display: none;
}

#pipelineView .pipeline-tab {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    flex: 0 0 auto;
    min-height: 42px;
    padding: .68rem .95rem;
    border: 1px solid transparent;
    border-radius: 11px;
    background: transparent;
    color: var(--text-muted, #64748b);
    font: inherit;
    font-size: .88rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease;
}

#pipelineView .pipeline-tab:hover {
    color: var(--text-primary, #1e293b);
    background: rgba(79, 70, 229, .06);
}

#pipelineView .pipeline-tab.active {
    color: #fff;
    border-color: rgba(79, 70, 229, .28);
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    box-shadow: 0 8px 18px rgba(79, 70, 229, .23);
}

#pipelineView .pipeline-tab:focus-visible {
    outline: 3px solid rgba(79, 70, 229, .24);
    outline-offset: 2px;
}

/* ===== Professional filter toolbar ===== */
#pipelineView .pipeline-filter-toolbar {
    display: grid !important;
    grid-template-columns: minmax(280px, 1.6fr) minmax(150px, .55fr) minmax(170px, .65fr) auto;
    align-items: center;
    gap: .75rem;
    width: 100%;
    min-width: 0;
    margin-bottom: 1rem;
    padding: .8rem;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 17px;
    background: rgba(255, 255, 255, .82);
    box-shadow: 0 10px 28px rgba(15, 23, 42, .055);
    box-sizing: border-box;
}

#pipelineView .pipeline-filter-field {
    display: flex !important;
    align-items: center;
    gap: .65rem;
    min-width: 0;
    height: 46px;
    padding: 0 .85rem;
    border: 1px solid var(--border-color, #dbe3ef);
    border-radius: 12px;
    background: var(--bg-white, #fff);
    color: var(--text-muted, #64748b);
    transition: border-color .18s ease, box-shadow .18s ease;
}

#pipelineView .pipeline-filter-field:focus-within {
    border-color: rgba(79, 70, 229, .55);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, .10);
}

#pipelineView .pipeline-filter-field i {
    flex: 0 0 auto;
    color: #94a3b8;
}

#pipelineView .pipeline-filter-field input {
    width: 100%;
    min-width: 0;
    height: 100%;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-primary, #1e293b);
    font: inherit;
    font-size: .91rem;
}

#pipelineView .pipeline-filter-field input::placeholder {
    color: #94a3b8;
}

#pipelineView .pipeline-filter-toolbar select {
    width: 100%;
    min-width: 0;
    height: 46px;
    padding: 0 2.2rem 0 .85rem;
    border: 1px solid var(--border-color, #dbe3ef);
    border-radius: 12px;
    outline: 0;
    background-color: var(--bg-white, #fff);
    color: var(--text-primary, #334155);
    font: inherit;
    font-size: .89rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .18s ease, box-shadow .18s ease;
}

#pipelineView .pipeline-filter-toolbar select:focus {
    border-color: rgba(79, 70, 229, .55);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, .10);
}

#pipelineView .pipeline-filter-spacer {
    display: none;
}

#pipelineView .pipeline-compact-control {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    min-height: 46px;
    padding: 0 .9rem;
    border: 1px solid var(--border-color, #dbe3ef);
    border-radius: 12px;
    background: var(--bg-white, #fff);
    color: var(--text-muted, #64748b);
    font-size: .87rem;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}

#pipelineView .pipeline-compact-control input {
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: var(--pipeline-primary);
    cursor: pointer;
}

/* ===== Executive workflow statistics ===== */
#pipelineStatsBar {
    width: 100%;
    min-width: 0;
    margin-bottom: 1rem;
}

#pipelineStatsBar .pipeline-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .8rem;
    width: 100%;
    min-width: 0;
}

#pipelineStatsBar .p-stat {
    position: relative;
    min-width: 0;
    min-height: 112px;
    padding: 1.05rem 1.1rem 1rem;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 16px;
    overflow: hidden;
    background: rgba(255, 255, 255, .86);
    box-shadow: 0 9px 24px rgba(15, 23, 42, .05);
}

#pipelineStatsBar .p-stat::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--stat-color, #6366f1);
}

#pipelineStatsBar .p-stat::after {
    content: '';
    position: absolute;
    right: -32px;
    bottom: -40px;
    width: 105px;
    height: 105px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--stat-color, #6366f1) 10%, transparent);
    pointer-events: none;
}

#pipelineStatsBar .p-stat--active { --stat-color: #4f46e5; }
#pipelineStatsBar .p-stat--sla { --stat-color: #ef4444; }
#pipelineStatsBar .p-stat--bottleneck { --stat-color: #f59e0b; }
#pipelineStatsBar .p-stat--completion { --stat-color: #10b981; }

#pipelineStatsBar .p-stat span {
    position: relative;
    z-index: 1;
    display: block;
    margin-bottom: .5rem;
    color: var(--text-muted, #64748b);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .075em;
    text-transform: uppercase;
}

#pipelineStatsBar .p-stat strong {
    position: relative;
    z-index: 1;
    display: block;
    color: var(--stat-color, var(--text-primary, #1e293b));
    font-size: clamp(1.5rem, 2.2vw, 2rem);
    font-weight: 800;
    line-height: 1.15;
    overflow-wrap: break-word;
    word-break: normal;
}

#pipelineStatsBar .p-stat--active strong {
    color: var(--text-primary, #1e293b);
}

/* ===== Kanban board shell and contained scrolling ===== */
#pipelineView .pipeline-board-shell {
    width: 100%;
    min-width: 0;
    padding: .2rem 0 .25rem;
    overflow: hidden;
    box-sizing: border-box;
}

#kanbanBoard,
#kanbanBoard.kanban-board,
#kanbanBoard.kanban-container {
    display: grid !important;
    grid-auto-flow: column !important;
    grid-auto-columns: minmax(288px, 316px) !important;
    grid-template-columns: none !important;
    align-items: stretch !important;
    gap: .9rem !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: .15rem .15rem .9rem !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x proximity;
    scrollbar-gutter: stable;
    box-sizing: border-box;
}

#kanbanBoard::-webkit-scrollbar {
    height: 10px;
}

#kanbanBoard::-webkit-scrollbar-track {
    background: rgba(148, 163, 184, .12);
    border-radius: 999px;
}

#kanbanBoard::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, rgba(79, 70, 229, .48), rgba(99, 102, 241, .62));
    border-radius: 999px;
}

#kanbanBoard .kanban-column {
    display: flex !important;
    flex-direction: column !important;
    align-self: stretch;
    width: 100% !important;
    min-width: 288px !important;
    max-width: 316px !important;
    height: clamp(500px, 58vh, 665px);
    min-height: 500px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 17px;
    background: rgba(248, 250, 252, .86);
    box-shadow: 0 10px 26px rgba(15, 23, 42, .06);
    overflow: hidden;
    scroll-snap-align: start;
    box-sizing: border-box;
}

#kanbanBoard .kanban-column-header {
    position: sticky;
    top: 0;
    z-index: 3;
    flex: 0 0 auto;
    min-height: 64px;
    padding: .9rem .95rem;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(10px);
}

#kanbanBoard .kanban-column-header .flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: .75rem;
}

#kanbanBoard .kanban-column-header h3 {
    margin: 0;
    min-width: 0;
    color: var(--text-primary, #1e293b);
    font-size: .82rem;
    font-weight: 800;
    letter-spacing: .045em;
    line-height: 1.25;
    text-transform: uppercase;
    white-space: normal;
}

#kanbanBoard .count-badge {
    flex: 0 0 auto;
    min-width: 32px;
    height: 28px;
    padding: 0 .55rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    font-weight: 800;
}

#kanbanBoard .kanban-cards-container {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto;
    gap: .75rem;
    min-height: 0;
    padding: .75rem;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    background:
        linear-gradient(rgba(241, 245, 249, .68), rgba(248, 250, 252, .82)),
        repeating-linear-gradient(0deg, transparent, transparent 38px, rgba(148, 163, 184, .035) 39px);
    scrollbar-width: thin;
    scrollbar-color: rgba(100, 116, 139, .45) transparent;
    box-sizing: border-box;
}

#kanbanBoard .kanban-cards-container::-webkit-scrollbar {
    width: 7px;
}

#kanbanBoard .kanban-cards-container::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, .42);
    border-radius: 999px;
}

#kanbanBoard .kanban-cards-container.drag-over {
    background: rgba(79, 70, 229, .10);
    outline: 2px dashed rgba(79, 70, 229, .55);
    outline-offset: -6px;
}

/* ===== Workflow cards ===== */
#kanbanBoard .kanban-card {
    position: relative;
    display: block !important;
    flex: 0 0 auto !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: .9rem !important;
    border: 1px solid rgba(148, 163, 184, .24);
    border-radius: 14px;
    background: var(--bg-white, #fff);
    box-shadow: 0 4px 13px rgba(15, 23, 42, .055);
    cursor: pointer;
    box-sizing: border-box;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

#kanbanBoard .kanban-card::before {
    content: '';
    position: absolute;
    top: 13px;
    bottom: 13px;
    left: 0;
    width: 3px;
    border-radius: 0 999px 999px 0;
    background: rgba(79, 70, 229, .48);
    opacity: 0;
    transition: opacity .16s ease;
}

#kanbanBoard .kanban-card:hover,
#kanbanBoard .kanban-card:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(79, 70, 229, .34);
    box-shadow: 0 11px 24px rgba(15, 23, 42, .10);
    outline: 0;
}

#kanbanBoard .kanban-card:hover::before,
#kanbanBoard .kanban-card:focus-visible::before {
    opacity: 1;
}

#kanbanBoard .kanban-card.dragging {
    opacity: .55;
    transform: rotate(1deg) scale(.99);
}

#kanbanBoard .kanban-card .flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .45rem;
}

#kanbanBoard .kanban-card-tag,
#kanbanBoard .sla-badge,
#kanbanBoard .province-tag {
    max-width: 100%;
    white-space: nowrap;
}

#kanbanBoard .kanban-card-tag {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: .2rem .48rem;
    border-radius: 6px;
    font-size: .66rem;
    font-weight: 800;
    letter-spacing: .025em;
    text-transform: uppercase;
}

#kanbanBoard .priority-critical,
#kanbanBoard .priority-urgent,
#kanbanBoard .priority-high {
    color: #b91c1c;
    background: #fee2e2;
}

#kanbanBoard .priority-medium {
    color: #a16207;
    background: #fef3c7;
}

#kanbanBoard .priority-low {
    color: #047857;
    background: #d1fae5;
}

#kanbanBoard .sla-badge.breached {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .22rem .48rem;
    border-radius: 7px;
    color: #b91c1c;
    background: #fee2e2;
    font-size: .66rem;
    font-weight: 800;
}

#kanbanBoard .kanban-card-title {
    margin: .25rem 0 .7rem;
    color: var(--text-primary, #1e293b);
    font-size: .91rem;
    font-weight: 750;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: break-word;
}

#kanbanBoard .kanban-card-meta {
    display: grid;
    gap: .35rem;
    color: var(--text-muted, #64748b);
    font-size: .75rem;
    line-height: 1.35;
}

#kanbanBoard .kanban-card-meta span {
    min-width: 0;
    overflow-wrap: break-word;
}

#kanbanBoard .kanban-card-meta i {
    width: 15px;
    margin-right: .12rem;
    text-align: center;
}

#kanbanBoard .kanban-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .65rem;
    margin-top: .75rem;
    padding-top: .65rem;
    border-top: 1px solid var(--border-color, #e2e8f0);
}

#kanbanBoard .kanban-card-footer .avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    font-size: .72rem;
    font-weight: 800;
    box-shadow: 0 4px 10px rgba(79, 70, 229, .18);
}

#kanbanBoard .province-tag {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: .2rem .48rem;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 6px;
    color: #64748b;
    background: #f8fafc;
    font-size: .68rem;
    font-weight: 650;
}

#kanbanBoard .empty-column-msg {
    min-height: 185px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    padding: 1rem;
    border: 1px dashed rgba(148, 163, 184, .35);
    border-radius: 13px;
    color: #94a3b8;
    background: rgba(255, 255, 255, .42);
    font-size: .8rem;
    text-align: center;
}

#kanbanBoard .empty-column-msg::before {
    content: '\f07b';
    font-family: 'Font Awesome 5 Free';
    font-size: 1.3rem;
    font-weight: 900;
    opacity: .55;
}

#kanbanBoard .kanban-loading {
    width: min(420px, 100%);
    min-height: 240px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    justify-self: center;
    color: var(--text-muted, #64748b);
}

/* ===== Compact mode ===== */
#pipelineView.pipeline-compact #kanbanBoard,
#pipelineView.pipeline-compact #kanbanBoard.kanban-board {
    grid-auto-columns: minmax(250px, 275px) !important;
}

#pipelineView.pipeline-compact #kanbanBoard .kanban-column {
    min-width: 250px !important;
    max-width: 275px !important;
}

#pipelineView.pipeline-compact #kanbanBoard .kanban-card {
    padding: .7rem !important;
}

#pipelineView.pipeline-compact #kanbanBoard .kanban-card-title {
    margin-bottom: .5rem;
    font-size: .84rem;
    -webkit-line-clamp: 2;
}

#pipelineView.pipeline-compact #kanbanBoard .kanban-card-meta {
    font-size: .7rem;
}

#pipelineView.pipeline-compact #kanbanBoard .kanban-card-footer {
    margin-top: .55rem;
    padding-top: .5rem;
}

/* ===== Responsive behaviour ===== */
@media (min-width: 1600px) {
    #kanbanBoard,
    #kanbanBoard.kanban-board,
    #kanbanBoard.kanban-container {
        grid-auto-columns: minmax(300px, 330px) !important;
    }

    #kanbanBoard .kanban-column {
        min-width: 300px !important;
        max-width: 330px !important;
    }
}

@media (max-width: 1180px) {
    #pipelineView .pipeline-page-header {
        align-items: flex-start !important;
        flex-direction: column;
    }

    #pipelineView .pipeline-navigation {
        width: 100%;
    }

    #pipelineView .pipeline-filter-toolbar {
        grid-template-columns: minmax(240px, 1fr) minmax(150px, .55fr);
    }

    #pipelineView .pipeline-compact-control {
        justify-content: flex-start;
    }

    #pipelineStatsBar .pipeline-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    #pipelineView {
        padding: .85rem;
    }

    #pipelineView .pipeline-page-heading h1 {
        font-size: 1.55rem;
    }

    #pipelineView .pipeline-navigation {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        overflow: visible;
    }

    #pipelineView .pipeline-tab {
        width: 100%;
    }

    #pipelineView .pipeline-filter-toolbar {
        grid-template-columns: minmax(0, 1fr);
        padding: .7rem;
    }

    #pipelineStatsBar .pipeline-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .65rem;
    }

    #pipelineStatsBar .p-stat {
        min-height: 100px;
        padding: .9rem;
    }

    #kanbanBoard,
    #kanbanBoard.kanban-board,
    #kanbanBoard.kanban-container {
        grid-auto-columns: minmax(280px, 88vw) !important;
        gap: .75rem !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
    }

    #kanbanBoard .kanban-column {
        min-width: 280px !important;
        max-width: 88vw !important;
        height: min(620px, 68vh);
        min-height: 470px;
    }
}

@media (max-width: 480px) {
    #pipelineStatsBar .pipeline-stats-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    #pipelineView .pipeline-navigation {
        grid-template-columns: minmax(0, 1fr);
    }

    #kanbanBoard,
    #kanbanBoard.kanban-board,
    #kanbanBoard.kanban-container {
        grid-auto-columns: minmax(268px, 90vw) !important;
    }

    #kanbanBoard .kanban-column {
        min-width: 268px !important;
        max-width: 90vw !important;
    }
}

/* ===== Dark mode ===== */
body.dark-mode #pipelineView .pipeline-navigation,
body.dark-mode #pipelineView .pipeline-filter-toolbar,
body.dark-mode #pipelineView .pipeline-filter-field,
body.dark-mode #pipelineView .pipeline-filter-toolbar select,
body.dark-mode #pipelineView .pipeline-compact-control,
body.dark-mode #pipelineStatsBar .p-stat,
body.dark-mode #kanbanBoard .kanban-column,
body.dark-mode #kanbanBoard .kanban-column-header,
body.dark-mode #kanbanBoard .kanban-card {
    background: var(--bg-secondary, #111827);
}

body.dark-mode #kanbanBoard .kanban-cards-container {
    background: rgba(15, 23, 42, .58);
}

body.dark-mode #kanbanBoard .province-tag,
body.dark-mode #kanbanBoard .empty-column-msg {
    background: rgba(15, 23, 42, .45);
}

@media (prefers-reduced-motion: reduce) {
    #pipelineView *,
    #pipelineView *::before,
    #pipelineView *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* ===== V7 live stage-checklist and overdue state ===== */
#kanbanBoard .kanban-card-topline {
    margin-bottom: .5rem;
}

#kanbanBoard .stage-checklist {
    --checklist-color: #2563eb;
    --checklist-soft: rgba(37, 99, 235, .13);
    --checklist-progress: 0%;
    margin: .15rem 0 .72rem;
    padding: .62rem .66rem .58rem;
    border: 1px solid color-mix(in srgb, var(--checklist-color) 22%, var(--border-color, #e2e8f0));
    border-radius: 11px;
    background: linear-gradient(135deg, var(--checklist-soft), rgba(255, 255, 255, .82));
}

#kanbanBoard .stage-checklist-head,
#kanbanBoard .stage-checklist-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .55rem;
}

#kanbanBoard .stage-checklist-head {
    margin-bottom: .48rem;
    color: var(--text-secondary, #475569);
    font-size: .69rem;
    font-weight: 750;
}

#kanbanBoard .stage-checklist-head > span:first-child {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    min-width: 0;
}

#kanbanBoard .stage-checklist-head i {
    color: var(--checklist-color);
}

#kanbanBoard .stage-checklist-head strong {
    flex: 0 0 auto;
    color: var(--text-primary, #1e293b);
    font-size: .69rem;
    font-weight: 800;
    white-space: nowrap;
}

#kanbanBoard .stage-checklist-head strong em {
    color: var(--checklist-color);
    font-style: normal;
}

#kanbanBoard .stage-checklist-track {
    position: relative;
    width: 100%;
    height: 7px;
    border-radius: 999px;
    overflow: visible;
    background: rgba(148, 163, 184, .22);
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, .08);
}

#kanbanBoard .stage-checklist-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: var(--checklist-progress);
    min-width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, color-mix(in srgb, var(--checklist-color) 72%, white), var(--checklist-color));
    box-shadow: 0 0 8px color-mix(in srgb, var(--checklist-color) 35%, transparent);
    transition: width .45s ease, background-color .3s ease;
}

#kanbanBoard .stage-checklist-marker {
    position: absolute;
    top: 50%;
    width: 3px;
    height: 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .92);
    border: 1px solid rgba(100, 116, 139, .28);
    transform: translate(-50%, -50%);
    z-index: 2;
    pointer-events: none;
}

#kanbanBoard .stage-checklist-marker--end {
    transform: translate(-100%, -50%);
}

#kanbanBoard .stage-checklist-foot {
    margin-top: .42rem;
    color: var(--text-muted, #64748b);
    font-size: .6rem;
    font-weight: 650;
    line-height: 1.25;
}

#kanbanBoard .stage-checklist-state {
    display: inline-flex;
    align-items: center;
    min-height: 18px;
    padding: .08rem .38rem;
    border-radius: 999px;
    color: var(--checklist-color);
    background: color-mix(in srgb, var(--checklist-color) 12%, white);
    font-weight: 800;
    white-space: nowrap;
}

#kanbanBoard .stage-checklist--empty {
    margin-top: .05rem;
    padding: .45rem .58rem;
    border-style: dashed;
    background: rgba(248, 250, 252, .72);
}

#kanbanBoard .stage-checklist--empty .stage-checklist-head {
    margin: 0;
    color: #94a3b8;
}

#kanbanBoard .stage-checklist-empty-label {
    font-size: .61rem;
    font-weight: 750;
    white-space: nowrap;
}

#pipelineView.pipeline-compact #kanbanBoard .stage-checklist {
    margin-bottom: .55rem;
    padding: .5rem .55rem;
}

#pipelineView.pipeline-compact #kanbanBoard .stage-checklist-foot {
    display: none;
}

body.dark-mode #kanbanBoard .stage-checklist {
    background: linear-gradient(135deg, color-mix(in srgb, var(--checklist-color) 14%, transparent), rgba(15, 23, 42, .62));
}

body.dark-mode #kanbanBoard .stage-checklist-state {
    background: color-mix(in srgb, var(--checklist-color) 20%, #0f172a);
}

body.dark-mode #kanbanBoard .stage-checklist--empty {
    background: rgba(15, 23, 42, .38);
}


/* ===== V7 consistency corrections ===== */
#kanbanBoard .kanban-card-topline {
    min-height: 24px;
    align-items: center;
}
#kanbanBoard .sla-badge.breached {
    flex: 0 0 auto;
    max-width: 100%;
    border: 1px solid rgba(220, 38, 38, .24);
    box-shadow: 0 3px 10px rgba(220, 38, 38, .10);
    white-space: nowrap;
}
#kanbanBoard .stage-checklist--unassigned {
    border-style: dashed;
    opacity: .94;
}
#kanbanBoard .stage-checklist--unassigned .stage-checklist-track {
    background: repeating-linear-gradient(135deg,rgba(148,163,184,.18) 0,rgba(148,163,184,.18) 6px,rgba(148,163,184,.08) 6px,rgba(148,163,184,.08) 12px);
}
#kanbanBoard .stage-checklist--unassigned .stage-checklist-state {
    color: #b91c1c;
    background: rgba(220, 38, 38, .09);
}
body.dark-mode #kanbanBoard .stage-checklist--unassigned .stage-checklist-state {
    color: #fca5a5;
    background: rgba(220, 38, 38, .18);
}
