/*
 * Recruitment Manager — front-end sidebar browser
 * Design concept: a sidebar lists Job Categories; the main area shows
 * a single, full-width column of results — open roles for anonymous
 * visitors, or (for logged-in visitors) category panels with EU /
 * Non-EU tabs and expandable applicant lists.
 */

.rm-ff-wrap {
	--rm-ink: #16302d;
	--rm-paper: #f7f4ec;
	--rm-card: #fffdf8;
	--rm-gold: #c69a3b;
	--rm-gold-dark: #a67f2b;
	--rm-wine: #7a2e3a;
	--rm-slate: #5c6b66;
	--rm-line: #ded4bd;

	--rm-font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
	--rm-font-body: 'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

	font-family: var(--rm-font-body);
	color: var(--rm-ink);
	margin: 2.5rem 0;
}

.rm-ff-wrap * {
	box-sizing: border-box;
}

@media (prefers-reduced-motion: no-preference) {
	.rm-ff-wrap {
		--rm-transition-speed: 0.32s;
	}
}
@media (prefers-reduced-motion: reduce) {
	.rm-ff-wrap {
		--rm-transition-speed: 0s;
	}
}

.rm-ff-empty {
	font-family: var(--rm-font-display);
	font-size: 1.25rem;
	color: var(--rm-slate);
	text-align: center;
	padding: 3rem 1rem;
	border: 1px dashed var(--rm-line);
	border-radius: 6px;
	background: var(--rm-paper);
}

.rm-ff-top-filters-outer {
	display: flex;
	justify-content: center;
	margin-bottom: 1.75rem;
}

.rm-ff-top-filters {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 1.5rem;
	background: var(--rm-card);
	border: 1px solid var(--rm-line);
	border-radius: 12px;
	padding: 1.1rem 1.5rem;
	font-size: 0.85rem;
	width: 100%;
}

.rm-ff-filter-group {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}

.rm-ff-filter-label {
	font-weight: 600;
	color: var(--rm-ink);
	font-size: 0.85rem;
}

.rm-ff-input-icon {
	position: relative;
	display: inline-flex;
	align-items: center;
}

.rm-ff-input-icon svg {
	position: absolute;
	left: 0.75rem;
	color: var(--rm-slate);
	pointer-events: none;
}

.rm-ff-input-icon select,
.rm-ff-input-icon input[type="date"],
.rm-ff-input-icon input[type="text"] {
	appearance: none;
	-webkit-appearance: none;
	padding: 0.55rem 0.9rem 0.55rem 2.2rem;
	border: 1px solid var(--rm-line);
	border-radius: 8px;
	font-family: var(--rm-font-body);
	font-size: 0.88rem;
	color: var(--rm-ink);
	background: #fff;
	min-width: 170px;
}

.rm-ff-date-range {
	display: flex;
	align-items: center;
	gap: 0.6rem;
}

.rm-ff-date-sep {
	color: var(--rm-slate);
}

.rm-ff-filter-divider {
	align-self: stretch;
	width: 1px;
	background: var(--rm-line);
	margin: 0 0.25rem;
}

@media (max-width: 640px) {
	.rm-ff-filter-divider {
		display: none;
	}
}

.rm-ff-btn {
	all: unset;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.6rem 1.15rem;
	border-radius: 8px;
	font-family: var(--rm-font-body);
	font-size: 0.88rem;
	font-weight: 600;
	transition: background var(--rm-transition-speed) ease, color var(--rm-transition-speed) ease, opacity var(--rm-transition-speed) ease;
}

.rm-ff-btn--primary {
	background: var(--rm-ink);
	color: #fffdf8;
}

.rm-ff-btn--primary:hover,
.rm-ff-btn--primary:focus-visible {
	opacity: 0.88;
}

.rm-ff-btn--outline {
	background: #fff;
	color: var(--rm-ink);
	border: 1px solid var(--rm-line);
}

.rm-ff-btn--outline:hover,
.rm-ff-btn--outline:focus-visible {
	border-color: var(--rm-gold);
	color: var(--rm-gold-dark);
}

