fix kanban styling: inline CSS (Tailwind JIT doesn't scan views/filament/)

This commit is contained in:
2026-05-07 11:52:46 +00:00
parent f12bf17948
commit a9b523cc9b
@@ -1,59 +1,89 @@
<x-filament-panels::page>
@php $columns = $this->getColumns(); @endphp
<div class="overflow-x-auto pb-4" x-data="{ dragId: null }">
<div class="flex gap-3 min-w-max" id="kanban-board">
<style>
.kb-board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 1rem; }
.kb-col {
width: 290px; flex-shrink: 0; padding: 12px;
background: #f1f5f9; border-radius: 10px;
border: 2px solid transparent;
transition: border-color .15s;
}
.dark .kb-col { background: #1f2937; }
.kb-col.over { border-color: #3b82f6; }
.kb-col-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.kb-col-title { font-size: 14px; font-weight: 600; }
.kb-col-count { font-size: 11px; padding: 2px 8px; background: #e2e8f0; border-radius: 999px; }
.dark .kb-col-count { background: #374151; }
.kb-list { display: flex; flex-direction: column; gap: 8px; min-height: 80px; }
.kb-card {
background: #fff; border: 1px solid #e5e7eb; border-radius: 8px;
padding: 12px; cursor: move;
transition: box-shadow .15s, opacity .15s;
}
.dark .kb-card { background: #111827; border-color: #374151; }
.kb-card:hover { box-shadow: 0 4px 8px rgba(0,0,0,0.08); }
.kb-card.dragging { opacity: 0.4; }
.kb-num { font-size: 11px; font-family: monospace; color: #6b7280; }
.kb-title { font-size: 14px; font-weight: 600; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kb-sub { font-size: 12px; color: #6b7280; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kb-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 11px; }
.kb-link { display: block; margin-top: 8px; font-size: 11px; color: #3b82f6; text-decoration: none; }
.kb-link:hover { text-decoration: underline; }
.kb-empty { font-size: 11px; color: #9ca3af; text-align: center; padding: 16px 0; }
</style>
<div x-data="{ dragId: null }">
<div class="kb-board">
@foreach ($columns as $status => $col)
<div
class="w-72 flex-shrink-0 bg-gray-50 dark:bg-gray-800 rounded-lg p-3 transition"
:class="{ 'ring-2 ring-primary-500': false }"
@dragover.prevent="$el.classList.add('ring-2','ring-primary-500')"
@dragleave="$el.classList.remove('ring-2','ring-primary-500')"
class="kb-col"
@dragover.prevent="$el.classList.add('over')"
@dragleave="$el.classList.remove('over')"
@drop.prevent="
$el.classList.remove('ring-2','ring-primary-500');
$el.classList.remove('over');
if (dragId) {
$wire.moveCard(parseInt(dragId), '{{ $status }}');
dragId = null;
}
"
>
<div class="flex items-center justify-between mb-3">
<h3 class="font-semibold text-sm">{{ $col['label'] }}</h3>
<span class="text-xs px-2 py-0.5 bg-gray-200 dark:bg-gray-700 rounded-full">{{ $col['count'] }}</span>
<div class="kb-col-head">
<span class="kb-col-title">{{ $col['label'] }}</span>
<span class="kb-col-count">{{ $col['count'] }}</span>
</div>
<div class="space-y-2 min-h-[100px]">
<div class="kb-list">
@forelse ($col['cards'] as $wo)
<div
class="bg-white dark:bg-gray-900 rounded-md p-3 border border-gray-200 dark:border-gray-700 cursor-move hover:shadow-md transition"
class="kb-card"
draggable="true"
@dragstart="dragId = '{{ $wo->id }}'; $el.classList.add('opacity-50')"
@dragend="$el.classList.remove('opacity-50')"
@dragstart="dragId = '{{ $wo->id }}'; $el.classList.add('dragging')"
@dragend="$el.classList.remove('dragging')"
>
<div class="text-xs font-mono text-gray-500">{{ $wo->number }}</div>
<div class="text-sm font-semibold mt-1 truncate">{{ $wo->client?->name ?? '—' }}</div>
<div class="text-xs text-gray-600 dark:text-gray-400 mt-1 truncate">
<div class="kb-num">{{ $wo->number }}</div>
<div class="kb-title">{{ $wo->client?->name ?? '—' }}</div>
<div class="kb-sub">
{{ $wo->vehicle?->make }} {{ $wo->vehicle?->model }}
@if ($wo->vehicle?->plate)
<span class="font-mono">[{{ $wo->vehicle->plate }}]</span>
[{{ $wo->vehicle->plate }}]
@endif
</div>
<div class="flex items-center justify-between mt-2 text-xs">
<span class="text-gray-500">{{ $wo->master?->name ?? '—' }}</span>
<span class="font-semibold">{{ number_format((float)$wo->total, 0, '.', ' ') }} MDL</span>
<div class="kb-foot">
<span style="color:#6b7280">{{ $wo->master?->name ?? '—' }}</span>
<span style="font-weight:600">{{ number_format((float)$wo->total, 0, '.', ' ') }} MDL</span>
</div>
<a href="{{ route('filament.tenant.resources.work-orders.edit', ['record' => $wo->id]) }}"
class="block mt-2 text-xs text-primary-600 hover:underline">Deschide </a>
<a class="kb-link" href="{{ route('filament.tenant.resources.work-orders.edit', ['record' => $wo->id]) }}">Deschide </a>
</div>
@empty
<div class="text-xs text-gray-400 text-center py-4">Gol</div>
<div class="kb-empty">Gol</div>
@endforelse
</div>
</div>
@endforeach
</div>
</div>
<div class="text-xs text-gray-500 mt-4">
<div style="font-size: 11px; color: #6b7280; margin-top: 12px;">
💡 Drag-drop carduri între coloane pentru a schimba statusul.
</div>
</div>
</x-filament-panels::page>