table thead th {
  padding-top: 0.55rem !important;
  padding-bottom: 0.55rem !important;
}

table tbody td {
  padding-top: 0.5rem !important;
  padding-bottom: 0.5rem !important;
}

.workspace-filter-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

.workspace-filter-field {
  min-width: 0;
}

.workspace-filter-row--dense {
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  align-items: end;
}

.workspace-date-input {
  box-sizing: border-box;
  height: 2.125rem;
  min-height: 2.125rem;
  max-height: 2.125rem;
  font-size: 0.75rem;
  line-height: 1rem;
  padding-top: 0;
  padding-bottom: 0;
}

.workspace-filter-row--dense input,
.workspace-filter-row--dense select,
.workspace-filter-row--dense button,
.workspace-filter-row--dense .custom-select__trigger {
  min-height: 2.125rem;
}

.workspace-action-cell {
  width: 1%;
  white-space: nowrap;
}

.workspace-action-row {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.375rem;
  white-space: nowrap;
}

@media (min-width: 900px) {
  .workspace-filter-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: end;
  }

  .workspace-filter-row.workspace-filter-row--dense {
    grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  }
}

.job-status-select-field {
  min-width: 7.5rem;
  max-width: 8.25rem;
}

.jd-ai-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.jd-ai-modal.hidden {
  display: none;
}

.jd-ai-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.18);
}

.jd-ai-dialog {
  position: relative;
  z-index: 1;
  width: min(46rem, calc(100vw - 2rem));
  max-height: min(42rem, calc(100vh - 2rem));
  overflow: auto;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  box-shadow: 0 22px 52px rgba(15, 23, 42, 0.16);
}

.jd-ai-dialog--compact {
  width: min(34rem, calc(100vw - 2rem));
}

.jd-ai-dialog__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid #e2e8f0;
  padding: 0.9rem 1rem;
}

.jd-ai-dialog__header h2 {
  color: #020617;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.25rem;
}

.jd-ai-dialog__header p {
  margin-top: 0.2rem;
  color: #475569;
  font-size: 0.72rem;
  line-height: 1.15rem;
}

.jd-ai-icon-button {
  display: inline-flex;
  height: 1.9rem;
  width: 1.9rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  color: #475569;
}

.jd-ai-icon-button:hover {
  color: #020617;
  background: #f8fafc;
}

.jd-ai-dialog__body {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
}

.jd-ai-grid {
  display: grid;
  gap: 0.75rem;
}

.jd-ai-grid--two,
.jd-ai-grid--three {
  grid-template-columns: minmax(0, 1fr);
}

.jd-ai-dialog label {
  display: grid;
  min-width: 0;
  gap: 0.35rem;
}

.jd-ai-dialog label span {
  color: #334155;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1rem;
}

.jd-ai-dialog label strong {
  color: #dc2626;
}

.jd-ai-dialog input,
.jd-ai-dialog textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  padding: 0.45rem 0.6rem;
  color: #0f172a;
  font-size: 0.75rem;
  line-height: 1.1rem;
  outline: none;
}

.jd-ai-dialog input:focus,
.jd-ai-dialog textarea:focus {
  border-color: #64748b;
}

.jd-ai-dialog textarea {
  resize: vertical;
}

.jd-ai-fixed-textarea {
  min-height: 13rem;
  max-height: 13rem;
  overflow: auto;
  resize: none !important;
}

.jd-ai-dialog__footer {
  display: grid;
  gap: 0.75rem;
  align-items: end;
}

.jd-ai-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.jd-ai-primary-button,
.jd-ai-secondary-button {
  display: inline-flex;
  min-height: 2rem;
  align-items: center;
  justify-content: center;
  border: 1px solid #020617;
  padding: 0.45rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1rem;
}

.jd-ai-primary-button {
  background: #020617;
  color: #ffffff;
}

.jd-ai-primary-button:hover {
  background: #1e293b;
}

.jd-ai-secondary-button {
  border-color: #cbd5e1;
  background: #ffffff;
  color: #334155;
}

.jd-ai-secondary-button:hover {
  border-color: #94a3b8;
  color: #020617;
}

.jd-review-skeleton {
  margin-top: 1.25rem;
  border: 1px solid #dbeafe;
  background: #ffffff;
  padding: 1rem;
}

/* ------------------------------------------------- Add Candidate intake */

