/* ═══════════════════════════════════════════════════════════
   TASK BOARD — 5-column kanban shared by admin and client
═══════════════════════════════════════════════════════════ */
.tb-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(180px, 1fr));
  gap: 12px;
  align-items: start;
  overflow-x: auto;
  padding-bottom: 8px;
}
@media (max-width: 860px) {
  .tb-board { grid-template-columns: repeat(3, minmax(160px, 1fr)); }
}
@media (max-width: 560px) {
  .tb-board { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
}

.tb-col {
  background: var(--surface, #F5F6FA);
  border-radius: 12px;
  overflow: hidden;
  min-height: 120px;
}
.tb-col-hd {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 13px;
  border-bottom: 1.5px solid var(--border, #E0E4EF);
}
.tb-col-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.tb-col-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink, #0B0F1A);
  flex: 1;
}
.tb-col-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted, #6B7A9A);
  background: var(--border, #E0E4EF);
  border-radius: 99px;
  padding: 1px 7px;
  min-width: 18px;
  text-align: center;
}
.tb-col-count:empty { display: none; }
.tb-col-body { padding: 8px 8px 4px; }
.tb-empty {
  text-align: center;
  font-size: 12px;
  color: var(--muted, #6B7A9A);
  padding: 24px 8px;
}

/* Task card */
.tb-card {
  background: var(--white, #fff);
  border: 1.5px solid var(--border, #E0E4EF);
  border-left: 3px solid var(--tb-col-color, #6B7280);
  border-radius: 9px;
  padding: 11px 12px 9px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.1s;
  user-select: none;
}
.tb-card:hover { box-shadow: 0 3px 14px rgba(0,0,0,.08); transform: translateY(-1px); }
.tb-card:active { transform: translateY(0); }
.tb-card[draggable="true"] { cursor: grab; }
.tb-card[draggable="true"]:active { cursor: grabbing; opacity: .8; }

.tb-card-hd {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 4px;
}
.tb-priority-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0;
}
.tb-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink, #0B0F1A);
  line-height: 1.4;
  flex: 1;
  word-break: break-word;
}
.tb-unread {
  flex-shrink: 0;
  background: #EF4444;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  border-radius: 99px;
  padding: 1px 6px;
  min-width: 18px;
  text-align: center;
  margin-top: 1px;
}
.tb-card-desc {
  font-size: 11.5px;
  color: var(--muted, #6B7A9A);
  line-height: 1.55;
  margin-bottom: 7px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tb-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.tb-due {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 99px;
  background: #FEF3C7;
  color: #D97706;
  border: 1px solid #FDE68A;
}
.tb-due.overdue {
  background: #FEE2E2;
  color: #DC2626;
  border-color: #FECACA;
}
.tb-progress-wrap {
  display: inline-block;
  width: 44px;
  height: 5px;
  background: var(--border, #E0E4EF);
  border-radius: 99px;
  overflow: hidden;
  vertical-align: middle;
}
.tb-progress-fill {
  height: 100%;
  background: #10B981;
  border-radius: 99px;
  transition: width 0.3s;
}
.tb-progress-label {
  font-size: 10.5px;
  color: var(--muted, #6B7A9A);
  font-weight: 600;
}
.tb-card-date { font-size: 10.5px; color: var(--muted, #6B7A9A); }

/* Drag-over column highlight */
.tb-col.drag-over { outline: 2px dashed var(--teal, #0D9E75); outline-offset: -2px; }

/* ═══════════════════════════════════════════════════════════
   TASK WORKSPACE — overlay drawer
═══════════════════════════════════════════════════════════ */
.tw-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  justify-content: flex-end;
}
.tw-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11,15,26,.38);
}
.tw-drawer {
  position: relative;
  width: 78%;
  max-width: 1100px;
  height: 100%;
  background: var(--white, #fff);
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 40px rgba(0,0,0,.18);
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(.4,0,.2,1);
}
.tw-drawer.open { transform: translateX(0); }
@media (max-width: 680px) {
  .tw-drawer { width: 100%; }
}

.tw-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1.5px solid var(--border, #E0E4EF);
  flex-shrink: 0;
}
.tw-close-btn {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--muted, #6B7A9A);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  flex-shrink: 0;
  transition: background 0.15s;
}
.tw-close-btn:hover { background: var(--surface, #F5F6FA); color: var(--ink, #0B0F1A); }
.tw-header-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink, #0B0F1A);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tw-status-sel {
  font-size: 12px;
  font-weight: 700;
  border: 1.5px solid var(--border, #E0E4EF);
  border-radius: 8px;
  padding: 5px 10px;
  background: var(--surface, #F5F6FA);
  cursor: pointer;
  flex-shrink: 0;
}
.tw-status-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 99px;
  flex-shrink: 0;
}

.tw-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}
.tw-details {
  width: 38%;
  min-width: 260px;
  border-right: 1.5px solid var(--border, #E0E4EF);
  overflow-y: auto;
  padding: 20px;
  flex-shrink: 0;
}
@media (max-width: 680px) {
  .tw-body { flex-direction: column; }
  .tw-details { width: 100%; min-width: unset; border-right: none; border-bottom: 1.5px solid var(--border); max-height: 40vh; }
}
.tw-thread-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Details panel fields */
.tw-field-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted, #6B7A9A);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 5px;
}
.tw-field-val {
  font-size: 13.5px;
  color: var(--ink, #0B0F1A);
  line-height: 1.6;
}
.tw-desc-val { white-space: pre-wrap; word-break: break-word; }
.tw-inline-edit {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  cursor: pointer;
  border-radius: 6px;
  padding: 4px 6px;
  margin: -4px -6px;
  transition: background 0.15s;
}
.tw-inline-edit:hover { background: var(--surface, #F5F6FA); }
.tw-inline-edit span { flex: 1; font-size: 13.5px; color: var(--ink); line-height: 1.6; word-break: break-word; }
.tw-edit-btn {
  background: none; border: none; font-size: 13px; cursor: pointer;
  color: var(--muted); opacity: 0; padding: 0; flex-shrink: 0;
}
.tw-inline-edit:hover .tw-edit-btn { opacity: 1; }
.tw-inline-input {
  flex: 1; font-size: 13.5px; border: 1.5px solid var(--teal, #0D9E75);
  border-radius: 6px; padding: 4px 8px; font-family: inherit; outline: none;
}
.tw-inline-textarea {
  width: 100%; font-size: 13px; border: 1.5px solid var(--teal, #0D9E75);
  border-radius: 6px; padding: 6px 8px; font-family: inherit; outline: none;
  resize: vertical; box-sizing: border-box;
}
.tw-progress-bar-wrap {
  flex: 1; background: var(--border, #E0E4EF); border-radius: 99px;
  height: 8px; overflow: hidden;
}
.tw-progress-bar-fill {
  height: 100%; background: #10B981; border-radius: 99px; transition: width 0.3s;
}
.tw-progress-slider {
  width: 100%; margin-top: 6px; cursor: pointer; accent-color: var(--teal, #0D9E75);
}
.tw-date-input {
  font-size: 13px; border: 1.5px solid var(--border); border-radius: 8px;
  padding: 6px 10px; font-family: inherit; outline: none; cursor: pointer;
  transition: border-color 0.15s;
}
.tw-date-input:focus { border-color: var(--teal, #0D9E75); }
.tw-select {
  font-size: 13px; border: 1.5px solid var(--border); border-radius: 8px;
  padding: 6px 10px; font-family: inherit; background: var(--white); cursor: pointer;
}
.tw-files-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tw-file-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--surface, #F5F6FA); border: 1.5px solid var(--border, #E0E4EF);
  border-radius: 7px; padding: 4px 10px; font-size: 12px; font-weight: 600;
  color: var(--teal, #0D9E75); text-decoration: none; transition: background 0.15s;
  max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.tw-file-chip:hover { background: var(--border); }

/* ═══════════════════════════════════════════════════════════
   TASK THREAD — conversation inside workspace
═══════════════════════════════════════════════════════════ */
.tt-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tt-empty {
  text-align: center;
  color: var(--muted, #6B7A9A);
  font-size: 13px;
  padding: 40px 0;
}
.tt-msg {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.tt-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}
.tt-bubble-wrap { flex: 1; min-width: 0; }
.tt-meta {
  font-size: 11px;
  color: var(--muted, #6B7A9A);
  margin-bottom: 4px;
  font-weight: 600;
}
.tt-role {
  display: inline-block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 10px;
  padding: 0 5px;
  margin: 0 3px;
  font-weight: 700;
  color: var(--muted);
  vertical-align: middle;
}
.tt-internal-label {
  display: inline-block;
  background: #F3F4F6;
  border-radius: 4px;
  font-size: 10px;
  padding: 0 5px;
  color: #6B7280;
  font-weight: 700;
  vertical-align: middle;
}
.tt-bubble {
  border-radius: 12px;
  padding: 10px 13px;
  font-size: 13.5px;
  line-height: 1.6;
  word-break: break-word;
}
.tt-file-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(255,255,255,.25); border: 1px solid rgba(255,255,255,.4);
  border-radius: 6px; padding: 3px 9px; font-size: 12px; font-weight: 600;
  text-decoration: none; margin-top: 4px; color: inherit;
}
.tt-msg-admin .tt-file-chip { border-color: rgba(255,255,255,.5); }
.tt-msg-client .tt-file-chip { background: var(--surface); border-color: var(--border); color: var(--teal, #0D9E75); }

.tt-compose {
  border-top: 1.5px solid var(--border, #E0E4EF);
  padding: 12px 16px 14px;
  flex-shrink: 0;
  background: var(--white, #fff);
}
.tt-staged { margin-bottom: 8px; }
.tt-staged-file {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border-radius: 7px; padding: 5px 10px;
  font-size: 12px; margin-bottom: 5px;
}
.tt-fp {
  flex: 1; height: 3px; background: var(--teal, #0D9E75);
  border-radius: 99px; width: 0%; transition: width .2s;
}
.tt-input-row {
  display: flex; gap: 8px; align-items: flex-end;
}
.tt-input {
  flex: 1; resize: none; padding: 10px 13px;
  border: 1.5px solid var(--border); border-radius: 10px;
  font-size: 13.5px; font-family: inherit; outline: none;
  max-height: 120px; overflow-y: auto; transition: border-color 0.15s;
}
.tt-input:focus { border-color: var(--teal, #0D9E75); }
.tt-attach-btn {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border: 1.5px solid var(--border);
  border-radius: 10px; cursor: pointer; font-size: 18px;
  background: var(--surface); flex-shrink: 0; transition: background 0.15s;
}
.tt-attach-btn:hover { background: var(--border); }
.tt-send-btn {
  background: var(--teal, #0D9E75); color: #fff; border: none;
  border-radius: 10px; padding: 10px 18px; font-size: 13.5px;
  font-weight: 700; cursor: pointer; flex-shrink: 0; transition: opacity 0.15s;
}
.tt-send-btn:hover { opacity: .85; }
.tt-send-btn:disabled { opacity: .5; cursor: default; }
.tt-internal-check {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--muted); cursor: pointer; margin-top: 8px;
}
.tt-internal-check input { cursor: pointer; }

/* ═══════════════════════════════════════════════════════════
   TASK ACTIVITY — timeline
═══════════════════════════════════════════════════════════ */
.ta-event {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 6px 0;
  border-bottom: 1px solid var(--border, #E0E4EF);
}
.ta-event:last-child { border-bottom: none; }
.ta-icon { font-size: 14px; flex-shrink: 0; margin-top: 1px; }
.ta-body { flex: 1; }
.ta-label { font-size: 12.5px; color: var(--ink, #0B0F1A); line-height: 1.4; }
.ta-time  { font-size: 11px; color: var(--muted, #6B7A9A); margin-top: 2px; }
