/**
 * PSCC global design system (v1.36.0).
 *
 * One palette + one set of shared components for the whole plugin:
 * admin screens and applicant-facing pages both load this file first,
 * and every other PSCC stylesheet derives its colors from the tokens
 * below (change a token once, recolor everywhere).
 *
 * Tokens keep the exact long-standing PSCC values, so adopting them
 * changes nothing visually — it only ends the era of each screen
 * carrying its own copy of every hex code.
 */

:root {
	/* Brand. */
	--pscc-navy: #1a365d;
	--pscc-navy-hover: #2c5282;

	/* Text + chrome. */
	--pscc-text: #1a202c;
	--pscc-ink: #2d3748;
	--pscc-slate: #4a5568;
	--pscc-muted: #718096;
	--pscc-slate-light: #94a3b8;
	--pscc-faint: #a0aec0;
	--pscc-border: #e2e8f0;
	--pscc-border-soft: #cbd5e1;
	--pscc-border-dark: #cbd5e0;
	--pscc-input-border: #dbdbdb;
	--pscc-bg-soft: #f7fafc;
	--pscc-blue: #3182ce;
	--pscc-green: #38a169;

	/* Status tints. */
	--pscc-success-bg: #c6f6d5;
	--pscc-success-text: #22543d;
	--pscc-warn-bg: #fef3c7;
	--pscc-warn-soft: #feebc8;
	--pscc-warn-text: #7b341e;
	--pscc-amber: #d69e2e;
	--pscc-danger-bg: #fed7d7;
	--pscc-danger: #e53e3e;
	--pscc-danger-text: #742a2a;
	--pscc-danger-btn: #d63638;
	--pscc-danger-btn-hover: #b32d2e;
	--pscc-info-bg: #dbeafe;
	--pscc-info-text: #1e40af;

	/* Pipeline stage hues (Master sheet pills + pickers). */
	--pscc-stage-form: #f1f5f9;
	--pscc-stage-payment: #fef3c7;
	--pscc-stage-test: #ede9fe;
	--pscc-stage-interview: #dbeafe;
	--pscc-stage-selected: #dcfce7;
	--pscc-stage-waiting: #fef9c3;
	--pscc-stage-rejected: #fee2e2;
	--pscc-stage-final: #ccfbf1;

	/* Geometry. */
	--pscc-radius: 6px;
	--pscc-radius-lg: 8px;
	--pscc-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);

	/* Type. */
	--pscc-font: 'Bai Jamjuree', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ------------------------------------------------------------------
 * Buttons — the one canonical set (admin + public markup share these).
 * ------------------------------------------------------------------ */

.pscc-btn {
	display: inline-block;
	padding: 10px 20px;
	border-radius: var(--pscc-radius);
	text-decoration: none;
	font-weight: 600;
	cursor: pointer;
	border: none;
	font-size: 14px;
	font-family: inherit;
	transition: all 0.2s;
}

.pscc-btn-primary {
	background: var(--pscc-navy);
	color: #fff;
}

.pscc-btn-primary:hover,
.pscc-btn-primary:focus {
	background: var(--pscc-navy-hover);
	color: #fff;
}

.pscc-btn-outline {
	background: #fff;
	color: var(--pscc-navy);
	border: 2px solid var(--pscc-navy);
}

.pscc-btn-outline:hover,
.pscc-btn-outline:focus {
	background: var(--pscc-navy);
	color: #fff;
}

.pscc-btn-danger {
	background: var(--pscc-danger-btn);
	border-color: var(--pscc-danger-btn);
	color: #ffffff;
}

.pscc-btn-danger:hover,
.pscc-btn-danger:focus {
	background: var(--pscc-danger-btn-hover);
	border-color: var(--pscc-danger-btn-hover);
	color: #ffffff;
}

.pscc-btn-small {
	padding: 6px 12px;
	font-size: 13px;
}

.pscc-btn:disabled,
.pscc-btn-disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

/* ------------------------------------------------------------------
 * Cards + stats.
 * ------------------------------------------------------------------ */

.pscc-card {
	background: #fff;
	border: 1px solid var(--pscc-border);
	border-radius: var(--pscc-radius-lg);
	padding: 20px 24px;
	margin: 20px 0;
	box-shadow: var(--pscc-shadow);
}

.pscc-card > h2:first-child,
.pscc-card > h3:first-child,
.pscc-card h2 {
	margin-top: 0;
	color: var(--pscc-navy);
}

.pscc-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 16px;
	margin: 20px 0;
}

