/* ============================================
   ImportPanel v5.0 - Kanban Board Page
   ============================================ */

/* ---- View Toggle (Flat / Swimlane) ---- */
.kanban-view-toggle {
    display: flex;
    align-items: center;
    gap: 2px;
    background: var(--color-surface-alt);
    border-radius: var(--radius-md);
    padding: 3px;
    margin-left: auto;
}

.kanban-view-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: none;
    background: none;
    color: var(--color-text-muted);
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.kanban-view-btn:hover {
    color: var(--color-text);
    background: var(--color-surface);
}

.kanban-view-btn.kanban-view-btn-active {
    background: var(--color-surface);
    color: var(--color-primary);
    box-shadow: var(--shadow-sm);
    font-weight: 600;
}

.kanban-view-btn svg {
    flex-shrink: 0;
}

/* ---- Minimap / Overview Bar ---- */
.kanban-minimap {
    display: flex;
    align-items: stretch;
    gap: 2px;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    min-height: 52px;
}

.kanban-minimap-segment {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    position: relative;
    min-width: 0;
}

.kanban-minimap-bar {
    height: 6px;
    width: 0%;
    border-radius: 3px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    align-self: stretch;
    min-width: 4px;
}

.kanban-minimap-bar-planning {
    background-color: var(--color-info);
}

.kanban-minimap-bar-transit {
    background-color: var(--color-warning);
}

.kanban-minimap-bar-customs {
    background-color: var(--color-primary);
}

.kanban-minimap-bar-delivered {
    background-color: var(--color-success);
}

.kanban-minimap-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.kanban-minimap-count {
    font-size: 11px;
    font-weight: 500;
    color: var(--color-text-muted);
}

/* ---- Board Layout ---- */
.kanban-board {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    min-height: calc(100vh - 260px);
    padding-bottom: 16px;
    -webkit-overflow-scrolling: touch;
}

/* ---- Column ---- */
.kanban-column {
    flex: 1;
    min-width: 280px;
    max-width: 340px;
    background-color: var(--color-surface-alt);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s ease, box-shadow 0.3s ease, min-width 0.3s ease, max-width 0.3s ease, padding 0.3s ease;
}

/* Column drag-over highlight */
.kanban-column.kanban-column-drag-over {
    background-color: rgba(59, 130, 246, 0.06);
    box-shadow: inset 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Column collapsed state */
.kanban-column.kanban-column-collapsed {
    min-width: 48px;
    max-width: 48px;
    padding: 12px 0;
    cursor: pointer;
    align-items: center;
    overflow: hidden;
}

.kanban-column.kanban-column-collapsed:hover {
    background-color: var(--color-surface);
}

.kanban-column.kanban-column-collapsed .kanban-column-header {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.kanban-column.kanban-column-collapsed .kanban-column-header-top {
    display: none;
}

.kanban-column.kanban-column-collapsed .kanban-column-header-left {
    display: none;
}

.kanban-column.kanban-column-collapsed .kanban-column-header-right {
    display: none;
}

.kanban-column.kanban-column-collapsed .kanban-column-total {
    display: none;
}

.kanban-column.kanban-column-collapsed .kanban-column-stats {
    display: none;
}

.kanban-column.kanban-column-collapsed .kanban-wip-indicator {
    display: none !important;
}

/* Collapsed column inner content (toggle, icon, label, count, total) */
.kanban-column-collapsed-content {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 0 4px;
}

.kanban-column.kanban-column-collapsed .kanban-column-collapsed-content {
    display: flex;
}

/* Collapsed column toggle button */
.kanban-column-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: none;
    color: var(--color-text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background 0.15s, color 0.15s;
    padding: 0;
    flex-shrink: 0;
}

.kanban-column-toggle:hover {
    background: var(--color-surface);
    color: var(--color-text);
}

.kanban-column-toggle svg {
    transition: transform 0.2s ease;
}

/* Collapsed status color dot */
.kanban-column-collapsed-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 4px;
}

.kanban-column-collapsed-dot-planning {
    background-color: var(--color-info);
}

.kanban-column-collapsed-dot-transit {
    background-color: var(--color-warning);
}

.kanban-column-collapsed-dot-customs {
    background-color: var(--color-primary);
}

.kanban-column-collapsed-dot-delivered {
    background-color: var(--color-success);
}

/* Collapsed column vertical label */
.kanban-column-collapsed-label {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-secondary);
    white-space: nowrap;
    letter-spacing: 0.03em;
    transform: rotate(180deg);
    padding: 8px 0;
    user-select: none;
    -webkit-user-select: none;
}

/* Collapsed column count badge */
.kanban-column-collapsed-count {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 4px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.kanban-column-collapsed-count-planning {
    background-color: var(--color-info);
}

.kanban-column-collapsed-count-transit {
    background-color: var(--color-warning);
}

.kanban-column-collapsed-count-customs {
    background-color: var(--color-primary);
}

.kanban-column-collapsed-count-delivered {
    background-color: var(--color-success);
}

/* Collapsed column total value (bottom) */
.kanban-column-collapsed-total {
    display: none;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    font-size: 10px;
    font-weight: 500;
    color: var(--color-text-muted);
    white-space: nowrap;
    margin-top: auto;
    padding-top: 8px;
}

.kanban-column.kanban-column-collapsed .kanban-column-collapsed-total {
    display: block;
}

/* "Rozwin wszystkie" button */
.kanban-expand-all-wrap {
    display: none;
    justify-content: center;
    padding: 12px 0;
}

.kanban-expand-all-wrap.kanban-expand-all-visible {
    display: flex;
}

.kanban-expand-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text-secondary);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.kanban-expand-all-btn:hover {
    background: var(--color-primary-light);
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.kanban-expand-all-btn svg {
    flex-shrink: 0;
}

/* Cards wrapper for collapse animation */
.kanban-cards-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: opacity 0.3s ease, max-height 0.3s ease;
}

.kanban-cards-wrapper-collapsed {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    pointer-events: none;
}

