/* The owner's client list in their cabinet. Same tokens as the rest of the site (assets/site.css). */

.notice { margin-top: 18px; padding: 12px 16px; border-radius: 12px; font-size: 15px; }
.notice-ok { background: var(--green-50); color: var(--green); }
.notice-bad { background: var(--warn-bg); color: var(--warn-ink); }

.stats {
  margin-top: 22px; display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.stat {
  padding: 16px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.stat-warn { border-color: var(--warn-ink); }
.stat-n { display: block; font-size: 26px; font-weight: 800; letter-spacing: -0.03em; color: var(--ink); }
.stat-l { display: block; margin-top: 4px; font-size: 13.5px; color: var(--muted); }

.clients-table {
  margin-top: 18px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto;
}
.clients-table table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.clients-table th, .clients-table td { padding: 12px 14px; text-align: left; vertical-align: top; white-space: nowrap; }
.clients-table th {
  font-size: 12.5px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--muted); background: var(--line-soft);
}
.clients-table tbody tr + tr { border-top: 1px solid var(--line-soft); }
.clients-table .muted { color: var(--muted); font-size: 13px; }
/* Somebody who has not come back for two months: the row the owner should act on. */
.clients-table tr.lost td:first-child { box-shadow: inset 3px 0 0 var(--warn-ink); }

.manual {
  margin-top: 18px; display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  align-items: end;
}
.manual label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); min-width: 0; }
.manual input, .manual select {
  min-height: 46px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); color: var(--ink); font: inherit; font-size: 15.5px; min-width: 0;
}
.manual button { min-height: 46px; }

/* A long service name in a <select> must not widen the page: selects size to their longest option. */
.manual select { width: 100%; }
@media (max-width: 560px) {
  .manual { grid-template-columns: minmax(0, 1fr); }
  .manual button { width: 100%; }
}

/* ---------- inbox ---------- */

.chats { margin-top: 20px; display: grid; gap: 10px; }
.chat {
  display: grid; gap: 6px; padding: 14px 16px; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.chat:hover { border-color: var(--blue); }
.chat-top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.chat-when { color: var(--muted); font-size: 13px; white-space: nowrap; }
.chat-last { color: var(--muted); font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 650; background: var(--line-soft); color: var(--muted); }
.tag-human { background: var(--blue-50); color: var(--blue); }
.tag-new { background: var(--green-50); color: var(--green); }
.tag-closed { background: var(--warn-bg); color: var(--warn-ink); }

.thread {
  margin-top: 20px; padding: 16px; display: grid; gap: 10px; max-height: 60vh; overflow-y: auto;
  background: var(--line-soft); border-radius: var(--radius);
}
.msg { max-width: 78%; padding: 10px 14px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
/* The client is on the left; anything the business sent is on the right. */
.msg-client { justify-self: start; border-bottom-left-radius: 5px; }
.msg-bot, .msg-human { justify-self: end; background: var(--blue-50); border-bottom-right-radius: 5px; }
.msg-text { white-space: pre-wrap; word-break: break-word; font-size: 15.5px; }
.msg-when { margin-top: 4px; font-size: 12px; color: var(--muted); }

.reply { margin-top: 16px; display: grid; gap: 10px; }
.reply textarea {
  padding: 12px; border: 1px solid var(--line); border-radius: 14px; resize: vertical;
  background: var(--surface); color: var(--ink); font: inherit; font-size: 15.5px;
}
.handback { margin-top: 14px; }

.export-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

/* Six numbers one per row were almost three screens on a phone before the list. */
@media (max-width: 600px) {
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 12px; }
  .stat-n { font-size: 21px; }
}

/* Account and security */
.acc-danger { margin-top: 8px; }
.acc-danger summary { cursor: pointer; color: var(--warn-ink); font-weight: 600; }
.acc-list { margin-top: 12px; display: grid; gap: 12px; list-style: none; padding: 0; }
.acc-list > li { padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.acc-setup { background: var(--blue-50); color: var(--ink); }
.acc-key code { font-size: 18px; letter-spacing: 0.08em; word-break: break-all; }
.acc-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; list-style: none; padding: 0; margin-top: 10px; }
.acc-codes code { font-size: 16px; }