/* ---------- Layout: sidebar + main ---------- */

.rm-ff-layout {
	display: grid;
	grid-template-columns: 240px 1fr;
	gap: 2rem;
	align-items: start;
}

@media (max-width: 780px) {
	.rm-ff-layout {
		grid-template-columns: 1fr;
	}
}

.rm-ff-sidebar {
	position: sticky;
	top: 1rem;
	background: var(--rm-card);
	border: 1px solid var(--rm-line);
	border-radius: 8px;
	padding: 0.5rem;
}

@media (max-width: 780px) {
	.rm-ff-sidebar {
		position: static;
	}
}

.rm-ff-cat-nav {
	display: flex;
	flex-direction: column;
}

.rm-ff-cat-link {
	all: unset;
	cursor: pointer;
	padding: 0.55rem 0.75rem;
	font-size: 0.88rem;
	font-weight: 500;
	color: var(--rm-ink);
	border-radius: 5px;
	border-bottom: 1px solid var(--rm-line);
	transition: background var(--rm-transition-speed) ease, color var(--rm-transition-speed) ease;
}

.rm-ff-cat-nav .rm-ff-cat-link:last-child {
	border-bottom: none;
}

.rm-ff-cat-link:hover,
.rm-ff-cat-link:focus-visible {
	background: var(--rm-paper);
	color: var(--rm-wine);
}

.rm-ff-cat-link.is-active {
	background: var(--rm-ink);
	color: #fffdf8;
}

.rm-ff-mode-toggle {
	display: flex;
	gap: 0.5rem;
	margin-bottom: 1.25rem;
}

.rm-ff-mode-btn {
	all: unset;
	cursor: pointer;
	padding: 0.5rem 1.1rem;
	border-radius: 999px;
	font-family: var(--rm-font-body);
	font-size: 0.85rem;
	font-weight: 600;
	border: 1px solid var(--rm-line);
	color: var(--rm-slate);
	transition: background var(--rm-transition-speed) ease, color var(--rm-transition-speed) ease, border-color var(--rm-transition-speed) ease;
}

.rm-ff-mode-btn:hover,
.rm-ff-mode-btn:focus-visible {
	border-color: var(--rm-gold);
	color: var(--rm-ink);
}

.rm-ff-mode-btn.is-active {
	background: var(--rm-ink);
	border-color: var(--rm-ink);
	color: #fffdf8;
}

.rm-ff-status-link {
	all: unset;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	padding: 0.55rem 0.75rem;
	font-size: 0.88rem;
	font-weight: 500;
	color: var(--rm-ink);
	border-radius: 5px;
	border-bottom: 1px solid var(--rm-line);
	transition: background var(--rm-transition-speed) ease, color var(--rm-transition-speed) ease;
}

.rm-ff-cat-nav .rm-ff-status-link:last-child {
	border-bottom: none;
}

.rm-ff-status-link:hover,
.rm-ff-status-link:focus-visible {
	background: var(--rm-paper);
	color: var(--rm-wine);
}

.rm-ff-status-link.is-active {
	background: var(--rm-ink);
	color: #fffdf8;
}

.rm-ff-status-link-count {
	font-size: 0.78rem;
	opacity: 0.75;
}

.rm-ff-status-panel {
	background: var(--rm-card);
	border: 1px solid var(--rm-line);
	border-radius: 8px;
	padding: 1.5rem;
	margin-bottom: 1.25rem;
}

/* Hierarchical category tree */

.rm-ff-cat-tree {
	list-style: none;
	margin: 0;
	padding: 0;
}

.rm-ff-cat-tree--root {
	margin-top: 0.15rem;
}

.rm-ff-cat-children {
	padding-left: 0.9rem;
	border-left: 1px dashed var(--rm-line);
	margin-left: 0.75rem;
}

.rm-ff-cat-row {
	display: flex;
	align-items: center;
}

.rm-ff-cat-row .rm-ff-cat-link {
	flex: 1 1 auto;
	border-bottom: none;
}

