/* FM Group CRM - visual refresh (loaded after the theme so it overrides it) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
:root {
  --fm-navy: #282E77;
  --fm-navy-dark: #1d2260;
  --fm-lime: #BFD645;
  --fm-lime-dark: #a9bf33;
  --fm-bg: #F4F6FB;
  --fm-card: #FFFFFF;
  --fm-border: #E4E7F0;
  --fm-text: #1F2433;
  --fm-muted: #6B7185;
  --fm-row-hover: #F6F8FF;
  --fm-radius: 14px;
}
html body, html body .kt-header, html body .kt-portlet, html body .btn, html body input, html body select, html body textarea, html body table {
  font-family: 'Inter', 'Poppins', Helvetica, sans-serif;
}
html body { background: var(--fm-bg); color: var(--fm-text); }

/* Header */
html body .kt-header { box-shadow: 0 1px 0 var(--fm-border); }
html body .kt-header-menu .kt-menu__item > .kt-menu__link { border-radius: 10px; transition: background .15s; }
html body .kt-header-menu .kt-menu__item > .kt-menu__link:hover,
html body .kt-header-menu .kt-menu__item.kt-menu__item--here > .kt-menu__link,
html body .kt-header-menu .kt-menu__item.kt-menu__item--active > .kt-menu__link { background: #EEF0FA; }

/* Cards */
html body .kt-portlet {
  border: 1px solid var(--fm-border) !important;
  border-radius: var(--fm-radius) !important;
  box-shadow: 0 1px 2px rgba(20, 24, 60, .04), 0 8px 24px rgba(20, 24, 60, .05) !important;
  background: var(--fm-card);
}
html body .kt-portlet .kt-portlet__head { border-bottom: 1px solid var(--fm-border) !important; min-height: 64px; }
html body .kt-portlet .kt-portlet__head-title { font-size: 17px; font-weight: 700; color: var(--fm-navy); letter-spacing: -.01em; }

/* Filters */
html body .kt-portlet__head-toolbar .form-control,
html body .kt-portlet__head-toolbar select,
html body .kt-portlet__head-toolbar input,
html body .select2-container--default .select2-selection--single {
  border: 1px solid #D9DDEA !important;
  border-radius: 10px !important;
  min-height: 38px;
  background-color: #fff;
  font-size: 13px;
}
html body .form-control:focus, html body select:focus, html body input:focus, html body textarea:focus {
  border-color: var(--fm-navy) !important;
  box-shadow: 0 0 0 3px rgba(40, 46, 119, .12) !important;
}
html body .filter-label { color: var(--fm-muted); font-weight: 600; font-size: 12px; }

/* Count boxes */
html body .stages-container { gap: 10px !important; }
html body .stage-chip {
  background: #fff !important;
  border: 1px solid var(--fm-border) !important;
  border-radius: 12px !important;
  padding: 10px 16px !important;
  min-width: 112px;
  text-align: left !important;
  box-shadow: 0 1px 2px rgba(20, 24, 60, .04) !important;
  transition: transform .12s, box-shadow .12s, border-color .12s;
}
html body .stage-chip h6 { font-size: 11.5px !important; font-weight: 600 !important; color: var(--fm-muted) !important; margin: 0 0 2px !important; text-transform: none; }
html body .stage-chip p { font-size: 18px !important; font-weight: 700 !important; color: var(--fm-navy) !important; margin: 0 !important; }
html body .stage-chip.companyFilter:hover, html body .stage-chip.stageFilter:hover,
html body .stage-chip.assignFilter:hover, html body .stage-chip.totalFilter:hover {
  transform: translateY(-1px); box-shadow: 0 6px 16px rgba(20, 24, 60, .08) !important; border-color: #C9CEE3 !important; cursor: pointer;
}
html body .stage-chip.fm-active { border-color: var(--fm-navy) !important; box-shadow: 0 0 0 2px rgba(40, 46, 119, .15) !important; }
html body .stage-chip.fm-active h6 { color: var(--fm-navy) !important; }

/* Tables */
html body table.dataTable { border-collapse: separate !important; border-spacing: 0; }
html body table.dataTable thead th, html body table.table thead th {
  background: #F1F3FA !important;
  color: var(--fm-navy) !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  letter-spacing: .04em;
  border: 0 !important;
  border-bottom: 1px solid var(--fm-border) !important;
  padding: 12px 10px !important;
  white-space: nowrap;
  position: sticky; top: 0; z-index: 2;
}
html body table.dataTable thead th:first-child { border-top-left-radius: 10px; }
html body table.dataTable thead th:last-child { border-top-right-radius: 10px; }
html body table.dataTable tbody td {
  font-size: 13px !important;
  color: var(--fm-text) !important;
  padding: 9px 10px !important;
  vertical-align: middle !important;
  border-top: 0 !important;
  border-bottom: 1px solid #EEF0F6 !important;
  background: #fff;
}
html body table.dataTable tbody tr:hover td { background: var(--fm-row-hover) !important; }
html body table.dataTable tbody td:nth-child(2) { font-weight: 600; }
html body .dataTables_wrapper .dataTables_info { color: var(--fm-muted); font-size: 12.5px; }
html body .dataTables_wrapper .dataTables_filter input, html body .dataTables_wrapper .dataTables_length select {
  border: 1px solid #D9DDEA !important; border-radius: 10px !important; height: 36px; padding: 0 10px;
}
html body .dataTables_wrapper .paginate_button, html body .dataTables_wrapper .page-link {
  border-radius: 8px !important; margin: 0 2px; border: 1px solid transparent !important; color: var(--fm-text) !important;
}
html body .dataTables_wrapper .paginate_button.current, html body .dataTables_wrapper .page-item.active .page-link {
  background: var(--fm-navy) !important; color: #fff !important; border-color: var(--fm-navy) !important;
}

/* Links in rows */
html body table.dataTable a[href^="mailto:"], html body table.dataTable .copy-email { color: #3B4AB8 !important; text-decoration: none !important; }
html body a.fm-tel { color: var(--fm-text) !important; font-weight: 500; text-decoration: none !important; white-space: nowrap; }
html body a.fm-tel:before { content: "\260E"; margin-right: 5px; color: #2E9E5B; font-size: 12px; }
html body a.fm-tel:hover { color: var(--fm-navy) !important; text-decoration: underline !important; }

/* Stage dropdown inside the table */
html body .stage-dropdown-container select, html body select.status-dropdown {
  border-radius: 999px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  padding: 4px 26px 4px 12px !important;
  height: 30px !important;
  min-width: 130px;
  border-width: 0 !important;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06);
  cursor: pointer;
}

/* Buttons */
html body .btn { border-radius: 9px !important; font-weight: 600; transition: background .15s, box-shadow .15s; }
html body .btn-sm { font-size: 12px !important; padding: 5px 10px !important; }
html body .btn-primary { background: var(--fm-lime) !important; border-color: var(--fm-lime) !important; color: #1F2433 !important; }
html body .btn-primary:hover { background: var(--fm-lime-dark) !important; border-color: var(--fm-lime-dark) !important; }
html body .btn-edit, html body .btn-info { background: var(--fm-navy) !important; border-color: var(--fm-navy) !important; color: #fff !important; }
html body .btn-edit:hover { background: var(--fm-navy-dark) !important; }
html body .btn-secondary { background: #fff !important; border: 1px solid #D9DDEA !important; color: var(--fm-text) !important; }
html body .btn-secondary:hover { background: #F3F4FA !important; }
html body .btn-danger { background: #fff !important; border: 1px solid #F1C3C3 !important; color: #C93C3C !important; }
html body .btn-danger:hover { background: #FDF1F1 !important; }
html body .btn-group > .btn { margin-right: 4px; border-radius: 8px !important; }

/* Modals */
html body .modal-content { border-radius: 16px; border: 0; box-shadow: 0 24px 60px rgba(20, 24, 60, .2); }
html body .modal-header { border-bottom: 1px solid var(--fm-border); }
html body .modal-title { font-weight: 700; color: var(--fm-navy); }
html body label { color: #3A4054; font-weight: 500; }

/* Badges */
html body .repeat-applicant { box-shadow: 0 0 0 2px #fff; }
html body .custom-toast { border-radius: 12px; box-shadow: 0 12px 30px rgba(20, 24, 60, .18); }

/* Phones and small screens */
@media (max-width: 991px) {
  html body .stage-chip { min-width: 96px; padding: 8px 12px !important; }
  html body .stage-chip p { font-size: 16px !important; }
  html body .kt-portlet__head { flex-wrap: wrap; gap: 8px; padding-top: 10px; padding-bottom: 10px; }
  html body .kt-portlet__head-toolbar, html body .kt-portlet__head-actions, html body .filter-container { width: 100%; flex-wrap: wrap; }
  html body .dataTables_wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}


/* ---------- v2 polish ---------- */
html body .kt-portlet .kt-portlet__head-title { font-size: 20px !important; font-weight: 700 !important; }
html body .kt-portlet .kt-portlet__body { padding-top: 18px; }

/* Impersonation banner: soft amber pill instead of a black box */
html body .alert.alert-primary.mb-0 {
  background: #FFF6E0 !important; color: #7A5300 !important; border: 1px solid #F3DFA6 !important;
  border-radius: 999px !important; padding: 7px 18px !important; font-size: 12.5px; font-weight: 500;
  box-shadow: 0 4px 14px rgba(122, 83, 0, .08);
}
html body .alert.alert-primary.mb-0 a { color: #7A5300 !important; font-weight: 700; }

/* Count boxes: number big, word small, stage colour dot */
html body .stage-chip p .fm-n { font-size: 20px; font-weight: 700; color: var(--fm-navy); letter-spacing: -.02em; }
html body .stage-chip p .fm-u { font-size: 11px; font-weight: 500; color: var(--fm-muted); margin-left: 4px; }
html body .stage-chip.stageFilter h6:before {
  content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--fm-chip-color, #C9CEE3); margin-right: 6px; vertical-align: 1px;
}
html body .stage-chip.fm-zero { opacity: .55; }
html body .stages-container + .stages-container, html body .stages-container { margin-bottom: 6px; }

/* "Show N entries" on one line */
html body .dataTables_length label { display: inline-flex !important; align-items: center; gap: 8px; color: var(--fm-muted); font-size: 12.5px; margin: 0; white-space: nowrap; }
html body .dataTables_length select { width: auto !important; min-width: 70px; display: inline-block !important; }
html body .dataTables_filter label { display: inline-flex !important; align-items: center; gap: 8px; color: var(--fm-muted); font-size: 12.5px; }
html body .dataTables_filter input { min-width: 220px; margin-left: 0 !important; }

/* Action buttons: lighter */
html body table.dataTable .btn-group .btn-primary { background: #F2F7DA !important; border-color: #E2ECB0 !important; color: #4D5A12 !important; }
html body table.dataTable .btn-group .btn-primary:hover { background: #E8F1C2 !important; }
html body table.dataTable .btn-group .btn { box-shadow: none !important; }

/* Stage pill (colours applied by fm-ui.js) */
html body select.status-dropdown.fm-tinted {
  background-repeat: no-repeat !important;
  padding-left: 24px !important;
  font-weight: 600 !important;
}

/* Dates */
html body .fm-date { white-space: nowrap; font-weight: 500; }
html body .fm-time { display: block; font-size: 11px; color: var(--fm-muted); font-weight: 400; margin-top: 1px; }

/* Emails a bit calmer */
html body table.dataTable a[href^="mailto:"], html body table.dataTable .copy-email { color: #4250B5 !important; font-weight: 500; }

/* Footer */
html body .kt-footer { background: transparent !important; color: var(--fm-muted); }


/* ---------- v5: duplicate-applicant popup ---------- */
html body .repeat-applicant { cursor: pointer !important; }
.fm-dup-pop {
  position: absolute; z-index: 10000; background: #fff; border: 1px solid #E4E7F0; border-radius: 14px;
  box-shadow: 0 18px 50px rgba(20, 24, 60, .18), 0 2px 6px rgba(20, 24, 60, .06);
  padding: 0; opacity: 0; transform: translateY(4px); pointer-events: none; transition: opacity .14s, transform .14s;
  font-family: 'Inter', 'Poppins', Helvetica, sans-serif; color: #1F2433; overflow: hidden;
}
.fm-dup-pop.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.fm-dup-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: linear-gradient(135deg, #FFF4EA, #FFFFFF); border-bottom: 1px solid #F1E3D6; }
.fm-dup-count { flex: none; width: 38px; height: 38px; border-radius: 12px; background: #F97316; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; box-shadow: 0 4px 10px rgba(249, 115, 22, .3); }
.fm-dup-title { font-weight: 700; font-size: 14px; color: #1F2433; }
.fm-dup-sub { font-size: 11.5px; color: #8A6A4F; margin-top: 1px; }
.fm-dup-list { max-height: 280px; overflow-y: auto; padding: 6px 0; }
.fm-dup-row { display: flex; gap: 12px; padding: 9px 16px; position: relative; }
.fm-dup-row + .fm-dup-row { border-top: 1px dashed #EEF0F6; }
.fm-dup-date { flex: none; width: 84px; font-size: 12px; font-weight: 600; color: #282E77; padding-top: 1px; }
.fm-dup-company { font-size: 13px; font-weight: 600; }
.fm-dup-rec { font-size: 12px; color: #6B7185; margin-top: 3px; display: flex; align-items: center; gap: 6px; }
.fm-dup-avatar { width: 18px; height: 18px; border-radius: 50%; background: #EEF0FA; color: #282E77; font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.fm-dup-none { font-style: italic; color: #A0A5B5; }
