:root {
	--wl-primary: #496b62;
	--wl-primary-hover: #3b5850;
	--wl-primary-soft: #eef4f2;
	--wl-border: #cfd8d5;
	--wl-text: #1f2927;
	--wl-muted: #5a6965;
	--wl-bg: #f8faf9;
	--wl-surface: #ffffff;
	--wl-warn-bg: #fff8e6;
	--wl-warn-border: #e6c269;
	--wl-warn-text: #6e4f00;
	--wl-error-bg: #fdecec;
	--wl-error-border: #e59898;
	--wl-error-text: #8c1d1d;
	--wl-success-bg: #eaf6ef;
	--wl-success-border: #8ec9a6;
	--wl-success-text: #1c5c36;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html,
body {
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	font-family: Mada, "Segoe UI", Arial, sans-serif;
	font-size: 14px;
	color: var(--wl-text);
	background: var(--wl-bg);
}

.app-shell {
	display: flex;
	flex-direction: column;
	height: 100%;
	overflow: hidden;
}

.hidden {
	display: none !important;
}

/* Header */
.wl-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 12px 14px;
	background-color: var(--wl-primary);
	color: #ffffff;
	flex-shrink: 0;
}

.wl-header__left {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
	flex: 1;
}

.wl-header__logo {
	width: 34px;
	height: 34px;
	flex-shrink: 0;
	border-radius: 4px;
}

.wl-header__template-picker {
	display: flex;
	flex-direction: column;
	min-width: 0;
	flex: 1;
}

.wl-header__label {
	font-size: 11px;
	color: rgba(255, 255, 255, 0.85);
	margin-bottom: 2px;
}

.wl-header__select {
	width: 100%;
	padding: 6px 28px 6px 8px;
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	color: var(--wl-text);
	background-color: #ffffff;
	border: 1px solid rgba(255, 255, 255, 0.4);
	border-radius: 4px;
	cursor: pointer;
}

.wl-header__right {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-shrink: 0;
}

.wl-icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border: 1px solid rgba(255, 255, 255, 0.35);
	border-radius: 6px;
	background: rgba(255, 255, 255, 0.12);
	color: #ffffff;
	font-size: 17px;
	cursor: pointer;
	transition: background 0.15s ease;
}

.wl-icon-btn:hover {
	background: rgba(255, 255, 255, 0.24);
}

/* Signed-in User Bar */
.wl-user-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 5px 14px;
	font-size: 11.5px;
	background: var(--wl-primary-soft);
	color: var(--wl-muted);
	border-bottom: 1px solid var(--wl-border);
	flex-shrink: 0;
}

