.ldm-notice {
	padding: 12px 16px;
	background: #f4f6fb;
	border-left: 4px solid #b8934f;
	border-radius: 6px;
	color: #33415c;
}

.ldm-documents {
	--ldm-accent: #b8934f;
	--ldm-accent-dark: #96762e;
	--ldm-navy: #0f1c3d;
	--ldm-navy-dark: #0a1329;
	--ldm-text: #1f2430;
	--ldm-muted: #6b7280;
	--ldm-border: #e6e8ef;
	--ldm-surface: #ffffff;

	width: 100%;
	box-sizing: border-box;
	margin: 1.5em 0;
}

.ldm-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 14px;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
	border: 1px solid transparent;
	cursor: pointer;
	line-height: 1.4;
	white-space: nowrap;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.ldm-btn .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
}

.ldm-btn--primary {
	background: var( --ldm-accent );
	color: #fff;
}

.ldm-btn--primary:hover {
	background: var( --ldm-accent-dark );
	color: #fff;
}

.ldm-btn--ghost {
	background: #f4f5fa;
	color: var( --ldm-text );
	border-color: var( --ldm-border );
}

.ldm-btn--ghost:hover {
	background: #eceefa;
	color: var( --ldm-text );
}

.ldm-btn--outline {
	background: transparent;
	color: var( --ldm-accent );
	border-color: var( --ldm-accent );
}

.ldm-btn--outline:hover {
	background: var( --ldm-accent );
	color: #fff;
}

.ldm-item__pending {
	color: var( --ldm-muted );
	font-size: 13px;
}
/* -------------------------------------------------------------- *
 * Grid view - full-width card grid
 * -------------------------------------------------------------- */

.ldm-view-grid {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 240px, 1fr ) );
	gap: 20px;
	width: 100%;
}

