/* =========================================================
   HR Absence Manager — Frontend Styles
   ========================================================= */

.hr-am-wrap {
	max-width: 640px;
	margin: 0 auto;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 15px;
	color: #1d2327;
	line-height: 1.5;
}

/* ----- Language switcher ----- */

.hr-am-lang-switcher {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 20px;
}

.hr-am-lang-btn {
	padding: 6px 16px;
	border: 2px solid #c3c4c7;
	background: #fff;
	border-radius: 20px;
	cursor: pointer;
	font-size: 13px;
	font-weight: 600;
	color: #50575e;
	transition: background 0.15s, border-color 0.15s, color 0.15s;
	line-height: 1.4;
}

.hr-am-lang-btn:hover {
	border-color: #2271b1;
	color: #2271b1;
}

.hr-am-lang-btn.active,
.hr-am-lang-btn[aria-pressed="true"] {
	background: #2271b1;
	border-color: #2271b1;
	color: #fff;
}

/* ----- Notices ----- */

.hr-am-notice {
	padding: 12px 16px;
	border-radius: 6px;
	margin-bottom: 20px;
	font-size: 14px;
}

.hr-am-notice--success {
	background: #d4edda;
	border: 1px solid #a8d5b5;
	color: #1a5c2e;
}

.hr-am-notice--error {
	background: #fce8e8;
	border: 1px solid #f5b5b5;
	color: #7a1a1a;
}

/* ----- Login box ----- */

.hr-am-login-box {
	background: #f0f6fc;
	border: 1px solid #c3d4e6;
	border-radius: 8px;
	padding: 20px 24px;
}

