﻿.kanban-board {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.kanban-column {
    width: 320px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px;
}

.kanban-column-header {
    font-weight: bold;
    padding: 6px;
    border-bottom: 1px solid #ddd;
    margin-bottom: 8px;
}

.kanban-column-cards {
    min-height: 120px;
}

.kanban-card {
    background: white;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
    padding: 8px;
    margin-bottom: 8px;
    cursor: grab;
}

.card-subject {
    font-weight: 600;
}

.card-meta {
    font-size: 0.85em;
    color: #666;
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

/* Title */
.kb-title {
    margin: 8px 0 12px;
    font-weight: 700;
}

/* Board */
.kb-board {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding-bottom: 16px;
}

    .kb-board.kb-rtl {
        direction: rtl;
    }

/* Column */
.kb-column {
    width: 320px;
    background: #f6f7f9;
    border: 1px solid #e3e6ea;
    border-radius: 8px;
    padding: 8px;
}

.kb-col-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px 8px;
    border-bottom: 1px solid #e3e6ea;
    margin-bottom: 8px;
}

.kb-col-title {
    font-weight: 600;
}

.kb-col-count {
    background: #e9eefb;
    color: #3a57d1;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 700;
}

.kb-col-cards {
    min-height: 140px;
}

    .kb-col-cards.kb-drop-hot {
        outline: 2px dashed #3a57d1;
        outline-offset: 2px;
    }

/* Card */
.kb-card {
    background: #fff;
    border: 1px solid #e8eaee;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
    padding: 10px;
    margin-bottom: 8px;
    cursor: grab;
    user-select: none;
}

    .kb-card:active {
        cursor: grabbing;
    }

.kb-card-dragging {
    opacity: .6;
}

.kb-card-subject {
    font-weight: 600;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kb-card-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    font-size: .85rem;
    color: #586174;
}

.kb-chip {
    background: #f1f3f7;
    border-radius: 4px;
    padding: 1px 6px;
    border: 1px solid #e2e6ef;
}

.kb-prio-0 {
    background: #eaf7ee;
    color: #277a3e;
    border-color: #cdebd5;
}

.kb-prio-1 {
    background: #f1f3f7;
    color: #344054;
    border-color: #e2e6ef;
}

.kb-prio-2 {
    background: #fdecef;
    color: #b42318;
    border-color: #f8cfd6;
}

/* Loading */
.kb-loading {
    padding: 12px;
    color: #555;
}

.kanban-column-cards {
    min-height: 160px; /* give room for empty columns */
    padding-bottom: 4px;
}

.kb-drop-hot {
    outline: 2px dashed #3a57d1;
    outline-offset: 2px;
}
/* Page layout */
.kanban-page {
    padding: 8px 16px 16px;
}

/* Top bar */
.kanban-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    gap: 12px;
}

