/* Workflow Kanban Board */
.wf-board-wrap {
  display: flex; flex-direction: column; gap: 12px;
  width: 100%; max-width: 100%; min-width: 0;
}
.wf-filter-bar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 10px 12px; background: var(--surface2, #f8fafc);
  border: 1px solid var(--border); border-radius: var(--r-lg);
}
.wf-filter-bar label { font-size: 10px; font-weight: 700; color: var(--text-m); margin-left: 4px; }
.wf-filter-bar select, .wf-filter-bar input {
  font-size: 12px; padding: 6px 8px; border: 1px solid var(--border);
  border-radius: var(--r); min-width: 120px; font-family: inherit;
}

/* KPI — تمرير أفقي عند كثرة المراحل */
.wf-kpi-scroll {
  width: 100%; max-width: 100%; overflow-x: auto; overflow-y: hidden;
  padding-bottom: 4px; margin-bottom: 16px;
  -webkit-overflow-scrolling: touch;
}
.wf-kpi-scroll::-webkit-scrollbar { height: 6px; }
.wf-kpi-scroll::-webkit-scrollbar-thumb { background: rgba(113,75,103,.35); border-radius: 6px; }
#wf-kpi-bar {
  display: flex !important; flex-wrap: nowrap !important; gap: 10px !important;
  width: max-content; min-width: 100%; margin-bottom: 0 !important;
}
#wf-kpi-bar .stat-card { flex: 0 0 148px; min-width: 148px; }

/* Kanban — حاوية تمرير أفقي ثابتة العرض */
.wf-kanban-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 6px; flex-wrap: wrap;
}
.wf-kanban-toolbar span { font-size: 10px; color: var(--text-m); font-weight: 600; }
.wf-kanban-nav { display: flex; gap: 6px; }
.wf-kanban-nav button {
  width: 32px; height: 32px; border: 1px solid var(--border); border-radius: var(--r);
  background: #fff; cursor: pointer; font-size: 14px; line-height: 1;
  transition: var(--tr);
}
.wf-kanban-nav button:hover { background: var(--odoo-purple-l); border-color: var(--odoo-purple); color: var(--odoo-purple); }

.wf-kanban-scroll {
  width: 100%; max-width: 100%; min-width: 0;
  overflow-x: auto; overflow-y: hidden;
  padding-bottom: 10px; -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
  border: 1px solid var(--border); border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--bg, #f8fafc) 0%, #fff 100%);
  direction: ltr;
}
.wf-kanban-scroll::-webkit-scrollbar { height: 10px; }
.wf-kanban-scroll::-webkit-scrollbar-track { background: var(--bg, #f1f5f9); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.wf-kanban-scroll::-webkit-scrollbar-thumb { background: rgba(113,75,103,.45); border-radius: 6px; }
.wf-kanban-scroll::-webkit-scrollbar-thumb:hover { background: var(--odoo-purple); }

.wf-kanban {
  display: flex; flex-direction: row; flex-wrap: nowrap; gap: 12px;
  align-items: flex-start; min-height: 420px;
  width: max-content; min-width: 100%;
  padding: 12px;
  box-sizing: border-box;
  direction: rtl;
}
.wf-col {
  flex: 0 0 252px; width: 252px; max-width: 252px; min-width: 252px;
  background: #fff; border-radius: var(--r-lg);
  border: 1.5px solid var(--border);
  display: flex; flex-direction: column; max-height: 72vh;
  transition: box-shadow .2s, border-color .2s;
}
.wf-col.wf-drop-target { border-color: var(--odoo-purple); box-shadow: 0 0 0 3px rgba(113,75,103,.15); }
.wf-col-hdr {
  padding: 10px 12px; border-radius: var(--r-lg) var(--r-lg) 0 0;
  color: #fff; display: flex; flex-direction: column; gap: 4px;
}
.wf-col-hdr-top { display: flex; align-items: center; gap: 8px; }
.wf-col-hdr-title { font-size: 12px; font-weight: 800; flex: 1; }
.wf-col-hdr-sub { font-size: 9px; opacity: .85; letter-spacing: .3px; }
.wf-col-stats { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.wf-col-stat {
  font-size: 9px; font-weight: 700; padding: 2px 8px; border-radius: 10px;
  background: rgba(255,255,255,.22);
}
.wf-col-stat.overdue { background: rgba(220,53,69,.9); }
.wf-col-body {
  padding: 8px; overflow-y: auto; flex: 1; min-height: 120px;
}
.wf-col-body.empty-drop { min-height: 80px; }
.wf-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--r);
  padding: 10px; margin-bottom: 8px; cursor: grab;
  transition: transform .15s, box-shadow .15s, opacity .15s;
  border-right: 3px solid var(--odoo-purple);
}
.wf-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.1); transform: translateY(-1px); }
.wf-card.wf-dragging { opacity: .45; transform: rotate(2deg); cursor: grabbing; }
.wf-card.wf-ghost { opacity: .3; }
.wf-card.overdue { border-right-color: #dc3545; }
.wf-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; margin-bottom: 6px; }
.wf-card-id { font-family: monospace; font-size: 10px; font-weight: 800; color: var(--odoo-purple); }
.wf-card-priority {
  font-size: 8px; font-weight: 800; padding: 2px 6px; border-radius: 8px; white-space: nowrap;
}
.wf-pri-high { background: #fee2e2; color: #b91c1c; }
.wf-pri-medium { background: #fef3c7; color: #92400e; }
.wf-pri-low { background: #ecfdf5; color: #047857; }
.wf-card-title { font-weight: 800; font-size: 12.5px; margin-bottom: 2px; line-height: 1.35; }
.wf-card-customer { font-size: 10.5px; color: var(--text-m); margin-bottom: 4px; }
.wf-card-meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: 9.5px; color: var(--text-m); margin-bottom: 6px; }
.wf-card-meta span { display: inline-flex; align-items: center; gap: 3px; }
.wf-card-amt { font-size: 11px; font-weight: 800; color: var(--odoo-green); }
.wf-card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--border); }
.wf-card-assignee { font-size: 9px; color: var(--text-m); }
.wf-card-actions { display: flex; gap: 4px; }
.wf-card-actions button { padding: 2px 8px; font-size: 9px; }
.wf-load-more {
  width: 100%; padding: 6px; font-size: 10px; border: 1px dashed var(--border);
  background: var(--bg); border-radius: var(--r); cursor: pointer; margin-top: 4px;
}
.wf-history-list { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; }
.wf-history-item { font-size: 11px; padding: 6px 0; border-bottom: 1px dotted var(--border); }
.wf-tone-green .wf-col-hdr { background: linear-gradient(135deg, #198754, #157347); }
.wf-tone-yellow .wf-col-hdr { background: linear-gradient(135deg, #f59e0b, #d97706); }
.wf-tone-red .wf-col-hdr { background: linear-gradient(135deg, #dc3545, #b02a37); }
.wf-tone-purple .wf-col-hdr { background: linear-gradient(135deg, #714B67, #5a3d52); }
.wf-tone-blue .wf-col-hdr { background: linear-gradient(135deg, #017E84, #015f64); }
.wf-tone-gray .wf-col-hdr { background: linear-gradient(135deg, #6c757d, #495057); }
@media (max-width: 900px) {
  .wf-col { flex: 0 0 78vw; width: 78vw; max-width: 78vw; min-width: 78vw; }
}
