/* ════════════════════════════════════════════════════════════════════
   CALL RECORDINGS — list page redesign (Figma export, 2026-11-20).
   Own header (title + "Search with AI…" + tabs); the app topbar is hidden
   for this page in navigate() (core/utils.js). Scoped under .rc-wrap.
   ════════════════════════════════════════════════════════════════════ */

.rc-wrap {
  --rc-border: #e6e8eb;
  --rc-text: #111827;
  --rc-muted: #6b7280;
  --rc-green: #2f7d57;
  --rc-green-line: #4fa577;
  --rc-mint: #e6f3ec;
  --rc-gray: #f3f4f6;
  --rc-danger: #dc2626;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  background: #f8f9fa;
  color: var(--rc-text);
}
.rc-wrap * { box-sizing: border-box; }

/* ---------- top bar: title + search + tabs ---------- */
.rc-top {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #fff;
  border-bottom: 1px solid var(--rc-border);
}
.rc-top-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 24px;
}
.rc-app-title {
  font-size: 18px;
  line-height: 26px;
  font-weight: 700;
  color: var(--rc-text);
  white-space: nowrap;
}
.rc-search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #fff;
  border: 1px solid var(--rc-border);
  border-radius: 10px;
  transition: border-color .15s, box-shadow .15s;
}
.rc-search:focus-within { border-color: var(--rc-green-line); box-shadow: 0 0 0 3px rgba(79,165,119,.15); }
.rc-search-icon { font-size: 14px; line-height: 20px; color: var(--rc-muted); }
.rc-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 14px;
  color: var(--rc-text);
}
.rc-search input::placeholder { color: #757575; }

.rc-tabs {
  display: flex;
  gap: 4px;
  padding: 0 20px;
  overflow-x: auto;
  scrollbar-width: none;
}
.rc-tabs::-webkit-scrollbar { display: none; }
.rc-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11.5px 14px 11.8px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  font: inherit;
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  color: var(--rc-muted);
  white-space: nowrap;
  cursor: pointer;
}
.rc-tab:hover { color: var(--rc-text); }
.rc-tab.active {
  font-weight: 600;
  color: var(--rc-green);
  border-bottom-color: var(--rc-green-line);
}
.rc-tab-badge {
  padding: 1px 7px;
  border-radius: 99px;
  background: var(--rc-mint);
  color: var(--rc-green);
  font-size: 11px;
  line-height: 16px;
  font-weight: 700;
}

/* ---------- embedded Deals / Coaching tabs ---------- */
/* Deals' board fills its container (height:100%, own scrolling), so give it
   the full height under the header; Coaching is a normal padded page. */
.rc-wrap.rc-embedded { height: 100%; min-height: 0; }
.rc-wrap.rc-embedded .rc-top { position: static; }
.rc-body.rc-body-embed { max-width: none; flex: 1; min-height: 0; }
.rc-body.rc-embed-deals { padding: 0; overflow: hidden; background: #fff; }
.rc-body.rc-embed-coaching { padding: 24px; overflow-y: auto; }

/* ---------- body ---------- */
.rc-body {
  width: 100%;
  max-width: 1280px;
  padding: 24px;
}
.rc-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 18px;
}
.rc-title {
  margin: 0;
  font-size: 24px;
  line-height: 35px;
  font-weight: 700;
  color: var(--rc-text);
}
.rc-sub {
  margin: 2px 0 0;
  font-size: 14px;
  line-height: 20px;
  color: var(--rc-muted);
}
.rc-head-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.rc-pills { display: contents; }
/* "Add filter" sits at the right edge here, so open its menu leftwards —
   the shared .ct-popover opens rightwards (left:0) and ran off-screen. */
.rc-head-tools .ct-popover {
  left: auto;
  right: 0;
  max-width: calc(100vw - 32px);
}
.rc-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--rc-green);
  cursor: pointer;
}

/* ---------- stats ---------- */
.rc-stats {
  display: flex;
  gap: 12px;
}
.rc-stat {
  flex: 1;
  min-width: 0;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--rc-border);
  border-radius: 12px;
}
.rc-stat-num { font-size: 20px; line-height: 29px; font-weight: 700; color: var(--rc-text); }
.rc-stat-label { font-size: 14px; line-height: 20px; color: var(--rc-muted); }

/* ---------- grid + cards ---------- */
.rc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  padding-top: 20px;
}
.rc-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--rc-border);
  border-radius: 12px;
  cursor: pointer;
  transition: box-shadow .15s, border-color .15s;
}
.rc-card:hover { border-color: #cfd8d3; box-shadow: 0 6px 18px rgba(17,24,39,.07); }
.rc-card-uploading { cursor: default; }
.rc-card-uploading:hover { box-shadow: none; border-color: var(--rc-border); }

.rc-thumb {
  position: relative;
  height: 120px;
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  padding: 8px;
  border-radius: 10px;
  background: linear-gradient(to bottom, var(--rc-mint), var(--rc-gray));
  background-size: cover;
  background-position: center;
  overflow: hidden;
}
.rc-thumb[data-has-thumb="1"], .rc-thumb[style*="background-image"] { background-color: #0f172a; }
.rc-dur {
  padding: 1px 10px 2px;
  border-radius: 99px;
  background: var(--rc-gray);
  font-size: 12px;
  line-height: 17px;
  color: var(--rc-muted);
}
.rc-card-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity .15s;
}
.rc-card:hover .rc-card-actions, .rc-card-actions:focus-within { opacity: 1; }
.rc-card-actions .rc-icon-btn { background: rgba(255,255,255,.92); box-shadow: 0 1px 3px rgba(17,24,39,.12); }
.rc-thumb-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--rc-green);
}
.rc-thumb-state .spinner { margin: 0; }
.rc-thumb-progress {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 4px;
  background: rgba(17,24,39,.08);
}
.rc-thumb-progress > div { height: 100%; background: var(--rc-green-line); transition: width .4s ease; }

