/* Planned Actions table + Close Task form.
 *
 * These rules are what survived `job_search_planning.css` when the Job Search
 * Planning screen was retired (#1748). They are NOT planner chrome: the table
 * they lay out is still rendered by `/contact_people/:id` and
 * `/contact_companies/:id`, and every one of these selectors was defined
 * nowhere else in the app — deleting the file wholesale would have left both
 * contact pages as unstyled div soup.
 *
 * Moved verbatim, raw hex and all. Tokenising them to `--bp-*` would change how
 * a live screen looks, which is a redesign of the contact pages rather than the
 * teardown this was. That tokenisation is still owed (#1745).
 *
 * Gone with the screen: the page's flex shell, its bespoke success toast, the
 * sticky filter control, `#action-details-section`, the sortable-header and
 * sort-indicator rules (the headers are plain cells now — they used to link to
 * the retired screen's own action), and a duplicate `.form-actions` that
 * `components.css` and `timeline-cards.css` already define.
 */

/* Table container and scrolling */
.table-container {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.table-wrapper {
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Fixed table header */
.table-header {
  width: 100%;
  background-color: #f5f5f5;
  border-bottom: 2px solid #ddd;
  flex-shrink: 0;
  display: block;
  padding-right: 8px;
}

.table-header-row {
  display: grid;
  grid-template-columns: 15% 12% 13% 13% 10% 10% 27%;
  width: calc(100% - 8px);
  gap: 0;
}

.table-header-cell {
  box-sizing: border-box;
  padding: 0.75rem;
  text-align: left;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-header-cell.actions {
  text-align: center;
}

/* Scrollable table body */
.table-body {
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
}

.table-row {
  display: grid;
  grid-template-columns: 15% 12% 13% 13% 10% 10% 27%;
  width: 100%;
  gap: 0;
  border-bottom: 1px solid #eee;
  transition: background-color 0.2s ease;
}

.table-row:hover {
  background-color: #fafafa;
}

.table-cell {
  box-sizing: border-box;
  padding: 0.75rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  align-items: center;
}

.table-cell.outcome {
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
  align-items: flex-start;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.table-cell.actions {
  text-align: center;
  justify-content: center;
  display: flex;
  gap: 0.5rem;
  overflow: visible;
  white-space: normal;
}

/* Status badge styling */
.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 0.25rem;
  font-weight: 500;
  white-space: nowrap;
}

.status-badge.done {
  background-color: #d4edda;
  color: #155724;
}

.status-badge.pending {
  background-color: #fff3cd;
  color: #856404;
}

/* Empty state */
.table-empty-state {
  padding: 2rem;
  text-align: center;
  color: #999;
}

.table-empty-state p {
  margin: 0 0 1rem 0;
}

/* Muted text for missing values */
.text-muted-placeholder {
  color: #999;
}

/* Close Task form ---------------------------------------------------------- */

.action-details-form {
  background: #f9f9f9;
  padding: 1.5rem;
  border-radius: 0.375rem;
  border: 1px solid var(--border);
}

/* Multi-actions input table — the optional follow-up rows on the close form */
.multi-actions-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  overflow: hidden;
  background: white;
}

.multi-actions-table thead {
  background-color: #f5f5f5;
  border-bottom: 2px solid #ddd;
}

.multi-actions-table th {
  padding: 0.75rem;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid #ddd;
}

.multi-actions-table tr {
  border-bottom: 1px solid #eee;
  transition: background-color 0.2s ease;
}

.multi-actions-table tbody tr:hover {
  background-color: #fafafa;
}

.multi-actions-table td {
  padding: 0.75rem;
  box-sizing: border-box;
}

.multi-actions-table input:not([type="radio"]),
.multi-actions-table select {
  width: 100%;
  min-width: 0;
}

.multi-actions-table .action-types-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.multi-actions-table .action-types-container label {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  white-space: nowrap;
  font-size: 0.875rem;
}

.btn-remove-row {
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 0.25rem;
  width: 2rem;
  height: 2rem;
  padding: 0;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}

.btn-remove-row:hover {
  background-color: #c82333;
}

/* Form options layout - for radio buttons, checkboxes, and similar grouped options */
.form-options-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Individual form option label - aligns radio/checkbox with text */
.form-option-label {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Form section divider with spacing */
.we-form-divider {
  margin-top: 2rem;
}