.kanban-column-header {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 16px;
    padding: 10px 12px 12px;
    border-bottom: 3px solid var(--color-border);
    background: rgba(0, 0, 0, 0.02);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.kanban-column-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.kanban-column-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.kanban-column-header-right {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.kanban-column-title {
    color: var(--color-text);
}

/* Collapse toggle button */
.kanban-collapse-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    background: none;
    color: var(--color-text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
    padding: 0;
}

.kanban-collapse-btn:hover {
    background: var(--color-surface);
    color: var(--color-text);
}

.kanban-collapse-icon {
    display: flex;
    align-items: center;
    transition: transform 0.2s ease;
}

.kanban-collapse-icon-collapsed {
    transform: rotate(-90deg);
}

/* WIP settings button */
.kanban-wip-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    background: none;
    color: var(--color-text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background 0.15s, color 0.15s;
    padding: 0;
    opacity: 0.5;
}

.kanban-wip-btn:hover {
    background: var(--color-surface);
    color: var(--color-text);
    opacity: 1;
}

/* WIP Indicator */
.kanban-wip-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    font-size: 11px;
    font-weight: 500;
    color: var(--color-text-muted);
    transition: background 0.2s, color 0.2s;
}

.kanban-wip-text {
    display: flex;
    align-items: center;
    gap: 4px;
}

.kanban-wip-limit-value {
    font-weight: 600;
    color: var(--color-text-secondary);
}

/* WIP Warning state (at limit) */
.kanban-column.kanban-wip-warning {
    background-color: rgba(245, 158, 11, 0.04);
}

.kanban-column.kanban-wip-warning .kanban-wip-indicator {
    background: rgba(245, 158, 11, 0.12);
    color: #b45309;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.kanban-column.kanban-wip-warning .kanban-wip-limit-value {
    color: #d97706;
}

.kanban-column.kanban-wip-warning .kanban-column-header {
    border-bottom-color: #f59e0b;
    background: rgba(245, 158, 11, 0.06);
}

/* WIP Exceeded state (over limit) */
.kanban-column.kanban-wip-exceeded {
    background-color: rgba(239, 68, 68, 0.04);
}

.kanban-column.kanban-wip-exceeded .kanban-wip-indicator {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.kanban-column.kanban-wip-exceeded .kanban-wip-limit-value {
    color: #dc2626;
}

.kanban-column.kanban-wip-exceeded .kanban-column-header {
    border-bottom-color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.06);
}

/* Column total value */
.kanban-column-total {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: var(--color-text-muted);
    margin-top: 6px;
    letter-spacing: 0.02em;
    min-height: 15px;
}

/* ---- Column Statistics (enhanced) ---- */
.kanban-column-stats {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 0;
    margin-top: 4px;
    font-size: 12px;
    color: var(--color-text-secondary);
    border-top: 1px solid var(--color-border-light);
}

.kanban-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kanban-stat-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.kanban-stat-value {
    font-weight: 600;
    font-size: 12px;
    color: var(--color-text);
}

/* Value percentage bar */
.kanban-value-bar {
    height: 3px;
    background: var(--color-border);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 4px;
}

.kanban-value-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Mini Sparkline */
.kanban-sparkline-wrap {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid var(--color-border-light);
}

.kanban-sparkline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.kanban-sparkline-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.kanban-sparkline-total {
    font-size: 10px;
    font-weight: 500;
    color: var(--color-text-secondary);
}

.kanban-sparkline-svg {
    display: block;
    width: 100%;
    height: 24px;
}

.kanban-sparkline-empty {
    font-size: 10px;
    color: var(--color-text-muted);
    text-align: center;
    padding: 2px 0;
}

/* ---- WIP Settings Popover ---- */
.kanban-wip-popover {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 14px;
    box-shadow: var(--shadow-lg);
    z-index: 200;
    min-width: 200px;
    animation: kanbanPopoverIn 0.15s ease-out;
}

@keyframes kanbanPopoverIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.kanban-wip-popover-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 2px;
}

.kanban-wip-popover-subtitle {
    font-size: 11px;
    color: var(--color-text-muted);
    margin-bottom: 10px;
}

.kanban-wip-popover-input {
    width: 100%;
    height: 36px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0 10px;
    font-size: 14px;
    font-family: inherit;
    color: var(--color-text);
    background: var(--color-surface-alt);
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.kanban-wip-popover-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(79, 143, 247, 0.15);
}

.kanban-wip-popover-hint {
    font-size: 11px;
    color: var(--color-text-muted);
    margin-top: 4px;
    margin-bottom: 10px;
}

.kanban-wip-popover-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.kanban-wip-popover-actions .btn {
    font-size: 12px;
    padding: 5px 12px;
}

/* WIP exceeded pulsing border */
.kanban-column.kanban-wip-exceeded {
    animation: wipPulse 2s ease-in-out infinite;
}

@keyframes wipPulse {
    0%, 100% {
        box-shadow: none;
    }
    50% {
        box-shadow: inset 0 0 0 2px rgba(239, 68, 68, 0.2);
    }
}

@media (prefers-reduced-motion: reduce) {
    .kanban-column.kanban-wip-exceeded {
        animation: none;
        box-shadow: inset 0 0 0 2px rgba(239, 68, 68, 0.15);
    }
}

/* Stat item (kept for backward compat) */
.kanban-stat-item {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
}

.kanban-stat-sep {
    color: var(--color-border);
    font-weight: 300;
    margin: 0 1px;
}

/* Column top-border colors by status */
.kanban-column.planning .kanban-column-header {
    border-bottom-color: var(--color-info);
}

.kanban-column.transit .kanban-column-header {
    border-bottom-color: var(--color-warning);
}

.kanban-column.customs .kanban-column-header {
    border-bottom-color: var(--color-primary);
}

.kanban-column.delivered .kanban-column-header {
    border-bottom-color: var(--color-text-muted);
}
.kanban-column.delivered {
    opacity: 0.55;
    background: var(--color-bg-secondary);
}
.kanban-column.delivered:hover {
    opacity: 0.75;
}
.kanban-column.delivered .kanban-card {
    border-left-color: var(--color-text-muted);
}

/* ---- Count Badge ---- */
.kanban-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    text-align: center;
    border-radius: 11px;
    background: rgba(0, 0, 0, 0.06);
    color: var(--color-text-secondary);
}

/* ---- Cards Container ---- */
.kanban-cards {
    flex: 1;
    overflow-y: auto;
    min-height: 60px;
    border-radius: var(--radius-md);
    transition: background-color 0.3s ease, border-color 0.3s ease;
    border: 2px solid transparent;
    padding: 2px;
    border-bottom: 2px dotted var(--color-border-light);
}

.kanban-cards.drag-over {
    background-color: rgba(59, 130, 246, 0.08);
    border: 2px dashed var(--color-primary);
    border-radius: var(--radius-md);
}

/* ---- Card Placeholder (ghost during drag) ---- */
.kanban-card-placeholder {
    border: 2px dashed var(--color-primary);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.06), rgba(59, 130, 246, 0.02));
    transition: height 0.2s ease;
    position: relative;
    overflow: hidden;
}

.kanban-card-placeholder::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.15), transparent);
    animation: placeholderShimmer 1.5s infinite;
}