.kanban-topbar-left {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.kanban-title {
    margin: 0;
    font-weight: 700;
}

.kanban-total {
    font-size: 0.9rem;
    color: #6b7280;
}

/* Filter buttons */
.kanban-topbar-right {
    display: flex;
    gap: 6px;
}

.kanban-filter-btn {
    border-radius: 999px;
    padding: 4px 12px;
    border: 1px solid #d1d5db;
    background: #fff;
    font-size: 0.85rem;
    cursor: pointer;
}

    .kanban-filter-btn.active {
        border-color: #2563eb;
        background: #2563eb;
        color: #fff;
    }

/* Stats row */
.kanban-stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.kanban-stat-card {
    min-width: 150px;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
}

    .kanban-stat-card .stat-title {
        font-size: 0.82rem;
        color: #6b7280;
    }

    .kanban-stat-card .stat-count {
        font-size: 1.2rem;
        font-weight: 600;
    }

.stat-bar {
    height: 4px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
    margin-top: 4px;
}

.stat-bar-inner {
    height: 100%;
    background: #3b82f6;
}

/* Status colors for stats */
.kanban-stat-card.status-0 .stat-bar-inner {
    background: #6b7280;
}
/* NotStarted */
.kanban-stat-card.status-1 .stat-bar-inner {
    background: #0ea5e9;
}
/* InProgress */
.kanban-stat-card.status-2 .stat-bar-inner {
    background: #16a34a;
}
/* Completed */
.kanban-stat-card.status-3 .stat-bar-inner {
    background: #f97316;
}
/* Deferred */

/* Column header enhancements (uses your existing .kanban-column & .kanban-column-header) */
.kanban-column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.kanban-column-header-main {
    display: flex;
    gap: 6px;
    align-items: center;
}

.kanban-column-title {
    font-weight: 600;
}

.kanban-column-count {
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 999px;
    background: #e5e7eb;
    color: #374151;
}

/* Add button */
.kanban-add-btn {
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 0.8rem;
    border: 1px dashed #9ca3af;
    background: #f9fafb;
    cursor: pointer;
}

    .kanban-add-btn:hover {
        border-style: solid;
    }

/* Column status colors (border or header accent) */
.kanban-column.status-0 .kanban-column-header {
    border-bottom: 2px solid #6b7280;
}
/* NotStarted */
.kanban-column.status-1 .kanban-column-header {
    border-bottom: 2px solid #0ea5e9;
}
/* InProgress */
.kanban-column.status-2 .kanban-column-header {
    border-bottom: 2px solid #16a34a;
}
/* Completed */
.kanban-column.status-3 .kanban-column-header {
    border-bottom: 2px solid #f97316;
}
/* Deferred */

/* Drop highlight */
.kanban-column-cards {
    min-height: 150px;
}

.kanban-drop-hot {
    outline: 2px dashed #2563eb;
    outline-offset: 2px;
}

/* Card chips */
.card-chip {
    background: #f3f4f6;
    border-radius: 4px;
    padding: 1px 6px;
    border: 1px solid #e5e7eb;
    font-size: 0.8rem;
}

.prio-0 {
    background: #e5f9ed;
    color: #166534;
    border-color: #bbf7d0;
}

.prio-1 {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

.prio-2 {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
}

.card-chip-assignees {
    max-width: 150px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Dragged card style */
.kanban-card-dragging {
    opacity: 0.6;
}

/* Loading */
.kanban-loading {
    padding: 12px;
    color: #4b5563;
}

/* Page wrapper / top bar already added in previous step – keep those. */

/* Overdue card styling */
.kanban-card-overdue {
    border: 1px solid #dc2626;
    box-shadow: 0 0 0 1px rgba(220,38,38,0.35);
}

.card-chip-overdue {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
}

/* WIP limit highlighting */
.kanban-column-over-limit {
    background: #fff7ed; /* light orange */
}

.kanban-stat-card.over-limit {
    border-color: #f97316;
    box-shadow: 0 0 0 1px rgba(249,115,22,0.25);
}

.kanban-column-wip {
    font-size: 0.75rem;
    color: #f97316;
}

/* Card header & icon button */
.kanban-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 4px;
    margin-bottom: 4px;
}

.kanban-card-icon-btn {
    border: none;
    background: transparent;
    padding: 0 2px;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
}

/* Quick edit modal */
.kanban-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 5000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.kanban-modal {
    background: #fff;
    border-radius: 8px;
    padding: 14px 16px 12px;
    min-width: 360px;
    max-width: 480px;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.35);
}

.kanban-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.kanban-modal-close {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1.1rem;
}

.kanban-modal-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

.form-row-2 {
    display: flex;
    gap: 8px;
}

    .form-row-2 .form-group {
        flex: 1;
    }

.kanban-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

.kanban-board-toasts {
    position: fixed;
    bottom: 16px;
    right: 20px;
    z-index: 5500;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.kanban-board-toast {
    background: #111827;
    color: #f9fafb;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.45);
}

/* Assignee list in modal */
.kanban-assignees-list {
    max-height: 180px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 6px 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.kanban-assignee-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
}

/* Swimlanes */
.kanban-swimlanes {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.kanban-swimlane-row {
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    padding: 6px 8px 10px;
}

.kanban-swimlane-header {
    font-weight: 600;
    margin-bottom: 6px;
    color: #374151;
}

.kanban-swimlane-board {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.swimlane-column {
    width: 260px;
}

