/* =============================================================================
   CLAB Desk - Staff Console styles
   Shares CSS variables from styles.css. Light theme only. Accent #2563eb.
   No gradients, no dark mode.
   ============================================================================= */

/* ━━━ SHELL ━━━ */
body { background: var(--bg); }

.desk-topbar {
  position: sticky; top: 0; z-index: 100;
}

/* Override brand-sub for the desk variant */
.desk-topbar .brand-name { font-size: var(--fs-15); }

/* ━━━ DESK SHELL: 3-column grid ━━━ */
.desk-shell {
  display: grid;
  grid-template-columns: 220px minmax(300px, 420px) 1fr;
  grid-template-rows: 1fr;
  height: calc(100vh - 53px - 36px); /* topbar + footer */
  min-height: 0;
  overflow: hidden;
}

/* State-chip working = typing animated dots */
.ddb-state-chip[data-state="working"]::after {
  content: ' ···';
  animation: state-typing-dots 1.4s steps(4, end) infinite;
  display: inline-block;
  width: 1.8ch;
  overflow: hidden;
  vertical-align: bottom;
}

@keyframes state-typing-dots {
  0%, 20%  { content: ''; }
  40%      { content: ' ·'; }
  60%      { content: ' ··'; }
  80%, 100%{ content: ' ···'; }
}

/* ━━━ LEFT RAIL ━━━ */
.desk-rail {
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 16px 0 0;
}

.desk-rail-head {
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--t-4);
  padding: 0 16px 10px;
}

.desk-lanes {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 8px;
  overflow-y: auto;
}

.desk-lane-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 10px 12px;
  border-radius: 9px;
  font-size: var(--fs-13);
  font-weight: 500;
  color: var(--t-2);
  text-align: left;
  transition: all var(--t-fast) var(--ease);
  position: relative;
}

.desk-lane-btn:hover {
  background: var(--surface-3);
  color: var(--t-1);
}

.desk-lane-btn.active {
  background: var(--acc-soft);
  color: var(--acc-ink);
  font-weight: 600;
}

.desk-lane-btn.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 20px;
  background: var(--acc);
  border-radius: 0 3px 3px 0;
}

.desk-lane-btn.active .dl-icon { color: var(--acc); }

.dl-icon { flex-shrink: 0; color: var(--t-3); transition: color var(--t-fast); }
.desk-lane-btn:hover .dl-icon { color: var(--t-1); }

.dl-label { flex: 1; }

.dl-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--fs-11);
  font-weight: 700;
  min-width: 20px;
  text-align: right;
  color: var(--t-4);
  transition: color var(--t-fast);
}

.desk-lane-btn.active .dl-count { color: var(--acc); }
.dl-count.has-items { color: var(--acc); }

.desk-rail-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: var(--fs-11);
  color: var(--t-4);
}

.desk-poll-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
  animation: desk-pulse 2.4s ease-in-out infinite;
}

@keyframes desk-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ━━━ HANDLER CHIP (top bar) ━━━ */
.desk-handler-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 8px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 14px;
  font-size: var(--fs-12);
  font-weight: 600;
  color: var(--t-2);
}

.desk-back-link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ━━━ CENTER: item list ━━━ */
.desk-center {
  background: var(--bg);
  border-right: 1px solid var(--line);
  display: grid;
  grid-template-rows: auto auto 1fr;
  min-height: 0;
  overflow: hidden;
}

.desk-not-handler {
  grid-row: 1 / 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 40px 32px;
  text-align: center;
}

.dnh-orb {
  width: 56px; height: 56px;
  border-radius: 14px;
  background: var(--acc-soft);
  border: 1px solid var(--acc-tint);
  display: grid;
  place-items: center;
}

.dnh-h {
  font-family: 'Space Grotesk', sans-serif;
  font-size: var(--fs-16);
  font-weight: 600;
  color: var(--t-1);
  margin: 0;
}

.dnh-p {
  font-size: var(--fs-13);
  color: var(--t-3);
  margin: 0;
  line-height: 1.55;
  max-width: 280px;
}

.desk-center-head {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dch-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: var(--fs-15);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--t-1);
}

.dch-meta {
  font-size: var(--fs-12);
  color: var(--t-3);
  font-family: 'JetBrains Mono', monospace;
}