@keyframes placeholderShimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* ---- Drag Ghost (custom drag image) ---- */
.kanban-drag-ghost {
    opacity: 0.95 !important;
    transform: rotate(2deg) scale(1.02) !important;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.25), 0 8px 16px rgba(0, 0, 0, 0.15) !important;
    border: 1px solid var(--color-primary) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

/* ---- Card ---- */
.kanban-card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
    cursor: grab;
    transition: box-shadow 0.2s ease, transform 0.2s ease, opacity 0.2s ease, border-color 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-left: 4px solid var(--color-border);
    position: relative;
    animation: kanbanCardFadeUp 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Staggered kanban card entrance animation */
.kanban-card:nth-child(1) { animation-delay: 0ms; }
.kanban-card:nth-child(2) { animation-delay: 50ms; }
.kanban-card:nth-child(3) { animation-delay: 100ms; }
.kanban-card:nth-child(4) { animation-delay: 150ms; }
.kanban-card:nth-child(5) { animation-delay: 200ms; }
.kanban-card:nth-child(6) { animation-delay: 250ms; }
.kanban-card:nth-child(7) { animation-delay: 300ms; }
.kanban-card:nth-child(8) { animation-delay: 350ms; }

@keyframes kanbanCardFadeUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Card left border by status */
.kanban-card.kanban-card-status-planning {
    border-left-color: var(--color-info);
}

.kanban-card.kanban-card-status-transit {
    border-left-color: var(--color-warning);
}

.kanban-card.kanban-card-status-customs {
    border-left-color: var(--color-primary);
}

.kanban-card.kanban-card-status-delivered {
    border-left-color: var(--color-success);
}

/* Card hover: lift effect + expand slightly + show preview */
.kanban-card:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14), 0 4px 8px rgba(0, 0, 0, 0.08);
}

.kanban-card:hover .kanban-card-hover-preview {
    opacity: 1;
    transform: translateY(0);
    max-height: 60px;
}

.kanban-card:hover .kanban-card-footer {
    padding-bottom: 20px;
}

/* Card active state (popup open) */
.kanban-card.kanban-card-active {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(79, 143, 247, 0.2), 0 4px 12px rgba(0, 0, 0, 0.1);
}

.kanban-card:active {
    cursor: grabbing;
}

.kanban-card.dragging {
    opacity: 0.4;
    transform: scale(0.95);
    box-shadow: var(--shadow-sm);
    border: 1px dashed var(--color-border);
    background: var(--color-surface-alt);
}

.kanban-card:last-child {
    margin-bottom: 0;
}

/* ---- Card Search Highlight ---- */
.kanban-card.kanban-card-highlight {
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.5), 0 4px 12px rgba(245, 158, 11, 0.15);
    border-color: #f59e0b;
}

.kanban-card.kanban-card-highlight .kanban-card-title {
    color: #d97706;
}

/* ---- Card Priority Badge ---- */
.kanban-card-priority {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 3px 10px;
    border-radius: 12px;
    margin-bottom: 8px;
    line-height: 1.4;
}

.kanban-card-priority svg {
    flex-shrink: 0;
}

.kanban-priority-overdue {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

.kanban-priority-high {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.kanban-priority-medium {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.kanban-priority-low {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

.kanban-priority-urgent {
    background: rgba(249, 115, 22, 0.12);
    color: #ea580c;
}

.kanban-priority-soon {
    background: rgba(234, 179, 8, 0.1);
    color: #ca8a04;
}

.kanban-priority-normal {
    background: rgba(107, 114, 128, 0.08);
    color: #6b7280;
}

/* Priority badge in popup */
.kanban-priority-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 12px;
    border-radius: 12px;
}

.kanban-priority-badge.kanban-priority-overdue {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

.kanban-priority-badge.kanban-priority-high {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.kanban-priority-badge.kanban-priority-medium {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.kanban-priority-badge.kanban-priority-low {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

.kanban-priority-badge.kanban-priority-urgent {
    background: rgba(249, 115, 22, 0.12);
    color: #ea580c;
}

.kanban-priority-badge.kanban-priority-soon {
    background: rgba(234, 179, 8, 0.1);
    color: #ca8a04;
}

/* ---- Card Content ---- */
.kanban-card-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-text);
    margin-bottom: 6px;
    line-height: 1.35;
}

.kanban-card-supplier {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-bottom: 10px;
}

/* ---- Card Tags ---- */
.kanban-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 10px;
}

.kanban-card-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    line-height: 1.5;
    white-space: nowrap;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---- Card Details (value + payment badge) ---- */
.kanban-card-details {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.kanban-card-value {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-secondary);
}

/* ---- Card Dates (ETD -> ETA) ---- */
.kanban-card-dates {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.kanban-card-date-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.kanban-card-date-item svg {
    color: var(--color-text-muted);
    flex-shrink: 0;
}

.kanban-card-date-arrow {
    display: flex;
    align-items: center;
    color: var(--color-text-muted);
    opacity: 0.6;
}

/* ---- Card Footer ---- */
.kanban-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    min-height: 20px;
}

.kanban-card-eta,
.kanban-card-container {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.kanban-card-eta svg,
.kanban-card-container svg {
    color: var(--color-text-muted);
    flex-shrink: 0;
}

/* ---- Card Hover Preview ---- */
.kanban-card-hover-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--color-text-muted);
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transform: translateY(-4px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    margin-left: auto;
    margin-top: 0;
    padding-top: 0;
}

.kanban-card:hover .kanban-card-hover-preview {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid var(--color-border-light);
}

.kanban-card-hover-transport {
    display: flex;
    align-items: center;
    color: var(--color-text-secondary);
}

.kanban-card-hover-transport svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.kanban-card-hover-value {
    font-weight: 600;
    color: var(--color-primary);
    font-size: 12px;
}

/* ---- Add Import Button ---- */
.kanban-add-import-wrap {
    padding-top: 8px;
    margin-top: auto;
}

.kanban-add-import-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 8px 12px;
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-md);
    background: none;
    color: var(--color-text-muted);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.kanban-add-import-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: rgba(59, 130, 246, 0.04);
}

.kanban-add-import-btn svg {
    flex-shrink: 0;
}

/* ---- Empty State ---- */
.kanban-empty {
    text-align: center;
    padding: 40px 16px;
    color: var(--color-text-muted);
    font-size: 13px;
}

.kanban-empty-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 12px;
    opacity: 0.3;
}

.kanban-empty-icon svg {
    color: var(--color-text-muted);
}

.kanban-empty-text {
    font-size: 13px;
    color: var(--color-text-muted);
}

/* Illustrated kanban empty state */
.kanban-empty-illustrated {
    padding: 32px 16px;
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(var(--color-primary-rgb, 30, 58, 95), 0.02), rgba(var(--color-primary-rgb, 30, 58, 95), 0.04));
    position: relative;
    overflow: hidden;
}