.wl-user-bar__email {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.wl-user-bar__badge {
	background: var(--wl-primary);
	color: #ffffff;
	font-size: 10px;
	font-weight: 600;
	padding: 1px 6px;
	border-radius: 10px;
	margin-left: 6px;
}

/* Auth Gate Screen */
.auth-gate {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 24px 20px;
	text-align: center;
}

.auth-gate__card {
	width: 100%;
	max-width: 340px;
	background: var(--wl-surface);
	border: 1px solid var(--wl-border);
	border-radius: 8px;
	padding: 24px 18px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.auth-gate__logo {
	width: 48px;
	height: 48px;
	margin-bottom: 10px;
}

.auth-gate__title {
	margin: 0 0 6px;
	font-size: 17px;
	font-weight: 700;
	color: var(--wl-primary);
}

.auth-gate__desc {
	margin: 0 0 16px;
	font-size: 13px;
	line-height: 1.45;
	color: var(--wl-muted);
}

.auth-gate__error {
	margin: 0 0 14px;
	padding: 10px 12px;
	border-radius: 6px;
	background: var(--wl-error-bg);
	border: 1px solid var(--wl-error-border);
	color: var(--wl-error-text);
	font-size: 12.5px;
	text-align: left;
}

/* Main Content */
.wl-main {
	flex: 1;
	overflow-y: auto;
	padding: 14px;
}

.wl-notice {
	background: var(--wl-warn-bg);
	border: 1px solid var(--wl-warn-border);
	color: var(--wl-warn-text);
	border-radius: 6px;
	padding: 10px 12px;
	font-size: 12.5px;
	line-height: 1.45;
	margin-bottom: 14px;
}

.wl-notice strong {
	color: #4d3700;
}

.wl-notice ol,
.wl-notice ul {
	margin: 6px 0 0;
	padding-left: 18px;
}

.wl-notice li {
	margin-bottom: 5px;
}

.wl-notice a {
	color: var(--wl-primary);
	font-weight: 600;
}

/* Form Controls */
.wl-field {
	margin-bottom: 12px;
}

.wl-label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	margin-bottom: 4px;
	color: var(--wl-text);
}

.wl-label.is-required::after {
	content: " *";
	color: #c42b1c;
}

.wl-input,
.wl-select,
.wl-textarea {
	width: 100%;
	padding: 8px 10px;
	font-family: inherit;
	font-size: 13.5px;
	color: var(--wl-text);
	background: var(--wl-surface);
	border: 1px solid var(--wl-border);
	border-radius: 5px;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.wl-input:focus,
.wl-select:focus,
.wl-textarea:focus {
	outline: none;
	border-color: var(--wl-primary);
	box-shadow: 0 0 0 2px rgba(73, 107, 98, 0.18);
}

.wl-textarea {
	min-height: 66px;
	resize: vertical;
}

.wl-hint {
	margin-top: 4px;
	font-size: 11.5px;
	color: var(--wl-muted);
}

.wl-policy-warning {
	margin-top: 5px;
	padding: 6px 8px;
	font-size: 11.5px;
	border-radius: 4px;
	background: var(--wl-warn-bg);
	border: 1px solid var(--wl-warn-border);
	color: var(--wl-warn-text);
}

.wl-summary-card {
	background: var(--wl-surface);
	border: 1px solid var(--wl-border);
	border-left: 3px solid var(--wl-primary);
	border-radius: 5px;
	padding: 9px 11px;
	margin-bottom: 12px;
	font-size: 12.5px;
}

.wl-summary-row {
	display: flex;
	justify-content: space-between;
	gap: 8px;
	padding: 2px 0;
}

.wl-summary-row--total {
	margin-top: 4px;
	padding-top: 6px;
	border-top: 1px dashed var(--wl-border);
	font-weight: 700;
	color: var(--wl-primary);
}

/* Radio Group */
.wl-radio-group {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 4px;
}

.wl-radio-option {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 11px;
	background: var(--wl-surface);
	border: 1px solid var(--wl-border);
	border-radius: 5px;
	cursor: pointer;
	font-size: 13px;
}

.wl-radio-option input[type="radio"] {
	accent-color: var(--wl-primary);
	margin: 0;
}

.wl-radio-option.is-selected {
	border-color: var(--wl-primary);
	background: var(--wl-primary-soft);
	font-weight: 600;
}

/* Status & Error Banners */
.wl-banner {
	padding: 9px 11px;
	border-radius: 5px;
	font-size: 12.5px;
	margin-top: 8px;
}

.wl-banner--error {
	background: var(--wl-error-bg);
	border: 1px solid var(--wl-error-border);
	color: var(--wl-error-text);
}

.wl-banner--success {
	background: var(--wl-success-bg);
	border: 1px solid var(--wl-success-border);
	color: var(--wl-success-text);
}

/* Footer & Buttons */
.wl-footer {
	padding: 10px 14px 12px;
	background: var(--wl-surface);
	border-top: 1px solid var(--wl-border);
	flex-shrink: 0;
}

.wl-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 9px 14px;
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	border-radius: 5px;
	border: 1px solid transparent;
	cursor: pointer;
	transition: background 0.15s ease, opacity 0.15s ease;
}

.wl-btn--full {
	width: 100%;
}

.wl-btn--primary {
	background: var(--wl-primary);
	color: #ffffff;
}

.wl-btn--primary:hover:not(:disabled) {
	background: var(--wl-primary-hover);
}

.wl-btn--primary:disabled {
	background: #dfe5e3;
	color: #8c9895;
	cursor: not-allowed;
}

.wl-btn--secondary {
	background: var(--wl-surface);
	border-color: var(--wl-border);
	color: var(--wl-text);
	font-size: 12.5px;
	padding: 6px 11px;
}

.wl-btn--secondary:hover {
	background: #f0f4f3;
}

.wl-btn--danger {
	background: transparent;
	border-color: var(--wl-error-border);
	color: var(--wl-error-text);
	font-size: 12px;
	padding: 4px 8px;
}

/* HR Admin Settings Modal */
.wl-modal-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(18, 28, 25, 0.52);
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 10px;
	z-index: 1000;
	overflow-y: auto;
}

.wl-modal {
	width: 100%;
	max-width: 560px;
	max-height: calc(100vh - 20px);
	display: flex;
	flex-direction: column;
	background: var(--wl-surface);
	border-radius: 8px;
	box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
	overflow: hidden;
}

.wl-modal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 14px;
	background: var(--wl-primary);
	color: #ffffff;
}

.wl-modal__title {
	margin: 0;
	font-size: 15px;
	font-weight: 700;
}

.wl-modal__close {
	background: transparent;
	border: none;
	color: #ffffff;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	padding: 2px 6px;
}

.wl-modal__body {
	flex: 1;
	overflow-y: auto;
	padding: 14px;
}

.wl-modal__section {
	margin-bottom: 16px;
	padding-bottom: 14px;
	border-bottom: 1px solid var(--wl-border);
}

.wl-modal__section:last-child {
	margin-bottom: 0;
	padding-bottom: 0;
	border-bottom: none;
}

.wl-modal__section-title {
	margin: 0 0 8px;
	font-size: 13.5px;
	font-weight: 700;
	color: var(--wl-primary);
}

.wl-region-card {
	background: var(--wl-bg);
	border: 1px solid var(--wl-border);
	border-radius: 6px;
	padding: 10px;
	margin-bottom: 8px;
}

.wl-region-card__top {
	display: grid;
	grid-template-columns: 1fr 74px 64px auto;
	gap: 6px;
	align-items: end;
	margin-bottom: 8px;
}

.wl-region-card__budgets {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 6px;
}

.wl-mini-label {
	display: block;
	font-size: 11px;
	font-weight: 600;
	color: var(--wl-muted);
	margin-bottom: 2px;
}

.wl-mini-input {
	width: 100%;
	padding: 5px 7px;
	font-family: inherit;
	font-size: 12.5px;
	border: 1px solid var(--wl-border);
	border-radius: 4px;
	background: #ffffff;
}

.wl-modal__footer {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
	padding: 10px 14px;
	border-top: 1px solid var(--wl-border);
	background: var(--wl-bg);
}

.wl-semicolon-preview {
	margin-top: 3px;
	font-size: 11px;
	color: var(--wl-primary);
	word-break: break-all;
}
