/*
 * CRM V1.2 — Job Settings pages (Job Status, Job Category, Job Types, Tags,
 * Tag Notes, Default Industry, Industry Category, Industry Notes).
 *
 * Shared shell so every settings list page ships the same hero, table card,
 * action controls and Add/Edit modal treatment.
 * See docs/crm-v12-ui-guide.md and .cursor/rules/crm-v12-page-redesign.mdc
 */

.jobset-page {
  background: #f6f8fb;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.jobset-page .container-fluid {
  padding: 18px 22px 28px;
}

/* ---- Hero ---- */
.jobset-hero {
  align-items: center;
  background: #ffffff;
  border: 1px solid #e3e9f2;
  border-radius: 18px;
  box-shadow: 0 14px 34px rgba(22, 32, 51, 0.06);
  color: #111827;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 22px 24px;
}

.jobset-hero-text {
  flex: 1 1 320px;
  min-width: 0;
}

.jobset-hero-eyebrow {
  color: #2f7d20;
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .05em;
  margin-bottom: 3px;
  text-transform: uppercase;
}

.jobset-hero h1 {
  color: #111827;
  font-size: 25px;
  font-weight: 700;
  margin: 0;
}

.jobset-hero p {
  color: #667085;
  font-size: 13px;
  margin: 5px 0 0;
  max-width: 620px;
}

.jobset-hero-actions {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 10px;
}

.jobset-add-btn {
  align-items: center;
  background: #43b02a;
  border: 1px solid #43b02a;
  border-radius: 999px;
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  font-size: 14px;
  font-weight: 700;
  gap: 8px;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  text-decoration: none;
  transition: background-color .16s ease, border-color .16s ease;
  white-space: nowrap;
}

.jobset-add-btn:hover,
.jobset-add-btn:focus,
.jobset-add-btn:focus-visible,
.jobset-add-btn:active {
  background: #2f861f;
  border-color: #2f861f;
  box-shadow: none;
  color: #ffffff;
  outline: none;
  text-decoration: none;
}

.jobset-add-btn.is-secondary {
  background: #ffffff;
  border-color: #cfd9e8;
  color: #111827;
}

.jobset-add-btn.is-secondary i {
  color: #43b02a;
}

.jobset-add-btn.is-secondary:hover,
.jobset-add-btn.is-secondary:focus,
.jobset-add-btn.is-secondary:focus-visible,
.jobset-add-btn.is-secondary:active {
  background: #f8fafc;
  border-color: #cfd9e8;
  box-shadow: none;
  color: #111827;
  outline: none;
}

/* ---- Table card ---- */
.jobset-table-card {
  background: #ffffff;
  border: 1px solid #e3e9f2;
  border-radius: 18px;
  box-shadow: 0 14px 34px rgba(22, 32, 51, 0.06);
}

.jobset-table-heading {
  align-items: center;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 16px;
}

.jobset-table-heading h2 {
  color: #111827;
  font-size: 18px;
  font-weight: 700;
  margin: 0;
}

.jobset-table-heading p {
  color: #667085;
  font-size: 13px;
  margin: 3px 0 0;
}

.jobset-table-area .wepro-v12-dt-scroll-main,
.jobset-table-area .wepro-v12-dt-scroll {
  scrollbar-color: #b7c4d4 #f1f5f9;
  scrollbar-width: thin;
}

.jobset-table-area .wepro-v12-dt-scroll-main::-webkit-scrollbar,
.jobset-table-area .wepro-v12-dt-scroll::-webkit-scrollbar {
  height: 12px;
}

.jobset-table-area .wepro-v12-dt-scroll-main::-webkit-scrollbar-track,
.jobset-table-area .wepro-v12-dt-scroll::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 999px;
  margin: 0 4px;
}

.jobset-table-area .wepro-v12-dt-scroll-main::-webkit-scrollbar-thumb,
.jobset-table-area .wepro-v12-dt-scroll::-webkit-scrollbar-thumb {
  background: #b7c4d4;
  border: 3px solid #f1f5f9;
  border-radius: 999px;
  min-width: 48px;
}

.jobset-table-area .wepro-v12-dt-scroll-main::-webkit-scrollbar-thumb:hover,
.jobset-table-area .wepro-v12-dt-scroll::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.jobset-table {
  margin-bottom: 0 !important;
}

