/* KanbanBoard engine (tkb-): one look for <KanbanBoard /> and for the table → kanban view. Loaded after widgets5.css. */
.tkb-host { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.tkb-board { display: flex; gap: 12px; height: 100%; min-height: 0; overflow-x: auto; direction: rtl; padding-bottom: 4px; }
.tkb-col { flex: 1 1 0; min-width: 170px; max-width: 360px; min-height: 0; background: var(--muted); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; transition: background .2s, box-shadow .2s; }
.tkb-col.over { background: color-mix(in srgb, var(--primary) 8%, var(--muted)); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--primary) 35%, transparent); }
.tkb-ch { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 13px; }
.tkb-ch .badge { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.tkb-n { margin-inline-start: auto; flex: none; font-size: 12px; line-height: 20px; padding: 0 7px; border-radius: 99px; background: var(--card); color: var(--muted-foreground); }
.tkb-list { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.tkb-card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 10px 11px; display: grid; gap: 7px; min-width: 0; font-size: 12.5px; cursor: grab; box-shadow: 0 1px 2px rgb(0 0 0 / .04); transition: opacity .2s, border-color .2s, transform .2s; }
.tkb-card:hover, .tkb-card:focus-visible { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); outline: none; }
.tkb-card.dragging, .tkb-card.pend { opacity: .45; }
.tkb-card.leave { opacity: 0; transform: scale(.96); }
.tkb-card.reveal { animation: tkbIn .32s ease both; }
@keyframes tkbIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.tkb-t { font-size: 13px; font-weight: 600; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.tkb-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; color: var(--muted-foreground); }
.tkb-meta > * { max-width: 100%; min-width: 0; }
.tkb-who { display: inline-flex; align-items: center; gap: 5px; min-width: 0; font-size: 12px; }
.tkb-who > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; max-width: 120px; }
.tkb-due, .tkb-amt { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; white-space: nowrap; }
.tkb-due .i { width: 12px; height: 12px; }
.tkb-pt { font-size: 12px; color: var(--muted-foreground); }
.tkb-ph { height: 40px; flex: none; border: 1.5px dashed color-mix(in srgb, var(--primary) 50%, transparent); border-radius: 10px; background: color-mix(in srgb, var(--primary) 6%, transparent); }
.tkb-empty { text-align: center; font-size: 12px; color: var(--muted-foreground); padding: 18px 0; }
.tkb-addc { all: unset; box-sizing: border-box; display: flex; align-items: center; justify-content: center; gap: 5px; width: 100%; height: 30px; border-radius: 8px; border: 1px dashed var(--border); color: var(--muted-foreground); font-size: 12px; cursor: pointer; }
.tkb-addc:hover, .tkb-addc:focus-visible { background: var(--card); color: var(--foreground); outline: none; }
.tkb-addc .i { width: 13px; height: 13px; }
.tkb-x { color: var(--muted-foreground); }

/* record-detail tags and related record (dialogs) */
.tkb-tagwrap { position: relative; display: inline-flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.tkb-tagbtn { all: unset; cursor: pointer; border-radius: 99px; }
.tkb-tagbtn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.tkb-tagmenu { display: flex; flex-wrap: wrap; gap: 6px; }
.tkb-tagmenu[hidden] { display: none; }
.tkb-tagmenu button { all: unset; cursor: pointer; border-radius: 99px; }
.tkb-tagmenu button:hover .badge { box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 30%, transparent); }
.tkb-pop { position: absolute; z-index: 5; min-width: 200px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 12px; box-shadow: var(--shadow-pop); font-size: 13px; display: grid; gap: 6px; }
.tkb-pop .muted { font-size: 12px; }
.tkb-dlg-rel { all: unset; cursor: pointer; color: var(--primary); text-decoration: underline; text-decoration-color: var(--orange, #e8782a); text-underline-offset: 3px; text-decoration-thickness: 2px; display: inline-flex; align-items: center; gap: 4px; }

/* table view inside <KanbanBoard /> = the table widget (record-table.js): its own toolbar, rows and dialogs; only its title is hidden (the board frame shows it) */
.tkb-host > div { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.tkb-host .kbx-rt { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.tkb-host .kbx-rt .w { flex: 1; min-height: 0; height: auto; grid-template-rows: minmax(0, 1fr); border: 0; border-radius: 0; background: transparent; }
.tkb-host .kbx-rt .w > .w-title, .tkb-host .kbx-rt .w > .w-actions { display: none; }
.tkb-host .kbx-rt .w-body { padding: 0; }

/* p-kanban header (table toolbar look) and modal fixes */
.kbx-pf { height: 34px; flex: none; font: inherit; font-size: 12.5px; border: 1px solid var(--border); border-radius: 8px; background: var(--card); color: var(--foreground); padding: 0 8px; }
.kbx-seg { display: flex; flex-wrap: wrap; width: 100%; height: auto; padding: 4px; gap: 4px; }
.kbx-seg button { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
