/* RecordsPanel — the shared "Notes & files" panel (records-panel.js).
   Notes reuse the chat-bubble look the app already has (see
   support-tickets.css's .ticket-message-*); files use the employee
   files drawer's row shape. All colors/vars come from theme.css. */

.records-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.records-panel-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.records-empty {
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 0.5rem 0;
}

/* ---- Composer (same shape as customers.css's .customer-note-composer) ---- */

.records-composer {
  margin-bottom: 0.75rem;
}

.records-composer-row {
  display: flex;
  align-items: flex-end;
  gap: 0.6rem;
}

.records-composer-row textarea {
  resize: none;
  max-height: 6.5rem;
  overflow-y: auto;
}

.records-composer-send {
  flex-shrink: 0;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 1rem;
}

/* ---- Notes list (chat bubbles, like .ticket-thread) ---- */

.records-notes-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 24rem;
  overflow-y: auto;
  padding-right: 0.15rem;
}

.records-note-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  max-width: 92%;
}

.records-note-avatar {
  flex-shrink: 0;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  margin-top: 0.1rem;
}

.records-note-bubble {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  border-top-left-radius: 4px;
  padding: 0.55rem 0.85rem;
  min-width: 0;
  flex: 1 1 auto;
  box-shadow: 0 1px 2px rgba(20, 20, 25, 0.04);
}

.records-note-row.is-pinned .records-note-bubble {
  border-color: var(--brand-primary);
}

.records-note-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.2rem;
}

.records-note-author {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--brand-primary);
}

.records-note-actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.records-note-row:hover .records-note-actions,
.records-note-row:focus-within .records-note-actions {
  opacity: 1;
}

/* Keep actions reachable on touch screens, where :hover never fires. */
@media (hover: none) {
  .records-note-actions {
    opacity: 1;
  }
}

.records-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--brand-primary);
  background: var(--brand-soft);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
}

/* Plain text, keep the author's line breaks. */
.records-note-body {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
  white-space: pre-wrap;
  color: var(--text-main);
  overflow-wrap: anywhere;
}

.records-note-meta {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.3rem;
  font-size: 0.68rem;
  color: var(--text-muted);
}

.records-note-editing textarea {
  font-size: 0.85rem;
}

/* ---- Files ---- */

.records-drop-zone {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  border: 1px dashed var(--border-color);
  border-radius: 0.65rem;
  padding: 0.7rem 0.85rem;
  margin-bottom: 0.75rem;
}

.records-drop-zone.is-drag-over {
  border-color: var(--brand-primary);
  background: var(--brand-soft);
}

.records-drop-zone-hint {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.records-files-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 22rem;
  overflow-y: auto;
  padding-right: 0.15rem;
}

.records-file-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 0.65rem;
  padding: 0.55rem 0.7rem;
}

.records-file-icon {
  flex-shrink: 0;
  font-size: 1.3rem;
  color: var(--brand-primary);
}

.records-file-info {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.records-file-name {
  font-size: 0.85rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.records-file-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.records-file-actions {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
}

.records-rename-row {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.records-rename-row input {
  min-width: 0;
}

/* ---- Phones: stack and wrap, never scroll sideways ---- */

@media (max-width: 575.98px) {
  .records-note-row {
    max-width: 100%;
  }

  .records-note-actions {
    margin-left: 0;
  }

  .records-drop-zone {
    align-items: stretch;
    flex-direction: column;
  }

  .records-file-row {
    flex-wrap: wrap;
  }

  .records-file-actions {
    width: 100%;
    justify-content: flex-end;
  }
}