.kanban-empty-illustrated::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(var(--color-primary-rgb, 30, 58, 95), 0.08), transparent);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.kanban-empty-illustrated .kanban-empty-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(var(--color-primary-rgb, 30, 58, 95), 0.08), rgba(var(--color-primary-rgb, 30, 58, 95), 0.15));
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    animation: emptyStateFloat 3s ease-in-out infinite;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    position: relative;
    z-index: 1;
}

.kanban-empty-illustrated .kanban-empty-icon svg {
    width: 36px;
    height: 36px;
    color: var(--color-primary);
    opacity: 0.7;
}

.kanban-empty-illustrated .kanban-empty-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-muted);
    position: relative;
    z-index: 1;
}

@media (prefers-reduced-motion: reduce) {
    .kanban-empty-illustrated .kanban-empty-icon {
        animation: none !important;
    }
}

/* ---- Skeleton Cards ---- */
.skeleton-card {
    cursor: default;
    border-left: 4px solid var(--color-border) !important;
}

.skeleton-card:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* ---- Kanban Toolbar ---- */
.kanban-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 10px 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
}

.kanban-search-wrap {
    position: relative;
    flex: 1;
    min-width: 200px;
    max-width: 360px;
}

.kanban-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    pointer-events: none;
}

.kanban-search-input {
    width: 100%;
    height: 36px;
    padding: 0 12px 0 34px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    background: var(--color-surface-alt);
    color: var(--color-text);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s, background 0.15s;
}

.kanban-search-input:focus {
    background: var(--color-surface);
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(79, 143, 247, 0.15);
}

.kanban-search-input::placeholder {
    color: var(--color-text-muted);
}

.kanban-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.kanban-filter-select {
    height: 36px;
    padding: 0 28px 0 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    appearance: none;
    -webkit-appearance: none;
    width: auto;
    min-width: 100px;
    max-width: 180px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}

.kanban-filter-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(79, 143, 247, 0.15);
}

.kanban-filter-select:hover {
    border-color: var(--color-text-muted);
}

.kanban-btn-reset {
    color: var(--color-danger) !important;
    font-size: 12px;
}

.kanban-btn-reset:hover {
    background: var(--color-danger-light) !important;
}

/* More filters button */
.kanban-btn-more-filters {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--color-text-secondary);
}

.kanban-btn-more-filters:hover {
    color: var(--color-primary);
}

.kanban-btn-more-filters.kanban-btn-more-active {
    color: var(--color-primary);
    background: rgba(59, 130, 246, 0.08);
}

.kanban-btn-more-filters svg {
    flex-shrink: 0;
}

/* ---- Advanced Filters Panel ---- */
.kanban-advanced-filters {
    width: 100%;
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 8px;
    border-top: 1px solid var(--color-border-light);
    margin-top: 4px;
}

.kanban-adv-filter-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 130px;
}

.kanban-adv-filter-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.kanban-adv-filter-input {
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    background: var(--color-surface-alt);
    color: var(--color-text);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s;
    width: 100%;
}

.kanban-adv-filter-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(79, 143, 247, 0.12);
}

.kanban-filter-info {
    width: 100%;
    font-size: 12px;
    color: var(--color-text-muted);
    font-weight: 500;
    padding-top: 2px;
}

/* ============================================
   Swimlane Board
   ============================================ */

/* ---- Swimlane Mode Selector ---- */
.kanban-swimlane-mode-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 12px;
}

.kanban-swimlane-mode-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text-muted);
    white-space: nowrap;
}

.kanban-swimlane-mode-select {
    height: 32px;
    padding: 0 28px 0 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    transition: border-color 0.15s;
}

.kanban-swimlane-mode-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(79, 143, 247, 0.15);
}

.kanban-swimlane-mode-select:hover {
    border-color: var(--color-text-muted);
}

/* ---- Swimlane Board ---- */
.kanban-swimlane-board {
    overflow-x: auto;
    padding-bottom: 16px;
    -webkit-overflow-scrolling: touch;
}

/* Swimlane column header row */
.kanban-swimlane-header-row {
    display: flex;
    align-items: center;
    gap: 0;
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--color-background);
    padding-bottom: 8px;
    border-bottom: 2px solid var(--color-border-light);
    margin-bottom: 8px;
}

.kanban-swimlane-header-row .kanban-swimlane-label-cell {
    width: 120px;
    min-width: 120px;
    flex-shrink: 0;
}

.kanban-swimlane-col-header {
    flex: 1;
    min-width: 220px;
    text-align: center;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-secondary);
}

.kanban-swimlane-col-planning {
    border-bottom: 3px solid var(--color-info);
}

.kanban-swimlane-col-transit {
    border-bottom: 3px solid var(--color-warning);
}

.kanban-swimlane-col-customs {
    border-bottom: 3px solid var(--color-primary);
}

.kanban-swimlane-col-delivered {
    border-bottom: 3px solid var(--color-success);
}

.kanban-swimlane-col-title {
    white-space: nowrap;
}

/* Individual swimlane */
.kanban-swimlane {
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    margin-bottom: 8px;
    background: var(--color-surface);
    overflow: hidden;
}

.kanban-swimlane + .kanban-swimlane {
    border-top: 1px solid var(--color-border-light);
}

/* Swimlane header (clickable) */
.kanban-swimlane-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: var(--color-surface-alt);
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    border-bottom: 1px solid var(--color-border-light);
    transition: background 0.15s;
    position: sticky;
    top: 0;
    z-index: 5;
}

.kanban-swimlane-header:hover {
    background: var(--color-surface);
}

.kanban-swimlane-collapsed .kanban-swimlane-header {
    border-bottom: none;
}

.kanban-swimlane-chevron {
    display: flex;
    align-items: center;
    color: var(--color-text-muted);
    flex-shrink: 0;
    transition: transform 0.2s;
}

.kanban-swimlane-header-icon {
    display: inline-flex;
    align-items: center;
    color: var(--color-text-secondary);
    flex-shrink: 0;
}

.kanban-swimlane-header-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.kanban-swimlane-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text);
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
}

.kanban-swimlane-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 11px;
    background: var(--color-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
}

/* Swimlane body (the row of column cells) */
.kanban-swimlane-body {
    display: flex;
    align-items: stretch;
    gap: 0;
    min-height: 80px;
    border-top: 1px solid var(--color-border-light);
}

/* Row header cell on the left */
.kanban-swimlane-row-header-cell {
    width: 120px;
    min-width: 120px;
    flex-shrink: 0;
}

