/**
 * Styles for Asset Loan History Table
 *
 * @package AssetLendingManager
 */

.almgr-asset-view .almgr-history-table {
	width: 100%;
	font-size: 1em;
	border-collapse: separate;
	border-spacing: 0;
	margin: 1rem 0;
	background: #fff;
	border: 1px solid #d9e1e6;
	border-radius: 8px;
	overflow: hidden;
}

.almgr-asset-view .almgr-history-table thead {
	background: #f5f7fa;
}

.almgr-asset-view .almgr-history-table th {
	padding: 0.65rem 0.9rem;
	text-align: left;
	font-weight: 600;
	font-size: 1em;
	letter-spacing: 0.02em;
	color: #17324d;
	border: 0;
	border-bottom: 1px solid #d9e1e6;
}

.almgr-asset-view .almgr-history-table td {
	padding: 0.75rem 0.9rem;
	vertical-align: top;
	border: 0;
	border-bottom: 1px solid #e8edf1;
}

.almgr-asset-view .almgr-history-table th + th {
	border-left: 1px solid #e8edf2;
}

.almgr-asset-view .almgr-history-table td + td {
	border-left: 1px solid #f1f4f7;
}

.almgr-asset-view .almgr-history-table thead th:nth-child(1),
.almgr-asset-view .almgr-history-table thead th:nth-child(2) {
	width: 16%;
}

.almgr-asset-view .almgr-history-table thead th:nth-child(3),
.almgr-asset-view .almgr-history-table thead th:nth-child(4) {
	width: 14%;
}

.almgr-asset-view .almgr-history-table thead th:nth-child(5) {
	width: 40%;
}

.almgr-asset-view .almgr-history-table tbody tr:nth-child(even) {
	background: #fbfcfd;
}

.almgr-asset-view .almgr-history-table tbody tr:last-child td {
	border-bottom: 0;
}

.almgr-history-requester,
.almgr-history-changed-by {
	font-weight: 600;
	color: #12263a;
}

.almgr-history-request-date {
	white-space: nowrap;
	color: #4f6376;
	font-size: 1em;
}

.almgr-history-status {
	min-width: 8.5rem;
}

.almgr-status-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.3rem 0.75rem;
	border-radius: 999px;
	font-size: 1em;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	line-height: 1.2;
}

.almgr-status-badge::before {
	content: '';
	display: inline-block;
	width: 0.45rem;
	height: 0.45rem;
	margin-right: 0.4rem;
	border-radius: 50%;
	background: currentColor;
	opacity: 0.85;
}

.almgr-status-badge.almgr-status--pending {
	background-color: var(--almgr-status-pending-bg);
	color: var(--almgr-status-pending-text);
}

.almgr-status-badge.almgr-status--approved {
	background-color: var(--almgr-status-approved-bg);
	color: var(--almgr-status-approved-text);
}

.almgr-status-badge.almgr-status--rejected {
	background-color: var(--almgr-status-rejected-bg);
	color: var(--almgr-status-rejected-text);
}

.almgr-status-badge.almgr-status--canceled {
	background-color: var(--almgr-status-canceled-bg);
	color: var(--almgr-status-canceled-text);
}

.almgr-status-badge.almgr-status--direct_assign {
	background-color: var(--almgr-status-direct-assign-bg);
	color: var(--almgr-status-direct-assign-text);
}

.almgr-status-badge.almgr-status--to_maintenance {
	background-color: var(--almgr-status-to-maintenance-bg);
	color: var(--almgr-status-to-maintenance-text);
}

.almgr-status-badge.almgr-status--to_retired {
	background-color: var(--almgr-status-to-retired-bg);
	color: var(--almgr-status-to-retired-text);
}

.almgr-status-badge.almgr-status--to_available {
	background-color: var(--almgr-status-to-available-bg);
	color: var(--almgr-status-to-available-text);
}

.almgr-history-message {
	max-width: 36rem;
}

.almgr-message-toggle {
	cursor: pointer;
	font-size: 1em;
	font-weight: 600;
	color: #0066cc;
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
}

.almgr-message-toggle::-webkit-details-marker {
	display: none;
}

.almgr-message-toggle::before {
	content: '+';
	font-size: 0.95rem;
	line-height: 1;
}

.almgr-message-details[open] .almgr-message-toggle::before {
	content: '-';
}

.almgr-message-toggle-open {
	display: inline;
}

.almgr-message-toggle-close {
	display: none;
}

.almgr-message-details[open] .almgr-message-toggle-open {
	display: none;
}

.almgr-message-details[open] .almgr-message-toggle-close {
	display: inline;
}

.almgr-message-full {
	margin-top: 0.5rem;
	padding: 0.6rem 0.7rem;
	background: #f5f9ff;
	border: 1px solid #d7e6ff;
	border-radius: 6px;
	line-height: 1.45;
	color: #17324d;
	white-space: pre-wrap;
	word-break: break-word;
}

.almgr-history-limit-notice {
	display: block;
	padding: 0.8rem 1rem;
	background: #e9f3ff;
	border-left: 4px solid #0066cc;
	margin-bottom: 0.9rem;
	font-size: 1em;
	color: #1f3347;
}

.almgr-history-limit-notice strong {
	color: #0050a3;
}

.almgr-history-empty {
	text-align: center;
	padding: 2rem 1rem;
	color: #5b6f82;
}

@media (max-width: 900px) {
	.almgr-asset-view .almgr-history-table th,
	.almgr-asset-view .almgr-history-table td {
		padding: 0.75rem 0.8rem;
	}
}

@media (max-width: 768px) {
	.almgr-asset-view .almgr-history-table thead {
		display: none;
	}

	.almgr-asset-view .almgr-history-table,
	.almgr-asset-view .almgr-history-table tbody,
	.almgr-asset-view .almgr-history-table tr,
	.almgr-asset-view .almgr-history-table td {
		display: block;
		width: 100%;
	}

	.almgr-asset-view .almgr-history-table {
		border: 0;
		background: transparent;
	}

	.almgr-asset-view .almgr-history-table tr {
		margin-bottom: 0.85rem;
		font-size: 1em;
		background: #fff;
		border: 1px solid #d9e1e6;
		border-radius: 8px;
		overflow: hidden;
	}

	.almgr-asset-view .almgr-history-table td {
		position: relative;
		padding: 0.8rem 0.8rem 0.8rem 8.5rem;
		border-bottom: 1px solid #edf2f6;
		border-left: 0;
		min-height: 2.8rem;
	}

	.almgr-asset-view .almgr-history-table td + td {
		border-left: 0;
	}

	.almgr-asset-view .almgr-history-table td:last-child {
		border-bottom: 0;
	}

	.almgr-asset-view .almgr-history-table td::before {
		content: attr(data-label);
		position: absolute;
		left: 0.8rem;
		top: 0.8rem;
		width: 7.2rem;
		font-size: 1em;
		font-weight: 700;
		letter-spacing: 0.03em;
		color: #4f6376;
		text-transform: uppercase;
	}

	.almgr-history-status,
	.almgr-history-request-date {
		white-space: normal;
	}
}
