/* ══════════════════════════════════════════════════════════
   TASKS PAGE — Zalo Hub V3
   ══════════════════════════════════════════════════════════ */

.tasks-wrapper {
  min-height: 100vh;
  background: var(--color-bg, #F5F5F5);
  font-family: var(--font-family, 'Inter', sans-serif);
}

/* ── Header ── */
.tasks-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--color-surface, #fff);
  border-bottom: 1px solid var(--color-border, #e2e8f0);
  gap: 12px;
  flex-wrap: wrap;
}
.tasks-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tasks-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
}
.tasks-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tasks-search-box {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--color-bg, #f1f5f9);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: var(--radius-md, 8px);
  padding: 6px 10px;
}
.tasks-search-box input {
  border: none;
  background: none;
  outline: none;
  font-size: 13px;
  width: 180px;
  font-family: inherit;
  color: var(--color-text, #0f172a);
}
.tasks-search-box input::placeholder {
  color: var(--color-text-muted, #94a3b8);
}

/* ── Filters ── */
.tasks-filters {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background: var(--color-surface, #fff);
  border-bottom: 1px solid var(--color-border-light, #f1f5f9);
  flex-wrap: wrap;
}
.tasks-filter-select {
  padding: 6px 10px;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: var(--radius-sm, 6px);
  font-size: 13px;
  font-family: inherit;
  background: var(--color-surface, #fff);
  color: var(--color-text, #0f172a);
  cursor: pointer;
}
.tasks-count {
  margin-left: auto;
  font-size: 12px;
  color: var(--color-text-muted, #94a3b8);
  font-weight: 500;
}

/* ── Table ── */
.tasks-table-wrap {
  padding: 12px 20px;
  overflow-x: auto;
}
.tasks-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--color-surface, #fff);
  border-radius: var(--radius-lg, 12px);
  overflow: hidden;
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(0,0,0,0.05));
  border: 1px solid var(--color-border, #e2e8f0);
}
.tasks-table thead tr {
  background: var(--color-bg, #F5F5F5);
}
.tasks-table thead th {
  color: var(--color-text-muted, #7A7A7A);
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 10px 12px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--color-border, #E5E7EB);
}
.tasks-table tbody tr {
  cursor: pointer;
  transition: background var(--transition-fast, 150ms);
  border-bottom: 1px solid var(--color-border-light, #F0F0F0);
}
.tasks-table tbody tr:last-child {
  border-bottom: none;
}
.tasks-table tbody tr:hover {
  background: var(--color-primary-light, #E8F0FE);
}
.tasks-table tbody td {
  padding: 10px 12px;
  font-size: 13px;
  color: var(--color-text, #0f172a);
  vertical-align: middle;
}
.tasks-loading {
  text-align: center;
  padding: 40px !important;
  color: var(--color-text-muted, #94a3b8);
  font-size: 14px;
}
.col-status { width: 100px; }
.col-priority { width: 90px; }
.col-tags { width: 140px; }
.col-due { width: 120px; }
.col-date { width: 100px; }
.col-actions { width: 80px; text-align: right; }
.col-sender { width: 120px; }

/* ── Badges ── */
.task-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-new { background: #dbeafe; color: #1d4ed8; }
.badge-contacted { background: #fef3c7; color: #b45309; }
.badge-qualified { background: #d1fae5; color: #065f46; }
.badge-converted { background: #ede9fe; color: #6d28d9; }
.badge-closed { background: #f1f5f9; color: #64748b; }

.badge-urgent { background: #fecaca; color: #b91c1c; }
.badge-high { background: #fed7aa; color: #c2410c; }
.badge-normal { background: #e0e7ff; color: #4338ca; }
.badge-low { background: #f1f5f9; color: #64748b; }

.task-tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  background: #f1f5f9;
  color: #475569;
  margin: 1px 2px;
}
.task-title-text {
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}

/* ── Empty State ── */
.tasks-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-text-muted, #94a3b8);
}
.tasks-empty h3 {
  margin: 12px 0 6px;
  color: var(--color-text, #0f172a);
  font-size: 16px;
}
.tasks-empty p {
  font-size: 13px;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .tasks-header { padding: 10px 12px; }
  .tasks-filters { padding: 8px 12px; }
  .tasks-table-wrap { padding: 8px 12px; }
  .tasks-search-box input { width: 120px; }
  .col-tags, .col-sender, .col-date { display: none; }
}
@media (max-width: 480px) {
  .tasks-search-box { display: none; }
  .col-due { display: none; }
}