.kanban-swimlane-body .kanban-swimlane-row-header-cell {
    display: flex;
    align-items: flex-start;
    padding: 14px 10px;
    background: var(--color-surface-alt);
    border-right: 1px solid var(--color-border-light);
}

.kanban-swimlane-row-header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
    text-align: center;
}

.kanban-swimlane-row-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-secondary);
}

.kanban-swimlane-row-icon .kanban-swimlane-header-dot {
    width: 12px;
    height: 12px;
}

.kanban-swimlane-row-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-secondary);
    line-height: 1.3;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* Swimlane cell count badge */
.kanban-swimlane-cell-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: rgba(0, 0, 0, 0.06);
    color: var(--color-text-muted);
    font-size: 10px;
    font-weight: 600;
    margin-bottom: 6px;
}

/* Swimlane cell (one status column per swimlane) */
.kanban-swimlane-cell {
    flex: 1;
    min-width: 220px;
    padding: 10px 8px;
    border-left: 1px solid var(--color-border-light);
    transition: background 0.2s;
}

.kanban-swimlane-cell:first-of-type {
    border-left: none;
}

.kanban-swimlane-cell.kanban-column-drag-over {
    background: rgba(59, 130, 246, 0.06);
}

.kanban-swimlane-cell-empty {
    text-align: center;
    color: var(--color-text-muted);
    font-size: 12px;
    padding: 20px 8px;
    opacity: 0.5;
}

/* Swimlane cards container */
.kanban-swimlane-cards {
    min-height: 40px;
    border-radius: var(--radius-md);
    border: 2px solid transparent;
    padding: 2px;
    transition: background 0.2s, border-color 0.2s;
}

.kanban-swimlane-cards.drag-over {
    background-color: rgba(59, 130, 246, 0.08);
    border: 2px dashed var(--color-primary);
}

/* Swimlane cards are slightly smaller */
.kanban-swimlane-cards .kanban-card {
    padding: 12px;
    margin-bottom: 8px;
}

.kanban-swimlane-cards .kanban-card-title {
    font-size: 13px;
}

.kanban-swimlane-cards .kanban-card-supplier {
    display: none;
}

.kanban-swimlane-cards .kanban-card-priority {
    font-size: 9px;
    padding: 1px 6px;
    margin-bottom: 6px;
}

.kanban-swimlane-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-text-muted);
}

/* ============================================
   Card Detail Popup
   ============================================ */

.kanban-card-popup {
    position: fixed;
    z-index: 350;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    max-width: 320px;
    width: 320px;
    padding: 0;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
    pointer-events: none;
    --arrow-left: 50%;
}

.kanban-card-popup.kanban-popup-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.kanban-card-popup.kanban-popup-hiding {
    opacity: 0;
    transform: translateY(4px);
    pointer-events: none;
}

/* Arrow pointing to card */
.kanban-card-popup::before,
.kanban-card-popup::after {
    content: '';
    position: absolute;
    left: var(--arrow-left);
    transform: translateX(-50%);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
}

/* Arrow for popup below card */
.kanban-card-popup.kanban-popup-below::before {
    top: -9px;
    border-bottom: 9px solid var(--color-border);
}

.kanban-card-popup.kanban-popup-below::after {
    top: -8px;
    border-bottom: 8px solid var(--color-surface);
}

/* Arrow for popup above card */
.kanban-card-popup.kanban-popup-above::before {
    bottom: -9px;
    border-top: 9px solid var(--color-border);
}

.kanban-card-popup.kanban-popup-above::after {
    bottom: -8px;
    border-top: 8px solid var(--color-surface);
}

/* ---- Popup Header ---- */
.kanban-popup-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    padding: 14px 16px 0 16px;
}

.kanban-popup-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--color-text);
    line-height: 1.4;
    flex: 1;
    word-break: break-word;
}

.kanban-popup-close {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    color: var(--color-text-muted);
    font-size: 18px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    line-height: 1;
    transition: background 0.15s, color 0.15s;
}

.kanban-popup-close:hover {
    background: var(--color-surface-alt);
    color: var(--color-text);
}

/* ---- Popup Supplier ---- */
.kanban-popup-supplier {
    font-size: 12px;
    color: var(--color-text-secondary);
    padding: 2px 16px 12px 16px;
    border-bottom: 1px solid var(--color-border-light);
}

/* ---- Popup Info Rows ---- */
.kanban-popup-info {
    padding: 10px 16px;
}

.kanban-popup-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 0;
    min-height: 28px;
}

.kanban-popup-row + .kanban-popup-row {
    border-top: 1px solid var(--color-border-light);
}

.kanban-popup-label {
    font-size: 12px;
    color: var(--color-text-muted);
    font-weight: 500;
    flex-shrink: 0;
    margin-right: 12px;
}

.kanban-popup-value {
    font-size: 13px;
    color: var(--color-text);
    text-align: right;
    display: flex;
    align-items: center;
    gap: 4px;
}

.kanban-popup-value-bold {
    font-weight: 600;
}

.kanban-popup-value svg {
    vertical-align: middle;
    flex-shrink: 0;
}

.kanban-popup-transport-icon {
    display: inline-flex;
    align-items: center;
    color: var(--color-text-secondary);
}

/* ---- Status Select (clickable) ---- */
.kanban-popup-status-select {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
}

.kanban-popup-status-select:hover {
    background: var(--color-surface-alt);
}

.kanban-popup-chevron {
    display: inline-flex;
    align-items: center;
    color: var(--color-text-muted);
    transition: transform 0.15s;
}

/* ---- Status Dropdown ---- */
.kanban-popup-status-dropdown {
    position: absolute;
    z-index: 10;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    padding: 4px;
    min-width: 160px;
}

.kanban-popup-status-option {
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.1s;
}

.kanban-popup-status-option:hover {
    background: var(--color-surface-alt);
}

.kanban-popup-status-option.active {
    background: var(--color-primary-light);
}

.kanban-popup-status-option .badge {
    pointer-events: none;
}

/* ---- Popup Tags ---- */
.kanban-popup-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 0 16px 10px 16px;
    border-bottom: 1px solid var(--color-border-light);
}

/* ---- Popup Actions ---- */
.kanban-popup-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px 12px 16px;
}

.kanban-popup-btn-edit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.kanban-popup-btn-edit svg {
    flex-shrink: 0;
}

.kanban-popup-btn-close {
    margin-left: auto;
}

/* ============================================
   Dark Mode Overrides
   ============================================ */