.rc-card-title {
  padding-top: 8px;
  font-size: 15px;
  line-height: 22px;
  font-weight: 700;
  color: var(--rc-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rc-card-owner {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 26px;
  font-size: 13px;
  line-height: 19px;
  color: var(--rc-muted);
}
.rc-avatar {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  background: var(--rc-mint);
  color: var(--rc-green);
  font-size: 11px;
  font-weight: 700;
}
.rc-card-meta {
  padding-top: 3px;
  font-size: 13px;
  line-height: 19px;
  color: var(--rc-muted);
}

/* ---------- shared bits ---------- */
.rc-icon-btn {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--rc-muted);
  font-size: 16px;
  cursor: pointer;
}
.rc-icon-btn:hover { background: var(--rc-gray); color: var(--rc-text); }
.rc-icon-btn.rc-danger:hover { color: var(--rc-danger); background: #fef2f2; }

.rc-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 0;
  border-radius: 10px;
  background: var(--btn-primary, #0b7a50);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.rc-btn-primary:hover { background: var(--btn-primary-hover, #096943); }
.rc-btn-sm { padding: 6px 10px; font-size: 13px; }

.rc-state {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px 0;
  color: var(--rc-muted);
  font-size: 14px;
}
.rc-state .spinner { margin: 0; }
.rc-err { color: var(--rc-danger); }

.rc-empty {
  grid-column: 1 / -1;
  padding: 48px 16px;
  text-align: center;
  background: #fff;
  border: 1px dashed var(--rc-border);
  border-radius: 12px;
}
.rc-empty-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--rc-mint);
  color: var(--rc-green);
  font-size: 20px;
}
.rc-empty h3 { margin: 0 0 4px; font-size: 16px; color: var(--rc-text); }
.rc-empty p { margin: 0; font-size: 14px; color: var(--rc-muted); }

/* ---------- upload banner ---------- */
#rec-upload-banner { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.rc-upload {
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--rc-green-line);
  border-radius: 12px;
}
.rc-upload-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.rc-upload-title { font-size: 14px; font-weight: 700; }
.rc-upload-pct { font-size: 12px; font-weight: 600; color: var(--rc-green); }
.rc-upload-track { height: 6px; background: var(--rc-gray); border-radius: 99px; overflow: hidden; }
.rc-upload-fill { height: 100%; background: var(--rc-green-line); border-radius: 99px; transition: width .4s ease; }
.rc-upload-label { margin-top: 8px; font-size: 12px; color: var(--rc-muted); }

/* ---------- AI answer ---------- */
.rc-ask {
  margin-bottom: 16px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--rc-border);
  border-left: 3px solid var(--rc-green-line);
  border-radius: 12px;
}
.rc-ask-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.rc-ask-q { font-size: 14px; font-weight: 600; color: var(--rc-text); }
.rc-ask-a { margin-top: 8px; font-size: 14px; line-height: 21px; color: var(--rc-text); white-space: pre-wrap; }
.rc-ask-meta { margin-top: 8px; font-size: 12px; color: var(--rc-muted); }
.rc-ask-err { margin-top: 8px; font-size: 14px; color: var(--rc-danger); }
.rc-cites { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.rc-cite {
  font-size: 13px;
  color: var(--rc-green);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rc-cite:hover { text-decoration: underline; }

/* ---------- list rows (folders / playlists / trackers / alerts) ---------- */
.rc-list {
  background: #fff;
  border: 1px solid var(--rc-border);
  border-radius: 12px;
  overflow: hidden;
}
.rc-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--rc-border);
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
.rc-row:last-child { border-bottom: 0; }
.rc-row:hover { background: #fafbfb; }
.rc-row-static { cursor: default; }
.rc-row-icon {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--rc-mint);
  color: var(--rc-green);
  font-size: 18px;
}
.rc-row-main { flex: 1; min-width: 0; }
.rc-row-title { font-size: 14px; font-weight: 600; color: var(--rc-text); }
.rc-row-sub { margin-top: 2px; font-size: 12.5px; color: var(--rc-muted); }
.rc-row-quote { margin-top: 4px; font-size: 13px; color: var(--rc-text); }
.rc-empty-line { padding: 28px 16px; text-align: center; font-size: 14px; color: var(--rc-muted); }
.rc-chip {
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 99px;
  background: var(--rc-gray);
  color: var(--rc-muted);
  font-size: 11px;
  font-weight: 600;
}

/* ---------- forms ---------- */
.rc-inline-form { display: flex; gap: 8px; margin-bottom: 12px; }
.rc-input {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  border: 1px solid var(--rc-border);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  font-size: 14px;
  color: var(--rc-text);
  outline: 0;
}
.rc-input:focus { border-color: var(--rc-green-line); box-shadow: 0 0 0 3px rgba(79,165,119,.15); }
.rc-panel {
  margin-bottom: 16px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--rc-border);
  border-radius: 12px;
}
.rc-panel-title { margin: 0 0 12px; font-size: 15px; font-weight: 700; }
.rc-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.rc-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--rc-muted); }
.rc-field .rc-input { width: 100%; }
.rc-checks { display: flex; flex-wrap: wrap; gap: 16px; margin: 14px 0; font-size: 14px; }

@media (max-width: 720px) {
  .rc-top-row { flex-wrap: wrap; padding: 12px 16px; }
  .rc-search { flex-basis: 100%; }
  .rc-tabs { padding: 0 8px; }
  .rc-body { padding: 16px; }
  .rc-stats { flex-direction: column; }
}