.pscc-stat-card {
	background: #fff;
	border: 1px solid var(--pscc-border);
	border-radius: var(--pscc-radius-lg);
	padding: 20px;
	text-align: center;
	box-shadow: var(--pscc-shadow);
}

.pscc-stat-number {
	font-size: 32px;
	font-weight: 700;
	color: var(--pscc-navy);
	line-height: 1;
}

.pscc-stat-label {
	font-size: 13px;
	color: var(--pscc-muted);
	margin-top: 8px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

/* ------------------------------------------------------------------
 * Badges + status pills.
 * ------------------------------------------------------------------ */

.pscc-badge {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 12px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.pscc-badge-success {
	background: var(--pscc-success-bg);
	color: var(--pscc-success-text);
}

.pscc-badge-warning {
	background: var(--pscc-warn-soft);
	color: var(--pscc-warn-text);
}

.pscc-badge-danger {
	background: var(--pscc-danger-bg);
	color: var(--pscc-danger-text);
}

.pscc-badge-info {
	background: var(--pscc-info-bg);
	color: var(--pscc-info-text);
}

/* ------------------------------------------------------------------
 * Tables.
 * ------------------------------------------------------------------ */

.pscc-table {
	width: 100%;
	border-collapse: collapse;
	background: #fff;
}

.pscc-table th,
.pscc-table td {
	padding: 10px 12px;
	border-bottom: 1px solid var(--pscc-border);
	text-align: left;
	vertical-align: top;
}

.pscc-table thead th {
	background: var(--pscc-bg-soft);
	color: var(--pscc-navy);
	font-weight: 700;
}

.pscc-table tbody tr:hover {
	background: var(--pscc-bg-soft);
}

/* ------------------------------------------------------------------
 * Fields.
 * ------------------------------------------------------------------ */

.pscc-field-input,
.pscc-field-col input,
.pscc-field-col select,
.pscc-field-col textarea {
	width: 100%;
	border: 1px solid var(--pscc-input-border);
	border-radius: var(--pscc-radius);
	box-sizing: border-box;
	background: #fff;
	font-family: inherit;
	font-size: 14px;
}

.pscc-field-input:focus,
.pscc-field-col input:focus,
.pscc-field-col select:focus,
.pscc-field-col textarea:focus {
	border-color: var(--pscc-navy);
	outline: none;
	box-shadow: 0 0 0 1px var(--pscc-navy);
}

/* ------------------------------------------------------------------
 * Test-centre details + fee breakdown (v1.36.0).
 * ------------------------------------------------------------------ */

.pscc-centre-details {
	margin-top: 10px;
	padding: 12px 14px;
	background: var(--pscc-bg-soft);
	border: 1px solid var(--pscc-border);
	border-left: 4px solid var(--pscc-navy);
	border-radius: var(--pscc-radius);
	font-size: 14px;
	line-height: 1.6;
	color: var(--pscc-slate);
}

.pscc-centre-details[hidden] {
	display: none;
}

.pscc-fee-breakdown {
	width: 100%;
	border-collapse: collapse;
	margin: 16px 0;
	background: #fff;
	border: 1px solid var(--pscc-border);
	border-radius: var(--pscc-radius-lg);
	overflow: hidden;
}

.pscc-fee-breakdown caption {
	text-align: left;
	font-weight: 700;
	color: var(--pscc-navy);
	padding: 10px 12px;
	background: var(--pscc-bg-soft);
	border-bottom: 1px solid var(--pscc-border);
}

.pscc-fee-breakdown td {
	padding: 9px 12px;
	border-bottom: 1px solid var(--pscc-border);
}

.pscc-fee-breakdown tr:last-child td {
	border-bottom: none;
}

.pscc-fee-breakdown .pscc-amount {
	text-align: right;
	font-weight: 600;
	white-space: nowrap;
}

/* ------------------------------------------------------------------
 * Modals — one canonical definition for every dialog in the plugin:
 * the shared confirm/prompt builders, the inline admin modals and
 * the applicant-facing modal all share these bones (v1.37.0 moves
 * the per-sheet copies here).
 * ------------------------------------------------------------------ */

.pscc-modal,
.pscc-public-modal {
	position: fixed;
	inset: 0;
	z-index: 100;
	background: rgba(0, 0, 0, 0.5);
	display: flex;
	align-items: center;
	justify-content: center;
}

.pscc-modal[hidden] {
	display: none;
}

.pscc-modal-box,
.pscc-public-modal-box {
	background: #ffffff;
	border-radius: var(--pscc-radius-lg);
	padding: 24px;
	max-width: 480px;
	width: calc(100% - 48px);
	font-family: var(--pscc-font);
}

.pscc-confirm-box {
	max-width: 440px;
}

.pscc-confirm-title,
.pscc-public-modal-title {
	margin: 0 0 10px;
	font-size: 18px;
	line-height: 1.4;
	color: var(--pscc-navy);
}

.pscc-confirm-message,
.pscc-public-modal-message {
	margin: 0 0 18px;
	font-size: 14px;
	line-height: 1.55;
	color: #3c434a;
}

.pscc-confirm-message code {
	font-family: var(--pscc-font);
}

.pscc-confirm-actions,
.pscc-public-modal-actions {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
}

.pscc-confirm-input {
	width: 100%;
	margin: 0 0 18px;
	font-family: inherit;
	font-size: 14px;
}

textarea.pscc-confirm-input {
	min-height: 76px;
	resize: vertical;
}

/* Danger panel inside a modal (replaces WP notices + inline styles). */
.pscc-modal-notice {
	background: var(--pscc-danger-bg);
	border: 1px solid var(--pscc-danger);
	border-radius: var(--pscc-radius);
	color: var(--pscc-danger-text);
	padding: 1px 12px;
	margin: 0 0 12px;
	font-size: 14px;
}

/* Stacked radio rows + indented follow-up row inside a modal. */
.pscc-modal-stack label {
	display: block;
	margin-bottom: 6px;
}

.pscc-modal-stack label:last-child {
	margin-bottom: 0;
}

.pscc-modal-indent {
	margin-left: 24px;
}

.pscc-modal-file input[type="file"] {
	width: 100%;
}

/* ------------------------------------------------------------------
 * Backend mapping: the admin sheet's own brand rules (primary
 * buttons, save actions, pills) keep governing, with their colors
 * tokenized to the variables above — same pixels, one source.
 * ------------------------------------------------------------------ */

/* ------------------------------------------------------------------
 * Candidate overview (v1.54.0) - the Selection tab's read-only file for
 * the final authority. Same modal shell, prints straight to PDF.
 * ------------------------------------------------------------------ */

.pscc-modal-content {
    max-width: 900px;
    width: calc(100% - 48px);
    max-height: 86vh;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.pscc-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 24px;
    border-bottom: 1px solid var(--pscc-border);
}

.pscc-modal-head .pscc-confirm-title {
    margin: 0;
}

.pscc-modal-close {
    background: none;
    border: 0;
    font-size: 24px;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
}

.pscc-modal-body {
    flex: 1 1 auto;
    overflow: auto;
    padding: 20px 24px;
}

.pscc-modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 24px;
    border-top: 1px solid var(--pscc-border);
    background: var(--pscc-surface, #f8fafc);
}

.pscc-overview-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--pscc-border);
}