.rm-ff-cat-node {
	border-bottom: 1px solid var(--rm-line);
}

.rm-ff-cat-tree .rm-ff-cat-tree .rm-ff-cat-node,
.rm-ff-cat-node:last-child {
	border-bottom: none;
}

.rm-ff-cat-toggle {
	all: unset;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	flex: 0 0 auto;
	color: var(--rm-slate);
}

.rm-ff-cat-toggle:hover,
.rm-ff-cat-toggle:focus-visible {
	color: var(--rm-wine);
}

.rm-ff-cat-chevron {
	transition: transform var(--rm-transition-speed) ease;
	transform: rotate(-90deg);
}

.rm-ff-cat-toggle[aria-expanded="true"] .rm-ff-cat-chevron {
	transform: rotate(0deg);
}

.rm-ff-main {
	min-width: 0;
}

/* ---------- Public view: single-column job list + search ---------- */

.rm-ff-toolbar {
	margin-bottom: 1.25rem;
}

.rm-ff-search-input {
	width: 100%;
	max-width: 420px;
	padding: 0.6rem 0.9rem;
	border: 1px solid var(--rm-line);
	border-radius: 999px;
	font-family: var(--rm-font-body);
	font-size: 0.9rem;
	color: var(--rm-ink);
	background: var(--rm-card);
}

.rm-ff-search-input:focus-visible {
	outline: 2px solid var(--rm-gold);
	outline-offset: 1px;
}

.rm-ff-list-single {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.rm-ff-list-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	background: var(--rm-card);
	border: 1px solid var(--rm-line);
	border-radius: 8px;
	padding: 1rem 1.25rem;
	text-decoration: none;
	color: var(--rm-ink);
	transition: box-shadow var(--rm-transition-speed) ease, transform var(--rm-transition-speed) ease, border-color var(--rm-transition-speed) ease;
}

.rm-ff-list-row:hover,
.rm-ff-list-row:focus-visible {
	box-shadow: 0 8px 20px rgba(22, 48, 45, 0.12);
	transform: translateY(-2px);
	border-color: var(--rm-gold);
}

.rm-ff-list-row-main {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
}

.rm-ff-list-row-title {
	font-family: var(--rm-font-display);
	font-weight: 600;
	font-size: 1.05rem;
}

.rm-ff-list-row-meta {
	font-size: 0.82rem;
	color: var(--rm-slate);
}

.rm-ff-list-row-cta {
	flex: 0 0 auto;
	font-size: 0.85rem;
	font-weight: 500;
	color: var(--rm-gold-dark);
	white-space: nowrap;
}

.rm-ff-empty-inline {
	color: var(--rm-slate);
	font-size: 0.9rem;
	text-align: center;
	padding: 2rem 1rem;
	border: 1px dashed var(--rm-line);
	border-radius: 8px;
}

/* ---------- Logged-in view: category panels, single column ---------- */

.rm-ff-cat-panel {
	background: var(--rm-card);
	border: 1px solid var(--rm-line);
	border-radius: 8px;
	padding: 1.5rem;
	margin-bottom: 1.25rem;
}

.rm-ff-panel-heading {
	margin: 0 0 1rem;
	font-family: var(--rm-font-display);
	font-weight: 600;
	font-size: 1.15rem;
	display: flex;
	align-items: baseline;
	gap: 0.6rem;
	flex-wrap: wrap;
}

.rm-ff-panel-count {
	font-family: var(--rm-font-body);
	font-weight: 400;
	font-size: 0.85rem;
	color: var(--rm-slate);
}

.rm-ff-panel-eu-breakdown {
	display: inline-flex;
	gap: 0.4rem;
	margin-left: 0.3rem;
}

.rm-ff-eu-count-badge {
	font-family: var(--rm-font-body);
	font-weight: 600;
	font-size: 0.72rem;
	padding: 0.15rem 0.55rem;
	border-radius: 999px;
	white-space: nowrap;
}