[data-theme="dark"] .kanban-view-toggle {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .kanban-view-btn.kanban-view-btn-active {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: none;
}

[data-theme="dark"] .kanban-minimap {
    background: var(--color-surface);
    border-color: var(--color-border);
}

[data-theme="dark"] .kanban-minimap-label {
    color: var(--color-text-secondary);
}

[data-theme="dark"] .kanban-minimap-count {
    color: var(--color-text-muted);
}

[data-theme="dark"] .kanban-column.kanban-column-drag-over {
    background-color: rgba(59, 130, 246, 0.08);
    box-shadow: inset 0 0 0 2px rgba(59, 130, 246, 0.25);
}

[data-theme="dark"] .kanban-cards.drag-over {
    background-color: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.5);
}

[data-theme="dark"] .kanban-card-placeholder {
    border-color: var(--color-border);
    background: rgba(59, 130, 246, 0.06);
}

[data-theme="dark"] .kanban-drag-ghost {
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .kanban-card.dragging {
    background: var(--color-surface);
    border-color: var(--color-border);
}

[data-theme="dark"] .kanban-card.kanban-card-highlight {
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.4), 0 4px 12px rgba(245, 158, 11, 0.1);
    border-color: #b45309;
}

[data-theme="dark"] .kanban-card.kanban-card-highlight .kanban-card-title {
    color: #fbbf24;
}

[data-theme="dark"] .kanban-collapse-btn:hover {
    background: var(--color-surface-alt);
}

[data-theme="dark"] .kanban-wip-btn:hover {
    background: var(--color-surface-alt);
}

[data-theme="dark"] .kanban-wip-indicator {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .kanban-column.kanban-wip-warning .kanban-wip-indicator {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

[data-theme="dark"] .kanban-column.kanban-wip-warning .kanban-wip-limit-value {
    color: #f59e0b;
}

[data-theme="dark"] .kanban-column.kanban-wip-exceeded .kanban-wip-indicator {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

[data-theme="dark"] .kanban-column.kanban-wip-exceeded .kanban-wip-limit-value {
    color: #f87171;
}

[data-theme="dark"] .kanban-column.kanban-wip-exceeded {
    background-color: rgba(239, 68, 68, 0.05);
}

[data-theme="dark"] .kanban-add-import-btn {
    border-color: var(--color-border);
    color: var(--color-text-muted);
}

[data-theme="dark"] .kanban-add-import-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: rgba(59, 130, 246, 0.08);
}

/* Dark mode: priority badges */
[data-theme="dark"] .kanban-priority-overdue {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

[data-theme="dark"] .kanban-priority-high {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

[data-theme="dark"] .kanban-priority-medium {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

[data-theme="dark"] .kanban-priority-low {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

[data-theme="dark"] .kanban-priority-urgent {
    background: rgba(249, 115, 22, 0.18);
    color: #fdba74;
}

[data-theme="dark"] .kanban-priority-soon {
    background: rgba(234, 179, 8, 0.15);
    color: #fde047;
}

/* Dark mode: column stats */
[data-theme="dark"] .kanban-stat-label {
    color: var(--color-text-muted);
}

[data-theme="dark"] .kanban-stat-sep {
    color: var(--color-border);
}

/* Dark mode: advanced filters */
[data-theme="dark"] .kanban-advanced-filters {
    border-top-color: var(--color-border);
}

[data-theme="dark"] .kanban-adv-filter-input {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--color-border);
    color: var(--color-text);
}

[data-theme="dark"] .kanban-adv-filter-input:focus {
    border-color: var(--color-primary);
}

/* Dark mode: swimlane */
[data-theme="dark"] .kanban-swimlane {
    background: var(--color-surface);
    border-color: #363654;
}

[data-theme="dark"] .kanban-swimlane-header {
    background: rgba(255, 255, 255, 0.03);
    border-bottom-color: #363654;
}

[data-theme="dark"] .kanban-swimlane-header:hover {
    background: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .kanban-swimlane-header-row {
    background: var(--color-background);
    border-bottom-color: #363654;
}

[data-theme="dark"] .kanban-swimlane-cell {
    border-left-color: #363654;
}

[data-theme="dark"] .kanban-swimlane-cell.kanban-column-drag-over {
    background: rgba(59, 130, 246, 0.08);
}

[data-theme="dark"] .kanban-swimlane-cards.drag-over {
    background-color: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.5);
}

[data-theme="dark"] .kanban-swimlane-body {
    border-top-color: #363654;
}

[data-theme="dark"] .kanban-swimlane-body .kanban-swimlane-row-header-cell {
    background: rgba(255, 255, 255, 0.02);
    border-right-color: #363654;
}

[data-theme="dark"] .kanban-swimlane-row-label {
    color: var(--color-text-secondary);
}

[data-theme="dark"] .kanban-swimlane-row-icon {
    color: var(--color-text-muted);
}

[data-theme="dark"] .kanban-swimlane-cell-count {
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-text-muted);
}

[data-theme="dark"] .kanban-swimlane-mode-select {
    background: var(--color-surface);
    border-color: var(--color-border);
    color: var(--color-text);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

[data-theme="dark"] .kanban-swimlane-mode-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(79, 143, 247, 0.2);
}

[data-theme="dark"] .kanban-swimlane-mode-select:hover {
    border-color: var(--color-text-muted);
}

[data-theme="dark"] .kanban-swimlane-mode-label {
    color: var(--color-text-muted);
}

[data-theme="dark"] .kanban-filter-select {
    background-color: var(--color-surface);
    border-color: var(--color-border);
    color: var(--color-text);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

[data-theme="dark"] .kanban-filter-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(79, 143, 247, 0.2);
}

[data-theme="dark"] .kanban-filter-select:hover {
    border-color: var(--color-text-muted);
}

[data-theme="dark"] .kanban-btn-more-filters.kanban-btn-more-active {
    background: rgba(59, 130, 246, 0.12);
}

/* ============================================
   Card Urgency / Priority Coloring
   ============================================ */

/* Card header row: title + quick status + payment dot inline */
.kanban-card-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.kanban-card-header-row .kanban-card-title {
    flex: 1;
    min-width: 0;
}

.kanban-card-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* Quick status dropdown button */
.kanban-card-quick-status-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border: none;
    background: var(--color-surface-alt);
    color: var(--color-text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s, color 0.2s, transform 0.2s;
    opacity: 0;
}

.kanban-card:hover .kanban-card-quick-status-btn {
    opacity: 1;
}

.kanban-card-quick-status-btn:hover {
    background: var(--color-primary);
    color: white;
    transform: scale(1.1);
}

.kanban-card-quick-status-btn svg {
    flex-shrink: 0;
}

/* Quick status dropdown */
.kanban-quick-status-dropdown {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 6px;
    min-width: 180px;
    z-index: 9999;
    animation: kanbanDropdownFadeIn 0.15s ease;
}

@keyframes kanbanDropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.kanban-quick-status-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border: none;
    background: none;
    color: var(--color-text);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background 0.15s, color 0.15s;
    text-align: left;
}

.kanban-quick-status-option:hover {
    background: var(--color-surface-alt);
}

.kanban-quick-status-option-active {
    background: rgba(59, 130, 246, 0.08);
    color: var(--color-primary);
}

.kanban-quick-status-option-active:hover {
    background: rgba(59, 130, 246, 0.12);
}

.kanban-quick-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.kanban-quick-status-dot-planning {
    background-color: var(--color-info);
}

.kanban-quick-status-dot-transit {
    background-color: var(--color-warning);
}

.kanban-quick-status-dot-customs {
    background-color: var(--color-primary);
}

.kanban-quick-status-dot-delivered {
    background-color: var(--color-success);
}

.kanban-quick-status-label {
    flex: 1;
}

.kanban-quick-status-option svg {
    flex-shrink: 0;
    color: var(--color-success);
}

/* --- Overdue card: red left border + subtle red gradient + pulse --- */
.kanban-card.kanban-card-overdue {
    border-left-color: #ef4444 !important;
    border-left-width: 4px;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.04) 0%, var(--color-surface) 60%);
    animation: urgencyPulse 3s ease-in-out infinite;
}

/* --- Urgent card (<=3 days): orange left border + orange gradient --- */
.kanban-card.kanban-card-urgent {
    border-left-color: #f97316 !important;
    border-left-width: 4px;
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.04) 0%, var(--color-surface) 60%);
}