/* The numbered step badge that labels each of the two ways in. */
.intake-method-head {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.intake-step {
  display: inline-flex;
  height: 1.75rem;
  width: 1.75rem;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
}

/* "or" between the two methods: they are alternatives, not a sequence, and
   without this the second card reads as step two of one flow. */
.intake-divider {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.intake-divider::before,
.intake-divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid #e2e8f0;
}

/* Echoes back the JD that was picked, so "which job is this going into?" is
   answered without scrolling back up. */
.intake-scope-summary {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.3rem;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  padding: 0.85rem 1rem;
  font-size: 0.8rem;
  color: #334155;
}

.intake-scope-summary__title {
  font-weight: 700;
  color: #0f172a;
}

.intake-scope-summary__meta {
  color: #64748b;
}

.intake-more {
  border: 1px solid #e2e8f0;
}

.intake-more__toggle {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: #f8fafc;
  padding: 0.75rem 1rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
}

.intake-more__toggle:hover {
  color: #0f172a;
}

.intake-more__chevron {
  flex: 0 0 auto;
  color: #64748b;
  transition: transform 0.15s ease;
}

.intake-more__toggle[aria-expanded="true"] .intake-more__chevron {
  transform: rotate(180deg);
}

.intake-more__body {
  border-top: 1px solid #e2e8f0;
  padding: 1rem;
}

.resume-upload-scroll {
  max-height: 18rem;
  overflow-y: auto;
  padding-right: 0.2rem;
}

.resume-upload-scroll > * + * {
  margin-top: 0.5rem;
}

.resume-file-chip {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  padding: 0.45rem 0.55rem;
  font-size: 0.72rem;
  line-height: 1rem;
  color: #334155;
}

.resume-file-chip__name {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
  color: #0f172a;
}

.resume-file-chip__size {
  flex: 0 0 auto;
  color: #64748b;
}

.resume-file-chip__remove {
  display: inline-flex;
  height: 1.35rem;
  width: 1.35rem;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 1px solid #e2e8f0;
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 700;
}

.resume-file-chip__remove:hover {
  border-color: #cbd5e1;
  color: #be123c;
}

.jd-review-skeleton__header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 1rem;
}

.jd-review-skeleton__grid {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.jd-review-skeleton__grid--two,
.jd-review-skeleton__grid--three {
  grid-template-columns: minmax(0, 1fr);
}

.jd-skeleton-bar,
.jd-skeleton-button,
.jd-skeleton-field,
.jd-skeleton-textarea,
.jd-skeleton-list {
  position: relative;
  overflow: hidden;
  background: #e0f2fe;
}

.jd-skeleton-bar::after,
.jd-skeleton-button::after,
.jd-skeleton-field::after,
.jd-skeleton-textarea::after,
.jd-skeleton-list::after {
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.78), transparent);
  animation: jd-skeleton-shimmer 1.15s infinite;
  content: "";
}

.jd-skeleton-bar--title {
  height: 1rem;
  width: 11rem;
}

.jd-skeleton-bar--copy {
  height: 0.72rem;
  width: 18rem;
  max-width: 72vw;
  margin-top: 0.65rem;
  background: #eff6ff;
}

.jd-skeleton-button {
  height: 2.4rem;
  width: 6.5rem;
  background: #dbeafe;
}

.jd-skeleton-field {
  height: 4.4rem;
}

.jd-skeleton-field::before,
.jd-skeleton-textarea::before,
.jd-skeleton-list::before {
  position: absolute;
  left: 0.75rem;
  top: 0.65rem;
  width: 5.5rem;
  height: 0.65rem;
  background: #bfdbfe;
  content: "";
}

.jd-skeleton-field::after {
  top: 1.8rem;
}

.jd-skeleton-textarea {
  height: 9rem;
  background: #eff6ff;
}

.jd-skeleton-list {
  height: 7rem;
  background: #eff6ff;
}

@keyframes jd-skeleton-shimmer {
  100% {
    transform: translateX(100%);
  }
}