.hr-am-login-box p {
	margin: 0;
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.hr-am-login-link {
	display: inline-block;
	padding: 6px 16px;
	background: #2271b1;
	color: #fff !important;
	border-radius: 4px;
	text-decoration: none;
	font-weight: 600;
	font-size: 14px;
	transition: background 0.15s;
}

.hr-am-login-link:hover {
	background: #135e96;
}

/* ----- Card ----- */

.hr-am-card {
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 10px;
	padding: 28px 32px;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.hr-am-card__title {
	margin: 0 0 24px;
	font-size: 20px;
	font-weight: 700;
	color: #1d2327;
	padding-bottom: 14px;
	border-bottom: 2px solid #2271b1;
}

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

.hr-am-field {
	margin-bottom: 18px;
}

.hr-am-field label {
	display: block;
	font-weight: 600;
	margin-bottom: 6px;
	font-size: 14px;
	color: #1d2327;
}

.hr-am-field input[type="text"],
.hr-am-field input[type="date"],
.hr-am-field input[type="number"],
.hr-am-field select {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #b5bcc2;
	border-radius: 6px;
	font-size: 14px;
	color: #1d2327;
	background: #fafafa;
	box-sizing: border-box;
	transition: border-color 0.15s, box-shadow 0.15s;
	appearance: auto;
}

.hr-am-field input:focus,
.hr-am-field select:focus {
	outline: none;
	border-color: #2271b1;
	background: #fff;
	box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.15);
}

/* Date row */
.hr-am-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

@media (max-width: 480px) {
	.hr-am-row {
		grid-template-columns: 1fr;
	}
}

/* ----- Workdays field ----- */

.hr-am-workdays-wrap {
	display: flex;
	align-items: center;
	gap: 12px;
}

.hr-am-workdays-display {
	width: 90px !important;
	flex-shrink: 0;
	background: #f0f6fc !important;
	border-color: #b5d0e8 !important;
	font-weight: 700;
	font-size: 16px !important;
	color: #135e96 !important;
	text-align: center;
	cursor: default;
}

.hr-am-workdays-hint {
	font-size: 12px;
	color: #787c82;
	font-style: italic;
}

/* Consent */
.hr-am-field--consent {
	background: #f6f7f7;
	border: 1px solid #dcdcde;
	border-radius: 6px;
	padding: 12px 14px;
}

.hr-am-checkbox-label {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	cursor: pointer;
	font-weight: normal;
}

.hr-am-checkbox-label input[type="checkbox"] {
	width: 17px;
	height: 17px;
	flex-shrink: 0;
	margin-top: 2px;
	cursor: pointer;
	accent-color: #2271b1;
}

.hr-am-checkbox-text {
	font-size: 13px;
	color: #50575e;
	line-height: 1.5;
}

/* Submit button */
.hr-am-btn--primary {
	display: block;
	width: 100%;
	padding: 12px;
	background: #2271b1;
	color: #fff;
	border: none;
	border-radius: 6px;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.15s;
	letter-spacing: 0.01em;
}

.hr-am-btn--primary:hover {
	background: #135e96;
}

/* =========================================================
   RTL — Arabic
   ========================================================= */

.hr-am-wrap.rtl {
	direction: rtl;
	text-align: right;
}

.hr-am-wrap.rtl .hr-am-lang-switcher {
	justify-content: flex-end;
}

.hr-am-wrap.rtl .hr-am-checkbox-label {
	flex-direction: row-reverse;
}

.hr-am-wrap.rtl .hr-am-login-box p {
	flex-direction: row-reverse;
}

.hr-am-wrap.rtl .hr-am-workdays-wrap {
	flex-direction: row-reverse;
	justify-content: flex-end;
}

/* =========================================================
   Frontend Admin Panel  [hr_absence_admin]
   ========================================================= */

.hr-am-admin-panel {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 14px;
	color: #1d2327;
}

.hr-am-admin-panel h3 {
	font-size: 17px;
	margin: 0 0 16px;
	padding-bottom: 10px;
	border-bottom: 1px solid #dcdcde;
	color: #1d2327;
}

.hr-am-hidden {
	display: none !important;
}

.hr-am-access-denied {
	padding: 16px;
	background: #fce8e8;
	border: 1px solid #f5b5b5;
	border-radius: 6px;
	color: #7a1a1a;
}

/* Panel tabs */
.hr-am-panel-tabs {
	display: flex;
	gap: 4px;
	margin-bottom: 20px;
	border-bottom: 2px solid #dcdcde;
	padding-bottom: 0;
}

.hr-am-tab-btn {
	padding: 8px 18px;
	border: 1px solid transparent;
	border-bottom: none;
	background: transparent;
	cursor: pointer;
	font-size: 14px;
	font-weight: 600;
	color: #50575e;
	border-radius: 4px 4px 0 0;
	margin-bottom: -2px;
	transition: color 0.15s, background 0.15s;
	display: flex;
	align-items: center;
	gap: 6px;
}

.hr-am-tab-btn:hover {
	color: #2271b1;
	background: #f6f7f7;
}

.hr-am-tab-btn.active {
	color: #1d2327;
	background: #fff;
	border-color: #dcdcde;
	border-bottom-color: #fff;
}

.hr-am-panel-section {
	padding-top: 4px;
}

/* Tables */
.hr-am-table-wrap {
	overflow-x: auto;
}

.hr-am-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
}

.hr-am-table th,
.hr-am-table td {
	padding: 10px 12px;
	text-align: left;
	border-bottom: 1px solid #f0f0f1;
	vertical-align: middle;
}

.hr-am-table th {
	background: #f6f7f7;
	font-weight: 700;
	color: #1d2327;
	border-bottom: 2px solid #dcdcde;
	white-space: nowrap;
}

.hr-am-table tbody tr:hover {
	background: #f9f9f9;
}

/* Approve button (frontend) */
.hr-am-btn--approve {
	padding: 5px 14px;
	background: #2271b1;
	color: #fff;
	border: none;
	border-radius: 4px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s;
	white-space: nowrap;
}

.hr-am-btn--approve:hover {
	background: #135e96;
}

/* Workdays cell in table */
.hr-am-workdays-cell {
	display: inline-block;
	min-width: 28px;
	padding: 2px 8px;
	background: #e8f0fa;
	color: #135e96;
	border-radius: 10px;
	font-weight: 700;
	font-size: 12px;
	text-align: center;
}

/* =========================================================
   Shared admin pieces (backend + frontend)
   ========================================================= */

.hr-am-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 10px;
	padding: 1px 7px;
	font-size: 11px;
	font-weight: 700;
	line-height: 16px;
	min-width: 20px;
	vertical-align: middle;
}