/* --- Soon card (<=7 days): yellow left border + yellow gradient --- */
.kanban-card.kanban-card-soon {
    border-left-color: #eab308 !important;
    border-left-width: 4px;
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.03) 0%, var(--color-surface) 60%);
}

/* Urgency pulse animation for overdue */
@keyframes urgencyPulse {
    0%, 100% {
        box-shadow: var(--shadow-sm);
    }
    50% {
        box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15), 0 2px 8px rgba(239, 68, 68, 0.1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .kanban-card.kanban-card-overdue {
        animation: none;
        box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.2), var(--shadow-sm);
    }
}

/* --- Payment indicator dot --- */
.kanban-card-payment-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 4px;
    border: 1.5px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.kanban-payment-dot-paid {
    background-color: #22c55e;
    border-color: rgba(34, 197, 94, 0.3);
}

.kanban-payment-dot-partial {
    background-color: #eab308;
    border-color: rgba(234, 179, 8, 0.3);
}

.kanban-payment-dot-unpaid {
    background-color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}

/* --- Urgency badge --- */
.kanban-urgency-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 3px 10px;
    border-radius: 12px;
    margin-bottom: 8px;
    line-height: 1.4;
}

.kanban-urgency-badge svg {
    flex-shrink: 0;
}

.kanban-urgency-badge-overdue {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

.kanban-urgency-badge-urgent {
    background: rgba(249, 115, 22, 0.12);
    color: #ea580c;
}

/* --- Legend bar --- */
.kanban-legend {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 8px 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    font-size: 12px;
    color: var(--color-text-secondary);
}

.kanban-legend-section {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.kanban-legend-title {
    font-weight: 600;
    font-size: 11px;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.kanban-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.kanban-legend-color {
    display: inline-block;
    width: 14px;
    height: 10px;
    border-radius: 2px;
    flex-shrink: 0;
}

.kanban-legend-color-overdue {
    background-color: #ef4444;
}

.kanban-legend-color-urgent {
    background-color: #f97316;
}

.kanban-legend-color-soon {
    background-color: #eab308;
}

.kanban-legend-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ============================================
   Inline Editing
   ============================================ */

/* Editable field styles */
.kanban-editable {
    position: relative;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    border-radius: var(--radius-sm);
    padding: 2px 4px;
    margin: -2px -4px;
}

.kanban-editable:hover {
    background: rgba(59, 130, 246, 0.08);
}

.kanban-editable .kanban-edit-icon {
    display: none;
    opacity: 0;
    margin-left: 4px;
    color: var(--color-primary);
    vertical-align: middle;
}

.kanban-editable:hover .kanban-edit-icon {
    display: inline-flex;
    opacity: 0.7;
    animation: fadeInEdit 0.2s ease;
}

@keyframes fadeInEdit {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 0.7;
        transform: scale(1);
    }
}

.kanban-editable.kanban-editing {
    background: var(--color-surface-alt);
    padding: 0;
    margin: 0;
}

/* Inline input styles */
.kanban-inline-input,
.kanban-inline-select {
    width: 100%;
    min-width: 120px;
    height: 28px;
    padding: 4px 8px;
    border: 1px solid var(--color-primary);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    box-shadow: 0 0 0 2px rgba(79, 143, 247, 0.15);
    transition: border-color 0.15s;
}

.kanban-inline-input:focus,
.kanban-inline-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(79, 143, 247, 0.2);
}

.kanban-inline-select {
    cursor: pointer;
    appearance: auto;
}

/* Specific field overrides */
.kanban-card-title.kanban-editable {
    display: inline-flex;
    align-items: center;
    width: 100%;
}

.kanban-card-title.kanban-editing {
    display: block;
}

.kanban-card-value.kanban-editable {
    display: inline-flex;
    align-items: center;
}

.kanban-card-date-item.kanban-editable {
    display: inline-flex;
    align-items: center;
}

.badge.kanban-editable {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge.kanban-editable:hover {
    background: var(--color-primary-light);
    border-color: var(--color-primary);
}

/* Prevent text selection on editable fields while hovering */
.kanban-editable {
    user-select: none;
    -webkit-user-select: none;
}

/* Allow selection in edit mode */
.kanban-editable.kanban-editing input,
.kanban-editable.kanban-editing select {
    user-select: text;
    -webkit-user-select: text;
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .kanban-column {
        min-width: 260px;
    }

    .kanban-column.kanban-column-collapsed {
        min-width: 44px;
        max-width: 44px;
    }

    .kanban-swimlane-header-row .kanban-swimlane-label-cell,
    .kanban-swimlane-body .kanban-swimlane-label-cell,
    .kanban-swimlane-row-header-cell {
        width: 100px;
        min-width: 100px;
    }

    .kanban-swimlane-cell {
        min-width: 200px;
    }

    .kanban-swimlane-mode-wrap {
        margin-left: 8px;
    }
}

@media (max-width: 768px) {
    .kanban-board {
        min-height: auto;
    }

    .kanban-column {
        min-width: 240px;
        max-width: none;
    }

    .kanban-column.kanban-column-collapsed {
        min-width: 40px;
        max-width: 40px;
    }

    .kanban-column-collapsed-label {
        font-size: 11px;
    }

    /* Popup full-width on mobile */
    .kanban-card-popup {
        left: 8px !important;
        right: 8px !important;
        width: auto !important;
        max-width: none !important;
    }

    .kanban-minimap {
        padding: 8px 12px;
        gap: 1px;
    }

    .kanban-minimap-label {
        font-size: 10px;
    }

    .kanban-minimap-count {
        font-size: 10px;
    }

    .kanban-view-btn-label {
        display: none;
    }

    .kanban-view-btn {
        padding: 6px 10px;
    }

    /* Swimlane responsive */
    .kanban-swimlane-header-row .kanban-swimlane-label-cell,
    .kanban-swimlane-body .kanban-swimlane-label-cell,
    .kanban-swimlane-row-header-cell {
        width: 0;
        min-width: 0;
        display: none;
    }

    .kanban-swimlane-cell {
        min-width: 180px;
    }

    .kanban-swimlane-mode-wrap {
        margin-left: 0;
        margin-top: 8px;
    }

    .kanban-adv-filter-group {
        min-width: 100px;
        flex: 1;
    }
}

@media (max-width: 640px) {
    .kanban-board {
        gap: 12px;
    }

    .kanban-column {
        min-width: 220px;
        padding: 12px;
    }

    .kanban-card {
        padding: 12px;
    }

    .kanban-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 10px 12px;
    }

    .kanban-search-wrap {
        max-width: 100%;
        min-width: 0;
    }

    .kanban-search-input {
        min-height: 44px;
    }

    .kanban-filters {
        flex-wrap: wrap;
    }

    .kanban-filter-select {
        flex: 1;
        min-height: 44px;
    }

    .kanban-btn-reset {
        min-height: 44px;
    }

    .kanban-minimap {
        flex-wrap: wrap;
    }

    .kanban-minimap-segment {
        min-width: 70px;
    }

    .kanban-advanced-filters {
        flex-direction: column;
        gap: 8px;
    }

    .kanban-adv-filter-group {
        min-width: 100%;
    }

    .kanban-adv-filter-input {
        min-height: 44px;
    }

    .kanban-legend {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 8px 12px;
    }

    .kanban-legend-section {
        gap: 8px;
    }
}

/* ============================================
   Card Attachment Badge & Modal Styles
   ============================================ */

/* Attachment count badge on card */
.kanban-card-attachment-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 500;
    color: var(--color-text-secondary);
    padding: 2px 6px;
    border-radius: 10px;
    background: var(--color-surface-alt);
    transition: background 0.15s, color 0.15s;
}