.rm-ff-eu-count-badge--eu {
	background: #edf7ed;
	color: #1e5e20;
	border: 1px solid #b8e0b9;
}

.rm-ff-eu-count-badge--noneu {
	background: #fdeeee;
	color: #8a2424;
	border: 1px solid #f3c6c6;
}

.rm-ff-job-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.rm-ff-job-item + .rm-ff-job-item {
	border-top: 1px dashed var(--rm-line);
}

.rm-ff-job-list--nested {
	border-top: 1px solid var(--rm-line);
	margin-top: 0.25rem;
}

.rm-ff-job-item--interactive {
	display: flex;
	flex-direction: column;
	padding: 0.15rem;
}

.rm-ff-job-toggle {
	all: unset;
	display: flex;
	align-items: center;
	gap: 0.6rem;
	cursor: pointer;
	padding: 0.75rem 0.35rem;
	width: 100%;
}

.rm-ff-job-title {
	font-weight: 500;
	flex: 1 1 auto;
}

.rm-ff-job-count {
	font-size: 0.82rem;
	color: var(--rm-slate);
	white-space: nowrap;
}

.rm-ff-chevron--small {
	flex: 0 0 auto;
	transition: transform var(--rm-transition-speed) ease;
}

.rm-ff-job-item--interactive[data-open="1"] .rm-ff-chevron--small {
	transform: rotate(180deg);
	color: var(--rm-wine);
}

.rm-ff-applicants {
	display: grid;
	grid-template-rows: 0fr;
	transition: grid-template-rows var(--rm-transition-speed) ease;
}

.rm-ff-job-item--interactive[data-open="1"] .rm-ff-applicants {
	grid-template-rows: 1fr;
}

/* "Latest Submissions" isn't nested inside a job toggle the way every
   other .rm-ff-applicants use is -- there's no [data-open="1"]
   ancestor to ever expand it, so without this it would stay visually
   collapsed (0fr) forever despite being "loaded". */
.rm-ff-applicants--flat {
	grid-template-rows: 1fr;
}

.rm-ff-applicants-inner {
	overflow: hidden;
	min-height: 0;
	padding: 0 0.35rem 0.75rem;
}

/* Category-level EU / Non-EU tabs, shown above each category's job list */

.rm-ff-eu-tabs {
	display: flex;
	gap: 0.4rem;
	margin: 0 0 0.85rem;
	padding-bottom: 0.6rem;
	border-bottom: 1px solid var(--rm-line);
}

.rm-ff-eu-tab {
	all: unset;
	cursor: pointer;
	padding: 0.4rem 0.95rem;
	border-radius: 999px;
	font-family: var(--rm-font-body);
	font-size: 0.82rem;
	font-weight: 500;
	color: var(--rm-slate);
	border: 1px solid var(--rm-line);
	transition: background var(--rm-transition-speed) ease, color var(--rm-transition-speed) ease, border-color var(--rm-transition-speed) ease;
}

.rm-ff-eu-tab:hover,
.rm-ff-eu-tab:focus-visible {
	border-color: var(--rm-gold);
	color: var(--rm-ink);
}

.rm-ff-eu-tab.is-active {
	background: var(--rm-ink);
	border-color: var(--rm-ink);
	color: #fffdf8;
}

.rm-ff-sub-loading,
.rm-ff-sub-error,
.rm-ff-sub-empty {
	color: var(--rm-slate);
	font-size: 0.88rem;
	padding: 0.5rem 0;
	margin: 0;
}

.rm-ff-sub-error {
	color: var(--rm-wine);
}

.rm-ff-applicant-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.85rem;
	display: block;
	overflow-x: auto;
	white-space: nowrap;
}

.rm-ff-applicant-table thead th {
	text-align: left;
	font-size: 0.72rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: var(--rm-slate);
	padding: 0.4rem;
	border-bottom: 2px solid var(--rm-line);
}

.rm-ff-applicant-number {
	width: 2.2rem;
	text-align: center;
	color: var(--rm-slate);
	font-weight: 600;
}

