/* agent-customer: styles for this screen only (docs/AGENT_VIEWS.md).
   Lagoon tokens only; light and dark come from the tokens. */

.ag-cu { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; min-width: 0; }
.ag-cu-title { margin: 0; font-size: 26px; font-weight: 900; color: var(--text); }

/* search */
.ag-cu-form { display: flex; gap: 8px; align-items: stretch; }
.ag-cu-input { flex: 1 1 auto; min-width: 0; min-height: 48px; border-radius: var(--pill); padding: 0 18px; font-size: 16px; }
.ag-cu-go { min-height: 48px; padding: 0 24px; flex: 0 0 auto; white-space: nowrap; }
.ag-cu-hint { margin: 0; min-height: 1.2em; }
.ag-cu-bad { color: var(--bad-text); font-weight: 700; }
.ag-cu-sub { font-size: 12.5px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 6px; }
.ag-cu-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.ag-cu-chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: var(--pill);
  background: var(--panel); border: 2px solid var(--border-strong); color: var(--text); font-size: 14px;
}
.ag-cu-chip:hover { background: var(--accent-soft); }
.ag-cu-state { margin: 4px 0; }
.ag-cu-link {
  min-height: 44px; padding: 0 16px; border-radius: var(--pill); border: 0; background: transparent;
  color: var(--accent-strong); font-weight: 800; font-size: 14px; text-align: left; cursor: pointer;
}
.ag-cu-link:hover { background: var(--accent-soft); }

/* empty state */
.ag-cu-empty { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; display: grid; gap: 10px; justify-items: start; }
.ag-cu-empty p { margin: 0; }
.ag-cu-emptytitle { font-size: 20px; font-weight: 900; }

/* result: the customer on the left, the conversations on the right */
.ag-cu-grid { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 16px; align-items: start; }
.ag-cu-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; display: grid; gap: 12px; min-width: 0; }
.ag-cu-who-head { display: grid; justify-items: center; gap: 4px; text-align: center; }
.ag-cu-avatar {
  width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--coral-soft); color: var(--coral-text); font-size: 22px; font-weight: 900;
}
.ag-cu-avatar.ag-cu-sm { width: 40px; height: 40px; font-size: 15px; flex: 0 0 auto; }
.ag-cu-name { font-size: 20px; font-weight: 900; overflow-wrap: anywhere; }
.ag-cu-num { font-size: 13px; color: var(--muted); }
.ag-cu-badges { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.ag-cu-badge { font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: var(--pill); }
.ag-cu-b-warn { background: var(--warn-soft); color: var(--warn-text); }
.ag-cu-b-pause { background: var(--pause-soft); color: var(--pause-text); }
.ag-cu-b-call { background: var(--call-soft); color: var(--call-text); }
.ag-cu-rule { height: 1px; background: var(--border); }

.ag-cu-fields { margin: 0; display: grid; gap: 9px; }
.ag-cu-field { min-width: 0; }
.ag-cu-field dt { font-size: 11.5px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.ag-cu-field dd { margin: 0; font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }

.ag-cu-actions { display: grid; gap: 8px; margin-top: 4px; width: 100%; }
.ag-cu-act {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px;
  border-radius: var(--pill); font-weight: 800; font-size: 14.5px; text-decoration: none; box-sizing: border-box;
}
.ag-cu-crm { background: var(--accent-soft); color: var(--accent-strong); border: 2px solid transparent; }
.ag-cu-crm:hover { filter: brightness(0.97); color: var(--accent-strong); }
.ag-cu-act.hidden { display: none; }
.ag-cu-empty .ag-cu-actions { max-width: 260px; }

/* history */
.ag-cu-h { margin: 0; font-size: 17px; font-weight: 900; display: flex; align-items: center; gap: 8px; }
.ag-cu-count { background: var(--pause-soft); color: var(--pause-text); font-size: 12px; padding: 1px 8px; border-radius: var(--pill); }
.ag-cu-summary { margin: 0; color: var(--muted); font-size: 14px; font-weight: 700; }
.ag-cu-timeline { list-style: none; margin: 0; padding: 0; }
.ag-cu-item { display: flex; gap: 12px; min-width: 0; }
.ag-cu-rail { display: flex; flex-direction: column; align-items: center; flex: 0 0 12px; }
.ag-cu-dot { width: 12px; height: 12px; border-radius: 50%; margin-top: 4px; flex: 0 0 auto; background: var(--call); }
.ag-cu-o-ok { background: var(--ok); }
.ag-cu-o-warn { background: var(--warn); }
.ag-cu-o-bad { background: var(--bad); }
.ag-cu-o-pause { background: var(--pause); }
.ag-cu-o-call { background: var(--call); }
.ag-cu-line { width: 2px; flex: 1 1 auto; background: var(--border); }
.ag-cu-tx { padding-bottom: 14px; min-width: 0; }
.ag-cu-when { font-weight: 800; font-size: 14.5px; overflow-wrap: anywhere; }
.ag-cu-who { font-weight: 600; color: var(--muted); }
.ag-cu-mine { color: var(--accent-strong); font-weight: 800; }
.ag-cu-dir { font-size: 12px; color: var(--muted); font-weight: 700; }
.ag-cu-notes { font-size: 14px; color: var(--text); line-height: 1.4; margin-top: 2px; overflow-wrap: anywhere; white-space: pre-wrap; }

/* live card on Work */
.ag-customer { display: grid; gap: 12px; }
.ag-customer h2 { margin-bottom: 0; }
.ag-customer.hidden { display: none; }
#custBody { display: grid; gap: 12px; min-width: 0; }
.ag-cu-lhead { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ag-cu-lname { font-size: 17px; font-weight: 900; overflow-wrap: anywhere; }
.ag-cu-banner { background: var(--warn-soft); color: var(--warn-text); border-radius: var(--radius-md); padding: 12px 14px; font-size: 14.5px; line-height: 1.4; overflow-wrap: anywhere; }
.ag-cu-first { margin: 0; }
.ag-customer .ag-cu-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
.ag-customer .ag-cu-link { justify-self: start; padding-left: 0; }

/* small screens: result stacks; the live card follows the call card */
@media (max-width: 900px) {
  .ag-cu-grid { grid-template-columns: minmax(0, 1fr); }
  .ag-cu-card { padding: 16px; }
  .ag-cu-who-head { justify-items: start; text-align: left; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; }
  .ag-cu-who-head .ag-cu-avatar { grid-row: span 2; width: 52px; height: 52px; font-size: 19px; }
  .ag-cu-badges { justify-content: flex-start; }
  .ag-cu-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
  /* .ag-col is display: contents here, so cards are ordered individually.
     #custCard comes after #callCard in the DOM, so the same order puts it right below. */
  #custCard { order: 1; }
}
@media (max-width: 520px) {
  .ag-cu-title { font-size: 22px; }
  .ag-cu-go { padding: 0 18px; }
}