.kanban-card-attachment-badge:hover {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

.kanban-card-attachment-badge svg {
    flex-shrink: 0;
}

/* ---- Detail Modal Sections ---- */
.kanban-modal-section {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--color-border-light);
}

.kanban-modal-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.kanban-modal-section-title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.kanban-modal-section-title svg {
    flex-shrink: 0;
    color: var(--color-primary);
}

/* Info grid */
.kanban-modal-info-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.kanban-modal-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid var(--color-border-light);
}

.kanban-modal-info-row:last-child {
    border-bottom: none;
}

.kanban-modal-info-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text-muted);
    flex-shrink: 0;
    margin-right: 12px;
}

.kanban-modal-info-value {
    font-size: 13px;
    color: var(--color-text);
    text-align: right;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.kanban-modal-info-value-bold {
    font-weight: 600;
}

.kanban-modal-transport-icon {
    display: inline-flex;
    align-items: center;
    color: var(--color-text-secondary);
}

/* ---- Attachments List ---- */
.kanban-modal-attachments-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.kanban-modal-attachment-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    transition: background 0.15s, border-color 0.15s;
}

.kanban-modal-attachment-item:hover {
    background: var(--color-surface);
    border-color: var(--color-border);
}

.kanban-modal-attachment-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
}

.kanban-modal-attachment-icon svg {
    width: 24px;
    height: 24px;
}

/* Image thumbnail preview */
.kanban-modal-attachment-thumb {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
}

.kanban-modal-attachment-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.kanban-modal-attachment-info {
    flex: 1;
    min-width: 0;
}

.kanban-modal-attachment-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kanban-modal-attachment-meta {
    font-size: 11px;
    color: var(--color-text-muted);
}

.kanban-modal-attachment-download {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: none;
    color: var(--color-text-muted);
    transition: background 0.15s, color 0.15s;
    text-decoration: none;
}

.kanban-modal-attachment-download:hover {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

/* ---- Changelog List ---- */
.kanban-modal-changelog-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.kanban-modal-changelog-item {
    padding: 10px;
    background: var(--color-surface-alt);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border-light);
}

.kanban-modal-changelog-field {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 4px;
}

.kanban-modal-changelog-change {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.kanban-modal-changelog-old {
    color: var(--color-text-muted);
    text-decoration: line-through;
}

.kanban-modal-changelog-new {
    color: var(--color-text);
    font-weight: 600;
}

.kanban-modal-changelog-meta {
    font-size: 11px;
    color: var(--color-text-muted);
}

/* ---- Comments List ---- */
.kanban-modal-comments-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.kanban-modal-comment-item {
    padding: 10px;
    background: var(--color-surface-alt);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border-light);
}

.kanban-modal-comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.kanban-modal-comment-author {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text);
}

.kanban-modal-comment-date {
    font-size: 11px;
    color: var(--color-text-muted);
}

.kanban-modal-comment-text {
    font-size: 13px;
    color: var(--color-text-secondary);
    line-height: 1.5;
}

/* ---- Modal Empty / Loading / Error States ---- */
.kanban-modal-loading,
.kanban-modal-empty,
.kanban-modal-error {
    text-align: center;
    padding: 16px;
    font-size: 13px;
    color: var(--color-text-muted);
}

.kanban-modal-error {
    color: var(--color-danger);
}

/* ---- Status Change Grid in Modal ---- */
.kanban-modal-status-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 8px;
}

.kanban-modal-status-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface-alt);
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.kanban-modal-status-btn:hover {
    background: var(--color-surface);
    border-color: var(--color-primary);
}

.kanban-modal-status-btn.active {
    background: var(--color-primary-light);
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(79, 143, 247, 0.15);
}

.kanban-modal-status-btn .badge {
    pointer-events: none;
}

@media (max-width: 640px) {
    .kanban-modal-status-grid {
        grid-template-columns: 1fr;
    }

    .kanban-modal-info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .kanban-modal-info-value {
        text-align: left;
        justify-content: flex-start;
    }

    .kanban-modal-attachment-item {
        flex-wrap: wrap;
    }
}