.rm-ff-applicant-table tbody {
	display: table;
	width: 100%;
}

.rm-ff-applicant-table td {
	padding: 0.5rem 0.4rem;
	border-top: 1px dashed var(--rm-line);
	vertical-align: middle;
	color: var(--rm-ink);
}

.rm-ff-applicant-table tr:first-child td {
	border-top: 1px solid var(--rm-line);
}

.rm-ff-applicant-name a {
	color: var(--rm-wine);
	text-decoration: none;
	font-weight: 500;
}

.rm-ff-applicant-name a:hover {
	text-decoration: underline;
}

.rm-ff-status-pill {
	display: inline-block;
	padding: 0.2rem 0.6rem;
	border-radius: 999px;
	background: var(--rm-paper);
	border: 1px solid var(--rm-line);
	font-size: 0.75rem;
	font-weight: 500;
	color: var(--rm-slate);
	white-space: nowrap;
}

.rm-ff-status-cell {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	white-space: nowrap;
}

.rm-ff-cv-link {
	font-size: 0.78rem;
	font-weight: 500;
	color: var(--rm-gold-dark);
	text-decoration: none;
	border: 1px solid var(--rm-gold);
	border-radius: 999px;
	padding: 0.15rem 0.6rem;
	white-space: nowrap;
}

.rm-ff-cv-link:hover {
	background: var(--rm-gold);
	color: #fffdf8;
}

.rm-ff-status-select {
	font-family: var(--rm-font-body);
	font-size: 0.78rem;
	font-weight: 500;
	color: var(--rm-ink);
	background: var(--rm-paper);
	border: 1px solid var(--rm-line);
	border-radius: 999px;
	padding: 0.2rem 1.6rem 0.2rem 0.7rem;
	white-space: nowrap;
	cursor: pointer;
}

.rm-ff-notes-toggle {
	all: unset;
	cursor: pointer;
	font-size: 0.78rem;
	font-weight: 500;
	color: var(--rm-slate);
	border: 1px solid var(--rm-line);
	border-radius: 999px;
	padding: 0.2rem 0.7rem;
	white-space: nowrap;
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
}

.rm-ff-notes-toggle.has-notes {
	border-color: var(--rm-gold);
	color: var(--rm-gold-dark);
}

.rm-ff-notes-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1.1rem;
	height: 1.1rem;
	padding: 0 0.25rem;
	border-radius: 999px;
	background: var(--rm-gold);
	color: #fffdf8;
	font-size: 0.68rem;
	font-weight: 700;
}

.rm-ff-notes-toggle:hover {
	border-color: var(--rm-wine);
	color: var(--rm-wine);
}

.rm-ff-duplicate-toggle {
	all: unset;
	cursor: pointer;
	font-size: 0.78rem;
	font-weight: 600;
	color: var(--rm-gold-dark);
	background: #fcf0d4;
	border: 1px solid var(--rm-gold);
	border-radius: 999px;
	padding: 0.2rem 0.7rem;
	white-space: nowrap;
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
}

.rm-ff-duplicate-toggle:hover {
	background: var(--rm-gold);
	color: #fffdf8;
}

.rm-ff-duplicate-row td {
	background: var(--rm-paper);
	border-top: none !important;
}

.rm-ff-duplicate-panel {
	padding: 0.75rem 0.5rem;
}

.rm-ff-duplicate-title {
	font-weight: 600;
	font-size: 0.85rem;
	color: var(--rm-ink);
	margin-bottom: 0.5rem;
}

.rm-ff-duplicate-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.82rem;
}

.rm-ff-duplicate-table th {
	text-align: left;
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--rm-slate);
	padding: 0.3rem 0.5rem;
	border-bottom: 1px solid var(--rm-line);
}

.rm-ff-duplicate-table td {
	padding: 0.4rem 0.5rem;
	border-bottom: 1px dashed var(--rm-line);
}

.rm-ff-duplicate-current-row {
	background: rgba(0, 0, 0, 0.02);
}

