/* Call Recordings — a listening surface, so the row is built around the play
   control and the person, with numbers and timestamps a step quieter. */

.rec-layout { padding: 20px 28px 72px; }

.rec-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.rec-title { margin: 0 0 4px; font-size: 22px; font-weight: 800; letter-spacing: -.3px; }
.rec-sub   { margin: 0; font-size: 13px; color: var(--text-muted, #9ca3af); }
.rec-header-actions { display: flex; gap: 8px; }

.rec-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.rec-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  box-sizing: border-box;
  padding: 0 14px;
  min-width: 240px;
  max-width: 360px;
  flex: 1;
  border: 1.5px solid var(--border, #e5e7eb);
  border-radius: 999px;
  background: var(--bg, #fff);
  color: var(--text-muted, #9ca3af);
  transition: border-color .15s;
}
.rec-search:focus-within { border-color: var(--accent, #22c55e); }
.rec-search input {
  border: none; outline: none; background: transparent;
  font: inherit; font-size: 13px; width: 100%;
  color: var(--text-primary, #111827);
}
.rec-count { font-size: 12px; font-weight: 600; color: var(--text-muted, #9ca3af); margin-left: auto; }

.rec-card {
  background: var(--card, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius-lg, 14px);
  box-shadow: var(--shadow-card, 0 1px 2px rgba(0,0,0,.04));
  overflow: hidden;
}

/* ── Table ────────────────────────────────────────────
   Recordings are scanned in columns — who called, who they called, when —
   so this is a real table rather than a stack of cards. The player and any
   transcript unfold as extra rows beneath the one they belong to, which
   keeps the columns aligned no matter what is expanded. */
.rec-table-wrap { overflow-x: auto; }

.rec-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}
.rec-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg-secondary, #f9fafb);
  padding: 11px 14px;
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--text-muted, #9ca3af);
  white-space: nowrap;
  border-bottom: 1px solid var(--border, #e5e7eb);
}
.rec-th-play { width: 48px; }
.rec-th-dur  { text-align: right; width: 86px; }
.rec-th-act  { text-align: right; width: 92px; }

.rec-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border, #f3f4f6);
  font-size: 13px;
  vertical-align: middle;
}
.rec-row { transition: background-color .12s ease; }
.rec-row:hover { background: var(--bg-secondary, #f9fafb); }
.rec-row.playing { background: color-mix(in srgb, var(--accent, #22c55e) 7%, transparent); }

.rec-td-play { padding-right: 0; }
.rec-play {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 50%;
  background: var(--card, #fff);
  color: var(--accent, #22c55e);
  cursor: pointer;
  transition: background-color .12s ease, border-color .12s ease, transform .1s ease;
}
.rec-play:hover  { background: color-mix(in srgb, var(--accent, #22c55e) 12%, transparent); border-color: var(--accent, #22c55e); }
.rec-play:active { transform: scale(.94); }
.rec-play:focus-visible { outline: 2px solid var(--accent, #22c55e); outline-offset: 2px; }

/* The team member is the column most often scanned, so it carries the most
   weight on the row. */
.rec-agent {
  display: inline-flex; align-items: center; gap: 7px;
  font-weight: 700; font-size: 13px;
  white-space: nowrap;
}
.rec-agent-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent, #22c55e);
  flex-shrink: 0;
}
.rec-contact { font-weight: 600; }
.rec-muted   { color: var(--text-muted, #9ca3af); font-style: italic; font-size: 12.5px; }

.rec-dir {
  display: inline-block;
  margin-left: 7px;
  font-size: 9.5px; font-weight: 700; letter-spacing: .3px;
  padding: 2px 6px; border-radius: 999px;
  vertical-align: 1px;
}
.rec-dir.out { background: #ede9fe; color: #6d28d9; }
.rec-dir.in  { background: #dcfce7; color: #15803d; }

.rec-num {
  font-size: 12.5px;
  color: var(--text-secondary, #6b7280);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.rec-when {
  font-size: 12.5px;
  color: var(--text-secondary, #6b7280);
  white-space: nowrap;
}
.rec-dur {
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.rec-td-act { text-align: right; }
.rec-actions { display: inline-flex; gap: 4px; }

.rec-icon-btn {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent; border-radius: 7px;
  background: transparent; color: var(--text-muted, #9ca3af);
  cursor: pointer; text-decoration: none;
  transition: background-color .12s ease, color .12s ease, border-color .12s ease;
}
.rec-icon-btn:hover {
  background: var(--bg-secondary, #f3f4f6);
  border-color: var(--border, #e5e7eb);
  color: var(--text-primary, #111827);
}
.rec-icon-btn.danger:hover { background: #fee2e2; border-color: #fecaca; color: #dc2626; }
.rec-icon-btn:focus-visible { outline: 2px solid var(--accent, #22c55e); outline-offset: 1px; }
.rec-icon-btn:disabled { opacity: .5; cursor: progress; }

/* Unfolding rows: no top border, so they read as part of the row above. */
.rec-transcript-row td,
.rec-player-row td { border-bottom: 1px solid var(--border, #f3f4f6); padding-top: 0; }
.rec-transcript-row td { padding-bottom: 10px; }

.rec-transcript {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary, #6b7280);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rec-player audio { width: 100%; max-width: 520px; height: 34px; }
.rec-loading { font-size: 12px; color: var(--text-muted, #9ca3af); padding: 2px 0 8px; }

.rec-empty {
  padding: 56px 20px;
  text-align: center;
  color: var(--text-muted, #9ca3af);
  font-size: 13px;
}
.rec-empty p { margin: 0 0 4px; font-weight: 600; }
.rec-empty-hint { font-weight: 400 !important; font-size: 12px; }

.rec-footer {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  padding: 12px 18px;
  border-top: 1px solid var(--border, #f3f4f6);
  font-size: 12px; color: var(--text-muted, #9ca3af);
}
.rec-pager { display: flex; gap: 8px; }
.rec-pager .btn { padding: 5px 12px; font-size: 12px; }
.rec-pager .btn:disabled { opacity: .45; cursor: not-allowed; }

@media (max-width: 720px) {
  .rec-layout { padding: 16px 14px 72px; }
  .rec-count { margin-left: 0; }
  /* The table scrolls sideways rather than reflowing: these columns only
     make sense read across. */
  .rec-table { min-width: 760px; }
}