.jobset-table thead th {
  background: #f1f5f9;
  border-bottom: 1px solid #edf1f7 !important;
  color: #475569;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .03em;
  padding: 10px 12px !important;
  text-transform: uppercase;
  white-space: nowrap;
}

.jobset-table tbody td {
  border-top: 1px solid #edf1f7;
  color: #243244;
  font-size: 13px;
  padding: 13px 12px !important;
  vertical-align: middle;
  white-space: nowrap;
}

.jobset-table tbody tr:hover {
  background: #f8fbff;
}

.jobset-table .jobset-name-cell {
  color: #111827;
  font-weight: 700;
}

.jobset-table .jobset-muted-cell {
  color: #94a3b8;
}

.jobset-table .jobset-wrap-cell {
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- Row actions ---- */
.jobset-action-cell {
  white-space: nowrap;
}

.jobset-actions {
  align-items: center;
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 6px;
}

.jobset-action-btn {
  align-items: center;
  background: #eef2f6;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  color: #4b5563;
  cursor: pointer;
  display: inline-flex;
  font-size: 13px;
  font-weight: 600;
  height: 34px;
  justify-content: center;
  min-width: 34px;
  padding: 0;
  position: relative;
  text-decoration: none;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
  white-space: nowrap;
  width: 34px;
}

.jobset-action-btn > span {
  border: 0;
  clip: rect(0, 0, 0, 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.jobset-action-btn i {
  color: #4b5563;
  font-size: 13px;
  line-height: 1;
}

.jobset-action-btn.is-danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b42318;
}

.jobset-action-btn.is-danger i {
  color: #b42318;
}

.jobset-action-btn:hover,
.jobset-action-btn:focus,
.jobset-action-btn:focus-visible,
.jobset-action-btn:active {
  background: #e2e8f0;
  border-color: #cbd5e1;
  box-shadow: none;
  color: #1f2937;
  outline: none;
  text-decoration: none;
}

.jobset-action-btn:hover i,
.jobset-action-btn:focus i,
.jobset-action-btn:focus-visible i,
.jobset-action-btn:active i {
  color: #1f2937;
}

.jobset-action-btn.is-danger:hover,
.jobset-action-btn.is-danger:focus,
.jobset-action-btn.is-danger:focus-visible,
.jobset-action-btn.is-danger:active {
  background: #fee2e2;
  border-color: #fca5a5;
  box-shadow: none;
  color: #912018;
  outline: none;
}

.jobset-action-btn.is-danger:hover i,
.jobset-action-btn.is-danger:focus i,
.jobset-action-btn.is-danger:focus-visible i,
.jobset-action-btn.is-danger:active i {
  color: #912018;
}

.jobset-actions .wepro-v12-dt-actions-trigger {
  cursor: pointer;
  height: 34px;
  min-width: 34px;
  width: 34px;
}

.jobset-actions .wepro-v12-dt-actions-trigger.dropdown-toggle::after {
  display: none;
}

.jobset-actions .wepro-v12-dt-actions-trigger:focus,
.jobset-actions .wepro-v12-dt-actions-trigger:focus-visible,
.jobset-actions .wepro-v12-dt-actions-trigger:active {
  box-shadow: none;
  outline: none;
}

.jobset-action-empty {
  color: #94a3b8;
  font-size: 12px;
}

/* ---- Status pills ---- */
.jobset-pill {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 750;
  line-height: 1;
  padding: 6px 10px;
  white-space: nowrap;
}

.jobset-pill.is-active {
  background: #dcfce7;
  color: #166534;
}

.jobset-pill.is-inactive {
  background: #fee2e2;
  color: #991b1b;
}

.jobset-pill.is-default {
  background: #dbeafe;
  color: #1d4ed8;
}

.jobset-pill.is-neutral {
  background: #e2e8f0;
  color: #334155;
}

.jobset-pill.is-info {
  background: #ede9fe;
  color: #5b21b6;
}

.jobset-color-dot {
  border: 1px solid rgba(15, 23, 42, .12);
  border-radius: 999px;
  display: inline-block;
  height: 14px;
  margin-right: 8px;
  vertical-align: -2px;
  width: 14px;
}

/* ---- Drag handle (reorderable lists) ---- */
.jobset-table td.jobset-drag-cell {
  color: #64748b;
  cursor: grab;
  min-width: 72px;
  white-space: nowrap;
}

.jobset-table td.jobset-drag-cell::before {
  color: #cbd5e1;
  content: "\f58e";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  margin-right: 8px;
}

.jobset-table td.jobset-drag-cell:active {
  cursor: grabbing;
}

.jobset-table tr.dt-rowReorder-moving,
.jobset-status-reorder-table tr.is-dragging {
  background: #f0fdf4;
  outline: 2px dashed #43b02a;
  outline-offset: -2px;
}

.jobset-status-reorder-table tr.is-drag-over {
  box-shadow: inset 0 2px 0 0 #43b02a;
}

.jobset-status-reorder-table.is-searching td.jobset-drag-cell {
  cursor: default;
  opacity: 0.65;
}

.jobset-status-reorder-table .jobset-status-empty-row td {
  color: #64748b;
  padding: 28px 16px;
  text-align: center;
}

.jobset-reorder-hint {
  align-items: center;
  background: #f1f5f9;
  border-radius: 999px;
  color: #475569;
  display: inline-flex;
  font-size: 12px;
  font-weight: 600;
  gap: 6px;
  padding: 6px 12px;
}

.jobset-reorder-hint i {
  color: #43b02a;
}

/* ---- Toggle switch cells ---- */
.jobset-switch {
  cursor: pointer;
  display: inline-flex;
  margin: 0;
  position: relative;
}

.jobset-switch input {
  height: 0;
  opacity: 0;
  position: absolute;
  width: 0;
}

.jobset-switch-track {
  background: #cbd5e1;
  border-radius: 999px;
  display: inline-block;
  height: 22px;
  position: relative;
  transition: background-color .16s ease;
  width: 42px;
}

.jobset-switch-track::after {
  background: #ffffff;
  border-radius: 999px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .28);
  content: "";
  height: 18px;
  left: 2px;
  position: absolute;
  top: 2px;
  transition: transform .16s ease;
  width: 18px;
}

.jobset-switch input:checked + .jobset-switch-track {
  background: #43b02a;
}

.jobset-switch input:checked + .jobset-switch-track::after {
  transform: translateX(20px);
}

.jobset-switch input:focus + .jobset-switch-track,
.jobset-switch input:focus-visible + .jobset-switch-track {
  box-shadow: none;
  outline: none;
}

.jobset-switch.is-busy {
  opacity: .6;
  pointer-events: none;
}

/* ---- Add / Edit modal ---- */
.jobset-modal .modal-dialog {
  margin: 24px auto;
  max-width: min(80vw, 1200px);
  width: 80vw;
}

.jobset-modal .modal-content {
  border: 0;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
  max-height: calc(100vh - 48px);
  overflow: hidden;
}

.jobset-modal .modal-header {
  align-items: flex-start;
  background: #f8fafc;
  border-bottom: 1px solid #e3e9f2;
  flex: 0 0 auto;
  padding: 16px 20px;
}

.jobset-modal .modal-title {
  color: #111827;
  font-size: 20px;
  font-weight: 750;
  margin: 0;
}

.jobset-modal-subtitle {
  color: #667085;
  font-size: 12px;
  margin: 3px 0 0;
}

.jobset-modal .close {
  color: #64748b;
  text-shadow: none;
}

.jobset-modal .close:focus,
.jobset-modal .close:focus-visible,
.jobset-modal .close:hover {
  box-shadow: none;
  outline: none;
}

.jobset-modal .modal-body {
  background: #f4f7fb;
  max-height: calc(100vh - 190px);
  overflow-y: auto;
  padding: 20px;
}

.jobset-modal-section {
  background: #ffffff;
  border: 1px solid #e8edf3;
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  margin-bottom: 16px;
  padding: 18px 18px 4px;
}

.jobset-modal-section:last-child {
  margin-bottom: 0;
}

.jobset-modal-section h5 {
  color: #334155;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  margin: 0 0 4px;
  text-transform: uppercase;
}

.jobset-modal-section-hint {
  color: #94a3b8;
  font-size: 12px;
  margin: 0 0 14px;
}

.jobset-modal-section h5:last-of-type + .jobset-modal-section-hint {
  margin-bottom: 14px;
}

.jobset-modal-section h5 + .row,
.jobset-modal-section h5 + .form-group {
  margin-top: 12px;
}

.jobset-modal .form-group {
  margin-bottom: 14px;
}

.jobset-modal label {
  color: #334155;
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
}

.jobset-required {
  color: #dc2626;
  font-weight: 700;
  margin-left: 2px;
}

.jobset-modal .form-control {
  background: #ffffff;
  border: 1px solid #d9e2ef;
  border-radius: 10px;
  color: #111827;
  min-height: 40px;
}

.jobset-modal textarea.form-control {
  min-height: 96px;
}

.jobset-modal .form-control:focus,
.jobset-modal .form-control:focus-visible,
.jobset-modal .form-control:active {
  border-color: #d9e2ef;
  box-shadow: none;
  outline: none;
}

.jobset-modal .wepro-v12-search-select .wepro-v12-search-select__trigger,
.jobset-modal .wepro-v12-multi-select .wepro-v12-multi-select__trigger {
  min-height: 40px;
}

.jobset-modal .wepro-v12-search-select .wepro-v12-search-select__trigger:focus,
.jobset-modal .wepro-v12-search-select .wepro-v12-search-select__trigger:focus-visible,
.jobset-modal .wepro-v12-search-select .wepro-v12-search-select__trigger:active,
.jobset-modal .wepro-v12-search-select.is-open .wepro-v12-search-select__trigger,
.jobset-modal .wepro-v12-multi-select .wepro-v12-multi-select__trigger:focus,
.jobset-modal .wepro-v12-multi-select .wepro-v12-multi-select__trigger:focus-visible,
.jobset-modal .wepro-v12-multi-select .wepro-v12-multi-select__trigger:active,
.jobset-modal .wepro-v12-multi-select.is-open .wepro-v12-multi-select__trigger {
  border-color: #d9e2ef;
  box-shadow: none;
  outline: none;
}

.jobset-field-error {
  color: #dc2626;
  font-size: 12px;
  font-weight: 600;
  margin-top: 6px;
}

.jobset-has-error .form-control,
.jobset-has-error .wepro-v12-search-select__trigger,
.jobset-has-error .wepro-v12-multi-select__trigger,
.jobset-has-error .note-editor.note-frame {
  border-color: #fca5a5 !important;
}

.jobset-modal .note-editor.note-frame {
  border: 1px solid #d9e2ef;
  border-radius: 10px;
  margin-bottom: 0;
  overflow: hidden;
}

.jobset-modal .note-editor.note-frame .note-toolbar {
  background: #f8fafc;
  border-bottom: 1px solid #e8edf3;
}

.jobset-modal .note-editor.note-frame .note-btn:focus,
.jobset-modal .note-editor.note-frame .note-btn:focus-visible,
.jobset-modal .note-editor.note-frame .note-btn:active {
  box-shadow: none;
  outline: none;
}

/* ---- Colour picker ---- */
.jobset-color-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.jobset-color-option {
  align-items: center;
  border: 1px solid rgba(15, 23, 42, .16);
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  height: 28px;
  justify-content: center;
  padding: 0;
  transition: transform .12s ease, box-shadow .12s ease;
  width: 28px;
}

.jobset-color-option:hover {
  transform: translateY(-1px);
}

.jobset-color-option:focus,
.jobset-color-option:focus-visible,
.jobset-color-option:active {
  box-shadow: none;
  outline: none;
}

.jobset-color-option.is-selected {
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px #43b02a;
}

.jobset-color-option i {
  color: #ffffff;
  font-size: 12px;
  text-shadow: 0 1px 2px rgba(15, 23, 42, .45);
}

.jobset-color-input {
  border: 1px solid #d9e2ef;
  border-radius: 10px;
  height: 44px;
  padding: 4px;
  width: 100%;
}

.jobset-color-input:focus,
.jobset-color-input:focus-visible,
.jobset-color-input:active {
  border-color: #d9e2ef;
  box-shadow: none;
  outline: none;
}

/* ---- Live preview panel ---- */
.jobset-preview {
  align-items: center;
  background: #f8fafc;
  border: 1px dashed #d9e2ef;
  border-radius: 12px;
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
  min-height: 64px;
  padding: 14px;
}

.jobset-preview-label {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.jobset-preview-pill {
  border-radius: 999px;
  display: inline-flex;
  font-size: 13px;
  font-weight: 700;
  max-width: 100%;
  overflow: hidden;
  padding: 7px 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- Modal footer buttons ---- */
.jobset-modal .modal-footer {
  background: #f8fafc;
  border-top: 1px solid #e3e9f2;
  flex: 0 0 auto;
  gap: 10px;
  padding: 12px 20px;
}

.jobset-btn {
  align-items: center;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  display: inline-flex;
  font-size: 13px;
  font-weight: 750;
  gap: 8px;
  justify-content: center;
  min-height: 42px;
  min-width: 132px;
  padding: 10px 16px;
  white-space: nowrap;
}

.jobset-btn-primary {
  background: #43b02a !important;
  border: 1px solid #43b02a !important;
  color: #ffffff !important;
}

.jobset-btn-primary:hover,
.jobset-btn-primary:focus,
.jobset-btn-primary:focus-visible,
.jobset-btn-primary:active {
  background: #2f861f !important;
  border-color: #2f861f !important;
  box-shadow: none !important;
  color: #ffffff !important;
  outline: none !important;
}

.jobset-btn-primary:disabled {
  background: #94a3b8 !important;
  border-color: #94a3b8 !important;
  cursor: not-allowed;
}

.jobset-btn-secondary {
  background: #eef2f7 !important;
  border: 1px solid #eef2f7 !important;
  color: #1f2937 !important;
}

.jobset-btn-secondary:hover,
.jobset-btn-secondary:focus,
.jobset-btn-secondary:focus-visible,
.jobset-btn-secondary:active {
  background: #e2e8f0 !important;
  border-color: #e2e8f0 !important;
  box-shadow: none !important;
  color: #1f2937 !important;
  outline: none !important;
}

.jobset-btn-danger {
  background: #b42318 !important;
  border: 1px solid #b42318 !important;
  color: #ffffff !important;
}

.jobset-btn-danger:hover,
.jobset-btn-danger:focus,
.jobset-btn-danger:focus-visible,
.jobset-btn-danger:active {
  background: #912018 !important;
  border-color: #912018 !important;
  box-shadow: none !important;
  color: #ffffff !important;
  outline: none !important;
}

/* ---- Shared confirm dialog ---- */
.jobset-confirm .modal-dialog {
  margin: 24px auto;
  max-width: 460px;
  width: auto;
}

.jobset-confirm .modal-content {
  border: 0;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
}

.jobset-confirm .modal-header {
  align-items: flex-start;
  border-bottom: 1px solid #e3e9f2;
  padding: 16px 20px;
}

.jobset-confirm .modal-title {
  color: #111827;
  font-size: 17px;
  font-weight: 750;
  margin: 0;
}

.jobset-confirm .modal-body {
  color: #475569;
  font-size: 13px;
  padding: 18px 20px;
}

.jobset-confirm .modal-footer {
  border-top: 1px solid #e3e9f2;
  gap: 10px;
  padding: 12px 20px;
}

.jobset-confirm .close {
  color: #64748b;
  text-shadow: none;
}

.jobset-confirm .close:focus,
.jobset-confirm .close:focus-visible,
.jobset-confirm .close:hover {
  box-shadow: none;
  outline: none;
}

@media (max-width: 991px) {
  .jobset-modal .modal-dialog {
    max-width: 94vw;
    width: 94vw;
  }
}

@media (max-width: 767px) {
  .jobset-page .container-fluid {
    padding: 14px;
  }

  .jobset-hero {
    align-items: stretch;
    flex-direction: column;
    padding: 18px;
  }

  .jobset-hero-actions {
    flex-direction: column;
  }

  .jobset-add-btn {
    justify-content: center;
    width: 100%;
  }

  .jobset-modal .modal-dialog {
    margin: 10px auto;
    max-width: 96vw;
    width: 96vw;
  }

  .jobset-btn {
    flex: 1 1 auto;
    min-width: 0;
  }
}