.rm-ff-duplicate-current {
	color: var(--rm-slate);
	font-size: 0.75rem;
}

.rm-ff-notes-row td {
	background: var(--rm-paper);
	border-top: none !important;
}

.rm-ff-notes-panel {
	padding: 0.75rem 0.5rem;
}

.rm-ff-notes-list {
	margin-bottom: 0.75rem;
}

.rm-ff-notes-empty {
	color: var(--rm-slate);
	font-size: 0.85rem;
	font-style: italic;
	margin: 0 0 0.5rem;
}

.rm-ff-note {
	border-bottom: 1px dashed var(--rm-line);
	padding: 0.5rem 0;
}

.rm-ff-note:last-child {
	border-bottom: none;
}

.rm-ff-note-meta {
	display: flex;
	gap: 0.6rem;
	align-items: baseline;
	font-size: 0.72rem;
	color: var(--rm-slate);
	margin-bottom: 0.2rem;
	flex-wrap: wrap;
}

.rm-ff-note-edited {
	font-style: italic;
	color: var(--rm-gold-dark);
}

.rm-ff-note-actions {
	margin-left: auto;
	display: flex;
	gap: 0.5rem;
}

.rm-ff-note-edit-btn,
.rm-ff-note-delete-btn {
	all: unset;
	cursor: pointer;
	font-size: 0.72rem;
	color: var(--rm-wine);
}

.rm-ff-note-edit-btn:hover,
.rm-ff-note-delete-btn:hover {
	text-decoration: underline;
}

.rm-ff-note-edit-input {
	width: 100%;
	max-width: 460px;
	font-family: var(--rm-font-body);
	font-size: 0.82rem;
	padding: 0.4rem 0.55rem;
	border: 1px solid var(--rm-line);
	border-radius: 6px;
	margin-bottom: 0.4rem;
	resize: vertical;
}

.rm-ff-note-edit-actions {
	display: flex;
	gap: 0.5rem;
}

.rm-ff-note-save-btn,
.rm-ff-note-cancel-btn {
	all: unset;
	cursor: pointer;
	font-size: 0.75rem;
	font-weight: 600;
	padding: 0.3rem 0.75rem;
	border-radius: 999px;
}

.rm-ff-note-save-btn {
	background: var(--rm-ink);
	color: #fffdf8;
}

.rm-ff-note-cancel-btn {
	border: 1px solid var(--rm-line);
	color: var(--rm-slate);
}

.rm-ff-note-meta strong {
	color: var(--rm-ink);
	font-size: 0.8rem;
}

.rm-ff-note-text {
	font-size: 0.82rem;
	color: var(--rm-ink);
	white-space: pre-wrap;
}

.rm-ff-note-form {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	max-width: 480px;
}

.rm-ff-note-input {
	font-family: var(--rm-font-body);
	font-size: 0.85rem;
	padding: 0.5rem 0.65rem;
	border: 1px solid var(--rm-line);
	border-radius: 6px;
	resize: vertical;
}

.rm-ff-note-submit {
	all: unset;
	cursor: pointer;
	align-self: flex-start;
	padding: 0.45rem 1rem;
	border-radius: 999px;
	background: var(--rm-ink);
	color: #fffdf8;
	font-family: var(--rm-font-body);
	font-size: 0.82rem;
	font-weight: 600;
}

.rm-ff-note-submit:hover {
	opacity: 0.88;
}

.rm-ff-load-more {
	all: unset;
	display: inline-block;
	margin-top: 0.6rem;
	padding: 0.4rem 0.9rem;
	border: 1px solid var(--rm-gold);
	border-radius: 999px;
	color: var(--rm-gold-dark);
	font-size: 0.8rem;
	font-weight: 500;
	cursor: pointer;
	transition: background var(--rm-transition-speed) ease, color var(--rm-transition-speed) ease;
}

.rm-ff-load-more:hover,
.rm-ff-load-more:focus-visible {
	background: var(--rm-gold);
	color: #fffdf8;
}
