/* Messaging dashboard — sits inside the existing dashboard's domain at
   /messaging/. Inherits the parent ../style.css for shared topbar / auth
   gate / card / control styles + .topnav, and adds layout for the
   message feed + roster sidebar here. */

/* Body grid: roster sidebar + main feed */
.messaging-body {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  padding: 0 24px 40px;
}

@media (max-width: 900px) {
  .messaging-body { grid-template-columns: 1fr; }
}

/* ── Roster sidebar ─────────────────────────────────────────────────────── */
.roster {
  background: #fff;
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
  align-self: start;
  position: sticky;
  top: 16px;
}

.roster-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}
.roster-header h2 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--grey-7);
  margin: 0;
}
.roster-count { font-size: 11px; color: var(--grey-5); }

.roster-list {
  list-style: none;
  padding: 0;
  margin: 0 0 14px 0;
}

.roster-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  transition: background .12s;
}
.roster-row:hover { background: var(--grey-1); }

.roster-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--grey-3);
  flex-shrink: 0;
}
.roster-dot--active  { background: var(--green); }
.roster-dot--unknown { background: #b56000; }

.roster-row--active .roster-name { font-weight: 600; }
.roster-name { flex: 1; word-break: break-word; }

.roster-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 8px;
  background: var(--grey-1);
  color: var(--grey-7);
  text-transform: uppercase;
  letter-spacing: .03em;
}

.roster-section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 700;
  color: var(--grey-5);
  margin: 12px 0 6px;
  border-top: 1px solid var(--grey-2);
  padding-top: 10px;
}

.roster-list--unknown .roster-row { color: var(--grey-7); }
.roster-list--unknown .roster-name { font-family: 'SF Mono', Menlo, Consolas, monospace; font-size: 12px; }

.roster-empty {
  font-size: 12px;
  color: var(--grey-5);
  font-style: italic;
  padding: 4px 8px;
  list-style: none;
}

/* ── Message feed ──────────────────────────────────────────────────────── */
.feed {
  background: #fff;
  border-radius: 10px;
  padding: 8px 0;
  box-shadow: var(--shadow);
  min-height: 200px;
}

.feed-list { display: flex; flex-direction: column; }

.msg {
  padding: 8px 16px;
  border-bottom: 1px solid var(--grey-2);
}
.msg:last-child { border-bottom: none; }

.msg-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 2px;
  flex-wrap: wrap;
}

/* Message item type rhythm: three sizes only — meta (12), name (14),
   body (15). Was 5 sizes scattered across 10/11/12/13/14. */
.msg-name {
  font-weight: 700;
  color: var(--text);
  font-size: 14px;
}
.msg-name--unknown {
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  color: #b56000;
  font-weight: 600;
}

.msg-channel {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.msg-channel--sms      { background: #e3eef9; color: #1e4e96; }
.msg-channel--whatsapp { background: #d6f0d8; color: #1a6e2e; }

.msg-time {
  margin-left: auto;
  font-size: 12px;
  color: var(--grey-5);
  font-variant-numeric: tabular-nums;
}

.msg-body {
  font-size: 15px;
  color: var(--text);
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.feed-empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--grey-5);
}

/* Date input styling lives in the shared parent ../style.css now —
   removed the duplicate that drifted out of sync. */