.ldm-view-grid .ldm-item {
	display: flex;
	flex-direction: column;
	background: var( --ldm-surface );
	border: 1px solid var( --ldm-border );
	border-radius: 14px;
	overflow: hidden;
	box-shadow: 0 1px 2px rgba( 16, 24, 40, 0.04 );
	transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.ldm-view-grid .ldm-item:hover {
	box-shadow: 0 8px 24px rgba( 16, 24, 40, 0.08 );
	transform: translateY( -2px );
}

.ldm-view-grid .ldm-item__thumb {
	aspect-ratio: 16 / 9;
	background: linear-gradient( 135deg, #f6efe0, #fdfaf4 );
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.ldm-view-grid .ldm-item__body {
	padding: 16px 18px 4px;
	flex: 1;
}

.ldm-view-grid .ldm-item__title {
	margin: 0 0 6px;
	font-size: 16px;
}

.ldm-view-grid .ldm-item__desc {
	margin: 0;
	font-size: 13.5px;
}

.ldm-view-grid .ldm-item__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 14px 18px 18px;
}

/* Access panel spans the full grid row, under whichever card opened it. */
.ldm-view-grid .ldm-access-panel {
	grid-column: 1 / -1;
}

/* -------------------------------------------------------------- *
 * List view - compact, professional rows
 * -------------------------------------------------------------- */

.ldm-view-list {
	display: flex;
	flex-direction: column;
	background: var( --ldm-surface );
	border: 1px solid var( --ldm-border );
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 1px 2px rgba( 16, 24, 40, 0.04 );
}

.ldm-view-list .ldm-item {
	display: grid;
	grid-template-columns: 52px minmax( 0, 1fr ) auto;
	align-items: center;
	gap: 16px;
	padding: 14px 18px;
	border-bottom: 1px solid var( --ldm-border );
	background: var( --ldm-surface );
	transition: background-color 0.12s ease;
}

.ldm-view-list .ldm-item:last-child {
	border-bottom: none;
}

.ldm-view-list .ldm-item:nth-child( even ) {
	background: #faf8f2;
}

.ldm-view-list .ldm-item:hover {
	background: #f6efe0;
}

.ldm-view-list .ldm-item__thumb {
	width: 52px;
	height: 52px;
	border-radius: 10px;
	background: linear-gradient( 135deg, #f6efe0, #fdfaf4 );
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.ldm-view-list .ldm-item__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	margin: 0;
}

.ldm-view-list .ldm-item__thumb .dashicons {
	font-size: 22px;
	width: 22px;
	height: 22px;
}

.ldm-view-list .ldm-item__body {
	min-width: 0;
}

.ldm-view-list .ldm-item__title {
	margin: 0 0 2px;
	font-size: 14.5px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	display: block;
}

.ldm-view-list .ldm-item__desc {
	margin: 0;
	font-size: 12.5px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	display: block;
}

.ldm-view-list .ldm-item__actions {
	display: flex;
	gap: 8px;
}

@media ( max-width: 640px ) {
	.ldm-view-list .ldm-item {
		grid-template-columns: 52px 1fr;
		grid-template-areas: "thumb body" "actions actions";
		row-gap: 10px;
	}
	.ldm-view-list .ldm-item__thumb {
		grid-area: thumb;
	}
	.ldm-view-list .ldm-item__body {
		grid-area: body;
	}
	.ldm-view-list .ldm-item__actions {
		grid-area: actions;
		flex-wrap: wrap;
	}
	.ldm-view-list .ldm-item__title,
	.ldm-view-list .ldm-item__desc {
		white-space: normal;
	}
}

/* Shared thumbnail internals (image or icon) */
.ldm-item__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	margin: 0;
}

.ldm-item__thumb .dashicons {
	color: var( --ldm-accent );
	opacity: 0.75;
}

.ldm-view-grid .ldm-item__thumb .dashicons {
	font-size: 44px;
	width: 44px;
	height: 44px;
}
/* -------------------------------------------------------------- *
 * Inline "Manage Access" accordion panel (replaces the old popup)
 * -------------------------------------------------------------- */

.ldm-access-panel {
	background: #fbf9f4;
	border: 1px solid var( --ldm-border );
	border-top: 3px solid var( --ldm-navy );
	border-radius: 10px;
	margin: -8px 0 20px;
	padding: 18px 20px 20px;
	animation: ldm-panel-in 0.15s ease;
}

.ldm-view-list .ldm-access-panel {
	margin: 0 0 0;
	border-radius: 0;
	border-left: none;
	border-right: none;
}

@keyframes ldm-panel-in {
	from {
		opacity: 0;
		transform: translateY( -6px );
	}
	to {
		opacity: 1;
		transform: translateY( 0 );
	}
}

.ldm-access-heading {
	margin: 0 0 12px;
	font-size: 14px;
	color: var( --ldm-navy );
}

.ldm-access-tabs {
	display: flex;
	gap: 6px;
	margin-bottom: 14px;
	border-bottom: 1px solid var( --ldm-border );
	padding-bottom: 0;
}

.ldm-access-tab {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 14px;
	border: none;
	background: transparent;
	color: var( --ldm-muted );
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	border-radius: 8px 8px 0 0;
	border-bottom: 3px solid transparent;
	margin-bottom: -1px;
	transition: color 0.12s ease, border-color 0.12s ease;
}

.ldm-access-tab .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
}

.ldm-access-tab:hover {
	color: var( --ldm-navy );
}

.ldm-access-tab.is-active {
	color: var( --ldm-navy );
	border-bottom-color: var( --ldm-accent );
}

.ldm-access-tabpanel[hidden] {
	display: none;
}

.ldm-access-tabpanel .description {
	margin: 0 0 10px;
	color: var( --ldm-muted );
	font-size: 12.5px;
}

.ldm-access-search {
	position: relative;
	margin-bottom: 10px;
}

.ldm-access-search .dashicons {
	position: absolute;
	left: 10px;
	top: 50%;
	transform: translateY( -50% );
	color: #8a90a2;
	font-size: 16px;
}

.ldm-access-search-input,
.ldm-access-group-filter {
	width: 100%;
	box-sizing: border-box;
	padding: 8px 12px 8px 32px;
	border: 1px solid #dfe1ea;
	border-radius: 8px;
	font-size: 13px;
}

.ldm-access-group-filter {
	padding-left: 12px;
	margin-bottom: 10px;
}

.ldm-access-list {
	list-style: none;
	margin: 0;
	padding: 0;
	max-height: 260px;
	overflow-y: auto;
	border: 1px solid var( --ldm-border );
	border-radius: 8px;
	background: #fff;
}

.ldm-access-item {
	padding: 8px 12px;
	border-bottom: 1px solid #f0f1f5;
}

.ldm-access-item:last-child {
	border-bottom: none;
}

.ldm-access-item:hover {
	background: #f6efe0;
}

.ldm-access-item label {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	cursor: pointer;
	color: var( --ldm-text );
}

.ldm-access-item input[type="checkbox"],
.ldm-access-role-toggle,
.ldm-access-group-toggle {
	width: 18px;
	height: 18px;
	accent-color: var( --ldm-accent );
	flex-shrink: 0;
}

.ldm-access-item small {
	color: var( --ldm-muted );
}

.ldm-access-empty,
.ldm-access-loading {
	padding: 14px 8px;
	color: var( --ldm-muted );
	font-size: 13px;
	font-style: italic;
	text-align: center;
}

.ldm-role-list,
.ldm-access-group-list {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 180px, 1fr ) );
	gap: 4px 16px;
	max-height: 220px;
	overflow-y: auto;
}

.ldm-role-item,
.ldm-group-item {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 4px;
	font-size: 13px;
	color: var( --ldm-text );
	cursor: pointer;
}

.ldm-empty {
	color: var( --ldm-muted );
	font-size: 13px;
	font-style: italic;
}