@media (min-width: 768px) {
  .jd-ai-grid--two,
  .jd-ai-dialog__footer,
  .jd-review-skeleton__grid--two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .jd-ai-grid--three,
  .jd-review-skeleton__grid--three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.custom-select__trigger {
  min-height: 2.75rem;
}

/*
  The open dropdown's stacking order. common.js gives the menu Tailwind's
  `z-[60]`, but workspace.css is a purged build made before that class existed,
  so the menu had no z-index at all: the select in the next form row (positioned,
  and later in the page) painted over the open list. Declared here, where the
  purge cannot drop it.
*/
.custom-select__menu {
  z-index: 60;
}

/*
  The organisation's credits in the header (partials/header.html,
  credit-badge.js). Neutral with a blue wallet while there is enough; amber
  below the rate card's low-balance mark; red at zero. Colours are here, not in
  Tailwind classes, because the state arrives at run time as data-credit-state.
*/
.credit-badge {
  border-color: #e2e8f0;
  background: #ffffff;
  color: #0f172a;
}

.credit-badge:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.credit-badge > svg {
  color: #2563eb;
}

.credit-badge[data-credit-state="low"] {
  border-color: #fcd34d;
  background: #fffbeb;
  color: #92400e;
}

.credit-badge[data-credit-state="low"] > svg {
  color: #d97706;
}

.credit-badge[data-credit-state="empty"] {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #991b1b;
}

.credit-badge[data-credit-state="empty"] > svg {
  color: #dc2626;
}

/*
  A searchable select, open: the search box covers the closed control exactly
  (common.js enhanceSelect), so the search is typed where the choice is shown.
  The magnifier is an inline SVG, not a fetched icon.
*/
.custom-select__search {
  position: absolute;
  inset: 0;
  z-index: 1;
  /* An input does not stretch to its insets the way a div does. */
  width: 100%;
  height: 100%;
  border: 1px solid #94a3b8;
  background: #ffffff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 0.9rem center / 1rem 1rem;
  padding: 0 1rem 0 2.5rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: #020617;
  outline: none;
}

.custom-select__search::placeholder {
  color: #94a3b8;
}

.custom-select--compact .custom-select__search {
  padding: 0 0.625rem 0 1.9rem;
  background-position: 0.6rem center;
  background-size: 0.8rem 0.8rem;
  font-size: 0.75rem;
}

.custom-select--compact .custom-select__trigger {
  min-height: 2rem;
  padding: 0.375rem 0.625rem;
  font-size: 0.75rem;
  line-height: 1rem;
}

.custom-select--compact .custom-select__trigger .ml-3 {
  margin-left: 0.5rem;
}

.custom-select--compact .custom-select__trigger svg {
  width: 0.875rem;
  height: 0.875rem;
}

.custom-select--compact .custom-select__list {
  padding-top: 0.2rem;
  padding-bottom: 0.2rem;
}

.custom-select--compact .custom-select__option {
  padding: 0.375rem 0.625rem;
  font-size: 0.75rem;
  line-height: 1rem;
}

.custom-select--compact .custom-select__option .ml-3 {
  margin-left: 0.5rem;
}

.custom-select--compact .custom-select__option svg {
  width: 0.75rem;
  height: 0.75rem;
}

.custom-select--status-theme[data-selected-value="open"] .custom-select__trigger {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.custom-select--status-theme[data-selected-value="hold"] .custom-select__trigger {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.custom-select--status-theme[data-selected-value="closed"] .custom-select__trigger {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.custom-select--status-theme[data-selected-value="open"] .custom-select__trigger-icon,
.custom-select--status-theme[data-selected-value="hold"] .custom-select__trigger-icon,
.custom-select--status-theme[data-selected-value="closed"] .custom-select__trigger-icon {
  color: inherit;
}

.custom-select--status-theme .custom-select__option[data-option-value="open"] {
  color: #166534;
}

.custom-select--status-theme .custom-select__option[data-option-value="open"]:hover,
.custom-select--status-theme .custom-select__option[data-option-value="open"][aria-selected="true"] {
  background: #f0fdf4;
}

.custom-select--status-theme .custom-select__option[data-option-value="hold"] {
  color: #1d4ed8;
}

.custom-select--status-theme .custom-select__option[data-option-value="hold"]:hover,
.custom-select--status-theme .custom-select__option[data-option-value="hold"][aria-selected="true"] {
  background: #eff6ff;
}

.custom-select--status-theme .custom-select__option[data-option-value="closed"] {
  color: #b91c1c;
}

.custom-select--status-theme .custom-select__option[data-option-value="closed"]:hover,
.custom-select--status-theme .custom-select__option[data-option-value="closed"][aria-selected="true"] {
  background: #fef2f2;
}

.company-recruiter-card {
  overflow: hidden;
}

.company-recruiter-toggle-icon {
  transition: transform 0.15s ease;
}

.company-recruiter-toggle[aria-expanded="true"] .company-recruiter-toggle-icon {
  transform: rotate(180deg);
}

/* Soft rounded corners across the workspace UI.
   Tailwind boxes here always carry the standalone `border` (or `border-2`)
   utility, so these selectors cover cards, metric boxes, sidebar menu links,
   tables wrappers, inputs, buttons, modals, badges, and flash toasts. */
[class~="border"],
[class~="border-2"] {
  border-radius: 0.375rem;
}

/* Keep table header backgrounds from poking square corners out of rounded cards. */
table thead tr:first-child th:first-child {
  border-top-left-radius: calc(0.375rem - 1px);
}

table thead tr:first-child th:last-child {
  border-top-right-radius: calc(0.375rem - 1px);
}

/* Custom components in this file draw their own borders, so round them too. */
.jd-ai-dialog,
.jd-ai-icon-button,
.jd-ai-primary-button,
.jd-ai-secondary-button,
.jd-ai-dialog input,
.jd-ai-dialog textarea,
.jd-review-skeleton,
.resume-file-chip,
.resume-file-chip__remove,
.jd-skeleton-bar,
.jd-skeleton-button,
.jd-skeleton-field,
.jd-skeleton-textarea,
.jd-skeleton-list {
  border-radius: 0.375rem;
}
