/* Work views (home, customers, sales, reply) — docs/FINAL_BUILD_PLAN.md §5, builder F1. Uses the components of app.css
   (.page, .panel, .kpi, .board, .list, .timeline, .chip, .btn, .form-grid …); only view-specific rules live here. */

/* ---------------------------------------------------------------- simulated replies in the conversation thread */
.msg-sim { align-self: flex-end; max-width: min(560px, 86%); display: grid; gap: 4px; }
.msg-sim .msg-bubble {
  background: var(--sunken);
  border: 1.5px dashed var(--control);
  color: var(--ink);
}
.msg-sim-tag { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.msg-sim-tag .ico { width: 14px; height: 14px; }

/* ---------------------------------------------------------------- reply review panel */
.reply-panel {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 16px 18px 20px;
  display: flex; flex-direction: column; gap: 10px;
}
.reply-rules { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; color: var(--muted); margin: 0; }
.reply-rules .ico { flex: none; margin-top: 2px; }
.reply-form { display: grid; gap: 8px; }
.reply-input { min-height: 96px; resize: vertical; }
.reply-form-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.reply-items { display: grid; gap: 8px; }
.reply-item { border: 1px dashed var(--control); border-radius: var(--radius-sm); padding: 10px 12px; display: grid; gap: 6px; background: var(--sunken); }
.reply-item-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.reply-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.reply-cancelled .reply-body, .reply-blocked .reply-body { color: var(--muted); }

/* ---------------------------------------------------------------- CRM side panel of a conversation */
.crm-panel { padding: 16px 18px; border-bottom: 1px solid var(--line); display: grid; gap: 8px; }
.crm-panel h2 { display: flex; align-items: center; gap: 8px; font-size: 1rem; margin: 0; }
.crm-sub { font-size: 13px; color: var(--muted); margin: 8px 0 0; font-weight: 600; }
.crm-block { display: grid; gap: 8px; }
.crm-hint { border-inline-start: 3px solid var(--warn); background: var(--warn-bg); padding: 8px 10px; border-radius: var(--radius-sm); }
.crm-hint-tag { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 4px; }

/* ---------------------------------------------------------------- tasks, timeline, qualification */
.task-item { display: flex; align-items: flex-start; gap: 10px; }
.task-check { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; cursor: pointer; }
.task-done { text-decoration: line-through; color: var(--muted); }
.tl-change { color: var(--muted); }
.qual-grid { align-items: end; }
.qual-result { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 12px; background: var(--sunken); }
.evidence-slot { display: grid; gap: 8px; }
.field-label { font-weight: 600; }

/* ---------------------------------------------------------------- sales board (layout of .board comes from app.css) */
.sales-board { display: grid; gap: 12px; }
.board-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }

/* KPI tiles that are buttons (e.g. "tasks due" moves focus to my tasks) look like the linked ones */
button.kpi { font: inherit; text-align: start; cursor: pointer; width: 100%; }

/* ---------------------------------------------------------------- phone */
@media (max-width: 760px) {
  .msg-sim { max-width: 94%; }
  .reply-panel, .crm-panel { padding-inline: 14px; }
  .reply-form-foot { justify-content: flex-start; }
}

/* Linked KPI tiles: the whole tile is the link — no underlined text, ink colour, hover/focus on the tile itself. */
a.kpi { color: var(--ink); text-decoration: none; transition: border-color .15s, background-color .15s; }
a.kpi:hover, button.kpi:hover { border-color: var(--line-2); background: var(--tint); }
a.kpi .kpi-sub, a.kpi .kpi-label { color: var(--muted); }
/* A word value (agent mode, channels "2/3 تستقبل") uses a smaller face than a count. */
.kpi-value-text { font-size: 17px; line-height: 1.4; }
