/* ── KanBan Component ─────────────────────────────────────────────────────── */

.i-kanban-parent {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;       /* prevent flex child from pushing parent wider */
    min-height: 0;
    flex-grow:1;
}

/* Board — horizontal scroll */
.i-kanban-board {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 12px 16px 16px 16px;
    align-items: stretch;
    user-select: none;
    flex: 1 1 0;        /* fills parent height; width = cross-axis = 100% of parent */
    min-width: 0;       /* prevents flex child from overflowing parent width */
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.i-kanban-board::-webkit-scrollbar        { height: 6px; }
.i-kanban-board::-webkit-scrollbar-track  { background: transparent; }
.i-kanban-board::-webkit-scrollbar-thumb  { background: #cbd5e1; border-radius: 3px; }

/* Column */
.i-kanban-column {
    display: flex;
    flex-direction: column;
    flex: 0 0 272px;
    min-height: 0;
    background: #f1f5f9;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.i-kanban-column-header {
    display: flex;
    flex-direction: column;
    padding: 11px 14px 10px 14px;
    flex-shrink: 0;
    border-bottom: 1px solid #e2e8f0;
    gap: 4px;
}

.i-kanban-column-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.i-kanban-column-title {
    font-weight: 600;
    font-size: 0.85em;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #475569;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.i-kanban-column-value {
    font-size: 0.78em;
    font-weight: 600;
    color: #64748b;
    letter-spacing: 0.01em;
}

.i-kanban-column-badge {
    background: #e2e8f0;
    color: #64748b;
    border-radius: 10px;
    padding: 1px 8px;
    font-size: 0.76em;
    font-weight: 700;
    flex-shrink: 0;
    min-width: 20px;
    text-align: center;
}

/* Elements container — vertical scroll */
.i-kanban-column-elements {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 10px 10px 12px 10px;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 48px;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.i-kanban-column-elements::-webkit-scrollbar        { width: 4px; }
.i-kanban-column-elements::-webkit-scrollbar-track  { background: transparent; }
.i-kanban-column-elements::-webkit-scrollbar-thumb  { background: #cbd5e1; border-radius: 2px; }

/* Card */
.i-kanban-element {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);
    position: relative;
    z-index: 1;
    cursor: grab;
    transition: box-shadow 0.18s ease, transform 0.18s ease;
    box-sizing: border-box;
    width: 100%;
    flex-shrink: 0;
}

.i-kanban-element:hover {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14);
    transform: translateY(-2px);
}

/* Ghost card during drag */
.i-kanban-element--dragging {
    position: fixed !important;
    z-index: 9000 !important;
    pointer-events: none !important;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.22) !important;
    transform: rotate(1.5deg) scale(1.03) !important;
    transition: none !important;
    opacity: 0.96;
    cursor: grabbing;
}

.i-kanban-element-body {
    padding: 12px 14px;
}

/* Invisible drag zones on card */
.i-kanban-element-dragbox-top,
.i-kanban-element-dragbox-bottom {
    position: absolute;
    left: 0;
    width: 100%;
    height: 50%;
    z-index: 2;
}

.i-kanban-element-dragbox-top    { top: 0; }
.i-kanban-element-dragbox-bottom { bottom: 0; }

/* Animated placeholder */
.i-kanban-placeholder {
    border-radius: 8px;
    background: #dbeafe;
    border: 2px dashed #93c5fd;
    flex-shrink: 0;
    animation: i-kanban-pulse 0.9s ease-in-out infinite;
}

@keyframes i-kanban-pulse {
    0%, 100% { opacity: 0.55; }
    50%       { opacity: 1.0;  }
}

/* Loading state */
.i-kanban-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 48px 24px;
    color: #94a3b8;
    font-size: 0.92em;
    flex: 1;
}

/* Error banner */
.i-kanban-error {
    margin: 12px;
    padding: 10px 14px;
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 6px;
    color: #dc2626;
    font-size: 0.88em;
    animation: i-kanban-fadein 0.2s ease;
}

.i-kanban-save-error {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    padding: 8px 16px;
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 6px;
    color: #dc2626;
    font-size: 0.85em;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    animation: i-kanban-fadein 0.2s ease;
}

@keyframes i-kanban-fadein {
    from { opacity: 0; transform: translateX(-50%) translateY(-4px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0);    }
}