.pscc-overview-name {
    margin: 0 0 4px;
    font-size: 20px;
    color: var(--pscc-navy);
}

.pscc-overview-sub {
    margin: 0;
    font-size: 13px;
    color: #5b6570;
}

.pscc-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
}

.pscc-overview-card {
    background: #fff;
    border: 1px solid var(--pscc-border);
    border-radius: var(--pscc-radius-sm, 8px);
    padding: 14px 16px;
}

.pscc-overview-card-wide {
    grid-column: 1 / -1;
}

.pscc-overview-card h3 {
    margin: 0 0 10px;
    font-size: 13px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--pscc-navy);
}

.pscc-overview-list {
    display: grid;
    grid-template-columns: minmax(120px, 40%) 1fr;
    gap: 6px 12px;
    margin: 0;
    font-size: 13px;
}

.pscc-overview-list dt {
    color: #5b6570;
}

.pscc-overview-list dd {
    margin: 0;
}

.pscc-overview-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 13px;
}

.pscc-overview-table th,
.pscc-overview-table td {
    text-align: left;
    padding: 6px 8px;
    border-bottom: 1px solid var(--pscc-border);
}

.pscc-overview-table th {
    font-weight: 600;
    color: #5b6570;
}

.pscc-overview-docs {
    margin: 0;
    padding-left: 18px;
    font-size: 13px;
}

.pscc-overview-empty {
    margin: 0;
    font-size: 13px;
    font-style: italic;
    color: #8a9099;
}

#pscc-print-area {
    display: none;
}

@media print {
    body.pscc-printing > *:not(#pscc-print-area) {
        display: none !important;
    }

    body.pscc-printing #pscc-print-area {
        display: block !important;
    }

    body.pscc-printing {
        background: #fff;
    }
}