.hr-am-badge--red   { background: #d63638; color: #fff; }
.hr-am-badge--green { background: #00a32a; color: #fff; }

/* Backend WP admin badge margin */
.hr-am-admin .hr-am-badge { margin-left: 4px; }

.hr-am-reason-tag {
	display: inline-block;
	padding: 2px 10px;
	border-radius: 12px;
	font-size: 12px;
	font-weight: 600;
	background: #e0e0e0;
	color: #333;
	white-space: nowrap;
}

.hr-am-reason-tag--vacation      { background: #cce5ff; color: #004085; }
.hr-am-reason-tag--ferie_fridage { background: #d4edda; color: #155724; }
.hr-am-reason-tag--maternity     { background: #f8d7da; color: #721c24; }
.hr-am-reason-tag--sick          { background: #fff3cd; color: #856404; }

.hr-am-approved-badge {
	color: #00a32a;
	font-weight: 600;
	font-size: 13px;
	white-space: nowrap;
}

.hr-am-admin .hr-am-tab-panel { padding-top: 20px; }

/* =========================================================
   Edit button (frontend)
   ========================================================= */

.hr-am-btn--edit {
	padding: 5px 14px;
	background: #fff;
	color: #2271b1;
	border: 1px solid #2271b1;
	border-radius: 4px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s, color 0.15s;
	white-space: nowrap;
}

.hr-am-btn--edit:hover {
	background: #2271b1;
	color: #fff;
}

.hr-am-btn--cancel {
	padding: 10px 20px;
	background: #fff;
	color: #50575e;
	border: 1px solid #b5bcc2;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s, border-color 0.15s;
}

.hr-am-btn--cancel:hover {
	background: #f6f7f7;
	border-color: #787c82;
}

.hr-am-actions-cell {
	white-space: nowrap;
	display: flex;
	gap: 6px;
	align-items: center;
	flex-wrap: nowrap;
}

/* =========================================================
   Search filter bar
   ========================================================= */

.hr-am-filter-bar {
	display: flex;
	gap: 10px;
	margin-bottom: 12px;
	flex-wrap: wrap;
	align-items: center;
}

.hr-am-filter-bar input[type="text"],
.hr-am-filter-bar select {
	padding: 7px 10px;
	border: 1px solid #b5bcc2;
	border-radius: 5px;
	font-size: 13px;
	color: #1d2327;
	background: #fafafa;
	transition: border-color 0.15s, box-shadow 0.15s;
	box-sizing: border-box;
}

.hr-am-filter-bar input[type="text"] {
	min-width: 200px;
	flex: 1 1 200px;
}

.hr-am-filter-bar select {
	min-width: 150px;
}

.hr-am-filter-bar input[type="text"]:focus,
.hr-am-filter-bar select:focus {
	outline: none;
	border-color: #2271b1;
	background: #fff;
	box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.15);
}

/* =========================================================
   Edit modal overlay
   ========================================================= */

.hr-am-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 100000;
	padding: 20px;
	box-sizing: border-box;
}

.hr-am-modal {
	background: #fff;
	border-radius: 10px;
	box-shadow: 0 8px 40px rgba(0, 0, 0, 0.22);
	width: 100%;
	max-width: 520px;
	max-height: 90vh;
	overflow-y: auto;
	box-sizing: border-box;
}

.hr-am-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 24px 14px;
	border-bottom: 1px solid #dcdcde;
}

.hr-am-modal-header h3 {
	margin: 0;
	font-size: 17px;
	font-weight: 700;
	color: #1d2327;
}

.hr-am-modal-close {
	background: none;
	border: none;
	font-size: 22px;
	line-height: 1;
	color: #787c82;
	cursor: pointer;
	padding: 2px 6px;
	border-radius: 4px;
	transition: color 0.15s, background 0.15s;
}

.hr-am-modal-close:hover {
	color: #1d2327;
	background: #f0f0f1;
}

.hr-am-modal-form {
	padding: 20px 24px;
}

.hr-am-modal-footer {
	display: flex;
	gap: 10px;
	margin-top: 8px;
	padding-top: 16px;
	border-top: 1px solid #f0f0f1;
}

.hr-am-modal-footer .hr-am-btn--primary {
	flex: 1;
}