.desk-item-list {
  overflow-y: auto;
  padding: 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.desk-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 24px;
  font-size: var(--fs-13);
  color: var(--t-3);
  justify-content: center;
}

.dl-spinner {
  width: 16px; height: 16px;
  border: 2px solid var(--surface-3);
  border-top-color: var(--acc);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  flex-shrink: 0;
}

.desk-empty-lane {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 32px 20px;
  font-size: var(--fs-13);
  color: var(--t-3);
  flex-direction: column;
}

/* ── Item card ── */
.desk-item-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease);
  animation: fade-in 200ms var(--ease);
  position: relative;
}

.desk-item-card:hover {
  border-color: var(--acc-tint);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.desk-item-card.active {
  border-color: var(--acc);
  box-shadow: 0 0 0 1px var(--acc), var(--shadow);
  background: var(--acc-soft);
}

/* SLA urgency left border */
.desk-item-card::before {
  content: '';
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--green);
}
.desk-item-card.sla-amber::before { background: var(--amber); }
.desk-item-card.sla-red::before { background: var(--red); }

.dic-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
}

.dic-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--acc);
  color: white;
  display: grid;
  place-items: center;
  font-size: var(--fs-11);
  font-weight: 700;
  flex-shrink: 0;
}

.dic-user-info { flex: 1; min-width: 0; }
.dic-user-name {
  font-size: var(--fs-13);
  font-weight: 600;
  color: var(--t-1);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dic-user-role {
  font-size: var(--fs-11);
  color: var(--t-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.dic-mood {
  flex-shrink: 0;
}

/* Mood chips */
.mood-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: var(--fs-11);
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
}

.mood-chip[data-mood="calm"]      { background: #eff6ff; color: #1d4ed8; border-color: #dbeafe; }
.mood-chip[data-mood="neutral"]   { background: var(--surface-3); color: var(--t-2); border-color: var(--line); }
.mood-chip[data-mood="happy"]     { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.mood-chip[data-mood="rushed"]    { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.mood-chip[data-mood="stressed"]  { background: #fff7ed; color: #9a3412; border-color: #fed7aa; }
.mood-chip[data-mood="frustrated"]{ background: #fef2f2; color: #991b1b; border-color: #fecaca; }

.dic-agent {
  font-size: var(--fs-11);
  color: var(--t-3);
  font-family: 'JetBrains Mono', monospace;
  background: var(--surface-3);
  border: 1px solid var(--line);
  padding: 1px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}

/* SLA bar */
.dic-sla-bar {
  height: 3px;
  border-radius: 2px;
  background: var(--surface-3);
  margin: 6px 0;
  overflow: hidden;
}
.dic-sla-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--green);
  transition: width 0.4s var(--ease);
}
.dic-sla-fill.amber { background: var(--amber); }
.dic-sla-fill.red   { background: var(--red); }

.dic-sla-label {
  font-size: var(--fs-11);
  color: var(--t-3);
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 6px;
  display: flex;
  justify-content: flex-end;
}
.dic-sla-label.amber { color: var(--amber); }
.dic-sla-label.red   { color: var(--red); }

.dic-question {
  font-size: var(--fs-12);
  color: var(--t-1);
  font-weight: 500;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin-bottom: 4px;
}

.dic-ai-attempt {
  font-size: var(--fs-12);
  color: var(--t-3);
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.dic-expect-note {
  margin-top: 6px;
  font-size: var(--fs-11);
  color: #92400e;
  background: var(--amber-soft);
  border: 1px solid #fde68a;
  border-radius: 5px;
  padding: 4px 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ━━━ RIGHT: detail ━━━ */
.desk-detail {
  background: var(--surface);
  display: grid;
  grid-template-rows: 1fr;
  min-height: 0;
  overflow: hidden;
}

.desk-detail-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px;
  color: var(--t-3);
  font-size: var(--fs-13);
}

.dde-orb {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: var(--acc-soft);
  border: 1px solid var(--acc-tint);
  display: grid;
  place-items: center;
}

.desk-detail-body {
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  min-height: 0;
  overflow: hidden;
}

/* Detail header */
.ddb-head {
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.ddb-user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.ddb-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--acc);
  color: white;
  display: grid;
  place-items: center;
  font-size: var(--fs-13);
  font-weight: 700;
  flex-shrink: 0;
}

.ddb-user-info { flex: 1; min-width: 0; }
.ddb-user-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: var(--fs-15);
  font-weight: 600;
  color: var(--t-1);
}
.ddb-user-role {
  font-size: var(--fs-12);
  color: var(--t-3);
}

.ddb-close {
  padding: 6px;
  margin-left: auto;
  flex-shrink: 0;
}

.ddb-title {
  font-size: var(--fs-14);
  font-weight: 600;
  color: var(--t-1);
  line-height: 1.4;
  margin-bottom: 8px;
}

.ddb-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.ddb-agent {
  font-size: var(--fs-11);
  font-family: 'JetBrains Mono', monospace;
  background: var(--surface-3);
  border: 1px solid var(--line);
  padding: 1px 7px;
  border-radius: 4px;
  color: var(--t-2);
}

.ddb-sla {
  font-size: var(--fs-11);
  font-family: 'JetBrains Mono', monospace;
  color: var(--t-3);
}
.ddb-sla.amber { color: var(--amber); }
.ddb-sla.red   { color: var(--red); }

.ddb-state-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 9px;
  font-size: var(--fs-11);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: var(--surface-3);
  color: var(--t-2);
  border: 1px solid var(--line);
}
.ddb-state-chip[data-state="new"]          { background: #eff6ff; color: var(--acc); border-color: var(--acc-tint); }
.ddb-state-chip[data-state="claimed"]      { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.ddb-state-chip[data-state="working"]      { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.ddb-state-chip[data-state="waiting_user"] { background: #f5f3ff; color: #5b21b6; border-color: #ddd6fe; }
.ddb-state-chip[data-state="resolved"]     { background: var(--green-soft); color: var(--green); border-color: #a7f3d0; }
.ddb-state-chip[data-state="reopened"]     { background: var(--red-soft); color: var(--red); border-color: #fecaca; }
.ddb-state-chip[data-state="cancelled"]    { background: var(--surface-3); color: var(--t-3); border-color: var(--line); }

.ddb-priority[data-priority="urgent"] { color: var(--red); font-size: var(--fs-11); font-weight: 700; text-transform: uppercase; }
.ddb-priority[data-priority="high"]   { color: var(--amber); font-size: var(--fs-11); font-weight: 700; text-transform: uppercase; }

.ddb-expect-note {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 8px;
  padding: 7px 10px;
  background: var(--amber-soft);
  border: 1px solid #fde68a;
  border-radius: 6px;
  font-size: var(--fs-12);
  color: #78350f;
  line-height: 1.5;
}
.ddb-expect-note svg { flex-shrink: 0; margin-top: 2px; color: var(--amber); }
.ddb-expect-label { font-weight: 600; flex-shrink: 0; }

/* Detail tabs */
.ddb-tabs {
  display: flex;
  gap: 0;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  padding: 0 18px;
}

.ddb-tab {
  padding: 10px 14px;
  font-size: var(--fs-13);
  font-weight: 500;
  color: var(--t-3);
  border-bottom: 2px solid transparent;
  transition: all var(--t-fast) var(--ease);
  border-radius: 0;
}

.ddb-tab:hover { color: var(--t-1); }
.ddb-tab.active {
  color: var(--acc);
  border-bottom-color: var(--acc);
  font-weight: 600;
}

/* Detail panels */
.ddb-panel {
  overflow-y: auto;
  padding: 0;
  min-height: 0;
}

/* ── Thread panel ── */
.thread-stream {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 18px;
}

.turn-user {
  align-self: flex-end;
  max-width: 82%;
  padding: 9px 13px;
  font-size: var(--fs-13);
  background: var(--acc);
  color: white;
  border-radius: 12px 12px 3px 12px;
  animation: fade-in 200ms var(--ease);
}

.turn-user .turn-meta {
  font-size: var(--fs-11);
  opacity: 0.75;
  margin-top: 3px;
}

.turn-assistant {
  align-self: flex-start;
  max-width: 90%;
  padding: 9px 13px;
  font-size: var(--fs-13);
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 3px 12px 12px 12px;
  color: var(--t-1);
  line-height: 1.55;
  animation: fade-in 200ms var(--ease);
}

.turn-assistant .turn-meta {
  font-size: var(--fs-11);
  color: var(--t-4);
  margin-top: 3px;
}

/* Human turn - distinct warm styling */
.turn-human {
  align-self: flex-start;
  max-width: 88%;
  background: var(--surface);
  border: 1.5px solid var(--acc-tint);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: var(--fs-13);
  line-height: 1.55;
  animation: fade-in 200ms var(--ease);
  box-shadow: var(--shadow-sm);
}

.turn-human-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.turn-human-avatar {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--acc);
  color: white;
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 700;
  flex-shrink: 0;
}

.turn-human-name {
  font-size: var(--fs-12);
  font-weight: 600;
  color: var(--acc-ink);
}

.turn-human-role {
  font-size: var(--fs-11);
  color: var(--t-3);
  padding: 0px 6px;
  background: var(--acc-soft);
  border-radius: 4px;
  border: 1px solid var(--acc-tint);
}

.turn-human-meta {
  font-size: var(--fs-11);
  color: var(--t-4);
  margin-left: auto;
}

.turn-human-body { color: var(--t-1); }

.turn-meta-mood {
  display: inline-block;
  margin-top: 4px;
}

/* ── Events timeline ── */
.events-timeline {
  display: flex;
  flex-direction: column;
  padding: 14px 18px;
  gap: 0;
}

.event-row {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  padding-bottom: 14px;
  position: relative;
}

.event-row:not(:last-child) .ev-dot::after {
  content: '';
  position: absolute;
  left: 10px;
  top: 22px;
  bottom: 0;
  width: 1px;
  background: var(--line);
}

.ev-dot {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--acc-soft);
  border: 2px solid var(--acc-tint);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.ev-dot.ev-created   { background: var(--acc-soft); border-color: var(--acc-tint); }
.ev-dot.ev-claimed   { background: #fffbeb; border-color: #fde68a; }
.ev-dot.ev-replied   { background: var(--green-soft); border-color: #a7f3d0; }
.ev-dot.ev-resolved  { background: var(--green-soft); border-color: #a7f3d0; }
.ev-dot.ev-note      { background: var(--surface-3); border-color: var(--line); }
.ev-dot.ev-sla_breach{ background: var(--red-soft); border-color: #fecaca; }

.ev-body { min-width: 0; padding-top: 1px; }
.ev-kind {
  font-size: var(--fs-12);
  font-weight: 600;
  color: var(--t-1);
}
.ev-detail {
  font-size: var(--fs-12);
  color: var(--t-3);
  margin-top: 1px;
  line-height: 1.4;
}
.ev-time {
  font-size: var(--fs-11);
  color: var(--t-4);
  font-family: 'JetBrains Mono', monospace;
  margin-top: 2px;
}

/* ── Work panel ── */
.ddb-panel#panelWork {
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.work-claim-row {
  padding: 8px 0;
}

.work-claim-btn {
  width: 100%;
  padding: 11px;
  font-size: var(--fs-14);
  font-weight: 600;
}

.work-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.work-section-label {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--t-4);
}

.work-composer-shell {
  border: 1.5px solid var(--line-strong);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color var(--t-fast);
}
.work-composer-shell:focus-within {
  border-color: var(--acc);
  box-shadow: 0 0 0 3px var(--acc-soft);
}

.work-textarea {
  width: 100%;
  resize: vertical;
  border: 0;
  outline: none;
  background: var(--surface);
  font-size: var(--fs-13);
  color: var(--t-1);
  padding: 10px 12px;
  line-height: 1.55;
  font-family: inherit;
  min-height: 80px;
}
.work-textarea::placeholder { color: var(--t-4); }
.work-textarea-note { background: var(--surface-2); }

.work-composer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.suggest-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-12);
  color: var(--acc);
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--acc-tint);
  background: var(--acc-soft);
  transition: all var(--t-fast);
}
.suggest-btn:hover { background: var(--acc-tint); color: var(--acc-ink); }
.suggest-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.work-composer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.work-also-resolve {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-12);
  color: var(--t-2);
  cursor: pointer;
}
.work-also-resolve input[type="checkbox"] { accent-color: var(--acc); }

.work-note-foot {
  display: flex;
  justify-content: flex-end;
}

/* State actions */
.work-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.work-state-btn {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: var(--fs-12);
  font-weight: 500;
  background: var(--surface);
  color: var(--t-2);
  border: 1px solid var(--line);
  transition: all var(--t-fast) var(--ease);
}
.work-state-btn:hover { background: var(--surface-3); color: var(--t-1); }
.work-state-btn.active { background: var(--acc-soft); color: var(--acc); border-color: var(--acc-tint); }
.work-state-btn-resolve { color: var(--green); border-color: #a7f3d0; background: var(--green-soft); }
.work-state-btn-resolve:hover { background: #d1fae5; color: #065f46; }
.work-state-btn-danger { color: var(--red); border-color: #fecaca; background: var(--red-soft); }
.work-state-btn-danger:hover { background: #fee2e2; color: #7f1d1d; }

.work-reassign-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 4px;
  border-top: 1px solid var(--line);
  margin-top: 4px;
}
.wr-label { font-size: var(--fs-12); color: var(--t-3); }
.wr-input {
  width: 90px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: var(--fs-12);
  font-family: 'JetBrains Mono', monospace;
  background: var(--surface);
  color: var(--t-1);
  outline: none;
  transition: border-color var(--t-fast);
}
.wr-input:focus { border-color: var(--acc); box-shadow: 0 0 0 2px var(--acc-soft); }

/* ━━━ STATUS FOOTER ━━━ */
.desk-status-footer {
  height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 18px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  font-size: var(--fs-11);
  color: var(--t-4);
}
.sf-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--t-4); }
.sf-dot.ok  { background: var(--green); }
.sf-dot.bad { background: var(--red); }
.sf-sep { opacity: 0.4; }

/* ━━━ RTL SUPPORT ━━━ */
[dir=rtl] .desk-shell { direction: rtl; }
[dir=rtl] .desk-rail  { border-left: 1px solid var(--line); border-right: none; }
[dir=rtl] .desk-center { border-left: 1px solid var(--line); border-right: none; }
[dir=rtl] .desk-lane-btn.active::before { left: auto; right: 0; border-radius: 3px 0 0 3px; }
[dir=rtl] .desk-lane-btn { flex-direction: row-reverse; }
[dir=rtl] .ddb-user-row { flex-direction: row-reverse; }
[dir=rtl] .ddb-meta-row { flex-direction: row-reverse; }
[dir=rtl] .ddb-close { margin-left: 0; margin-right: auto; }
[dir=rtl] .turn-user { border-radius: 12px 12px 12px 3px; }
[dir=rtl] .turn-assistant { border-radius: 12px 3px 12px 12px; }
[dir=rtl] .work-composer-foot { flex-direction: row-reverse; }
[dir=rtl] .work-composer-actions { flex-direction: row-reverse; }
[dir=rtl] .dic-top { flex-direction: row-reverse; }
[dir=rtl] .turn-human-header { flex-direction: row-reverse; }
[dir=rtl] .turn-human-meta { margin-left: 0; margin-right: auto; }
[dir=rtl] .desk-topbar .brand { flex-direction: row-reverse; }
[dir=rtl] .desk-topbar .top-right { flex-direction: row-reverse; }
[dir=rtl] .desk-center-head { flex-direction: row-reverse; }
[dir=rtl] .event-row { direction: rtl; }
[dir=rtl] .work-actions-row { flex-direction: row-reverse; }
[dir=rtl] .work-reassign-row { flex-direction: row-reverse; }

/* ━━━ METRICS PANEL ━━━ */
.desk-metrics-panel {
  grid-column: 2 / 4;         /* spans center + detail columns */
  background: var(--bg);
  overflow-y: auto;
  padding: 24px 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-height: 0;
}

.dmp-head {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.dmp-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: var(--fs-18);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--t-1);
}

.dmp-sub {
  font-size: var(--fs-12);
  color: var(--t-3);
  font-family: 'JetBrains Mono', monospace;
}

.dmp-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 24px 0;
  font-size: var(--fs-13);
  color: var(--t-3);
}

.dmp-no-data {
  padding: 24px 0;
  font-size: var(--fs-13);
  color: var(--t-3);
}

/* KPI card row */
.dmp-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.dmp-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  box-shadow: var(--shadow-sm);
}

.dmp-card-warn {
  border-color: #fde68a;
  background: var(--amber-soft);
}

.dmp-card-val {
  font-family: 'Space Grotesk', sans-serif;
  font-size: var(--fs-24);
  font-weight: 700;
  color: var(--t-1);
  letter-spacing: -0.02em;
  line-height: 1;
}

.dmp-card-val.accent { color: var(--acc); }
.dmp-card-val.danger { color: var(--red); }

.dmp-card-label {
  font-size: var(--fs-11);
  font-weight: 600;
  color: var(--t-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Charts row */
.dmp-charts-row {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 14px;
}

.dmp-chart-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dmp-chart-label {
  font-size: var(--fs-12);
  font-weight: 600;
  color: var(--t-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.dmp-chart-frame {
  position: relative;
  height: 180px;
}

/* CSAT display */
.dmp-csat-display {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 4px;
}

.dmp-csat-big {
  font-family: 'Space Grotesk', sans-serif;
  font-size: var(--fs-28);
  font-weight: 700;
  color: var(--acc);
  letter-spacing: -0.02em;
}

.dmp-csat-empty {
  font-size: var(--fs-13);
  color: var(--t-3);
  padding: 12px 0;
}

.dmp-csat-bar-wrap {
  height: 8px;
  border-radius: 4px;
  background: var(--surface-3);
  overflow: hidden;
}

.dmp-csat-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--acc);
  transition: width 0.4s var(--ease);
}

.dmp-csat-meta {
  display: flex;
  gap: 14px;
  font-size: var(--fs-12);
  color: var(--t-3);
  font-family: 'JetBrains Mono', monospace;
}

/* ━━━ KEYBOARD SHORTCUTS HELP ━━━ */
.desk-shortcuts-help {
  position: fixed;
  inset: 0;
  background: rgba(11, 20, 36, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: fade-in 160ms var(--ease);
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.dsh-inner {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 20px 24px 24px;
  min-width: 280px;
  max-width: 360px;
}

.dsh-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: var(--fs-15);
  font-weight: 600;
  color: var(--t-1);
}

.dsh-close {
  padding: 4px 8px;
  font-size: var(--fs-13);
}

.dsh-list {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dsh-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-13);
  color: var(--t-2);
}

.dsh-list kbd {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--fs-11);
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px 7px;
  color: var(--t-2);
  white-space: nowrap;
  min-width: 28px;
  text-align: center;
}

.dsh-list span {
  color: var(--t-2);
}

/* ━━━ RESPONSIVE ━━━ */
@media (max-width: 1200px) {
  .desk-shell { grid-template-columns: 200px minmax(280px, 360px) 1fr; }
}
@media (max-width: 900px) {
  .desk-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
  }
  .desk-rail { border-right: none; border-bottom: 1px solid var(--line); flex-direction: row; padding: 0; height: auto; overflow-x: auto; }
  .desk-rail-head { display: none; }
  .desk-lanes { flex-direction: row; padding: 8px; gap: 4px; }
  .desk-lane-btn { flex-direction: column; gap: 2px; font-size: 10px; padding: 8px 10px; }
  .desk-lane-btn.active::before { top: 0; left: 8px; right: 8px; width: auto; height: 3px; transform: none; border-radius: 0 0 3px 3px; }
  .desk-rail-footer { display: none; }
  .desk-detail { display: none; }
  .desk-detail.open { display: grid; position: fixed; inset: 53px 0 36px; z-index: 200; }
}

/* Regression fix (2026-06-19): make [hidden] authoritative + hide Arabic toggle. */
[hidden] { display: none !important; }
#deskLangToggle, .lang-toggle-btn { display: none !important; }

/* Workstream C (2026-07-04): helpdesk ticket Category filter chips + card badge.
   Light, blue accent #2563eb, no gradient. Chips render only when the lane has
   categorised helpdesk items, so other desks are visually unchanged. */
.desk-cat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 16px 4px;
  border-bottom: 1px solid var(--line);
}
.desk-cat-chip {
  font-size: var(--fs-12);
  color: var(--t-2);
  background: var(--surface-3);
  border: 1px solid var(--line);
  padding: 3px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.desk-cat-chip:hover { border-color: #2563eb; color: #2563eb; }
.desk-cat-chip.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}
.desk-cat-chip:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }

.dic-cat {
  font-size: var(--fs-11);
  color: #2563eb;
  background: #eff4ff;
  border: 1px solid #cfe0ff;
  padding: 1px 7px;
  border-radius: 999px;
  flex-shrink: 0;
}
