/* ==========================================================================
   Media Restriction — Admin Styles v2.0.0
   ========================================================================== */

/* ── Reset / base ──────────────────────────────────────────────────────── */
.mr-wrap * { box-sizing: border-box; }
.mr-wrap { max-width: 960px; margin: 20px 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }

/* ── Header ────────────────────────────────────────────────────────────── */
.mr-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
	background: #fff;
	border: 1px solid #e2e4e7;
	border-radius: 10px;
	padding: 20px 24px;
	margin-bottom: 4px;
}
.mr-header-inner { display: flex; align-items: center; gap: 14px; }
.mr-header-icon { font-size: 28px; width: 28px; height: 28px; color: #2271b1; flex-shrink: 0; }
.mr-header-title { margin: 0; font-size: 20px; font-weight: 600; color: #1d2327; }
.mr-header-sub { margin: 2px 0 0; font-size: 13px; color: #646970; }
.mr-header-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Badges */
.mr-badge {
	display: inline-flex;
	align-items: center;
	padding: 3px 10px;
	border-radius: 20px;
	font-size: 12px;
	font-weight: 500;
	line-height: 1.5;
}
.mr-badge--version { background: #f0f6fc; color: #2271b1; border: 1px solid #c3d4e4; }
.mr-badge--stat    { background: #f6f7f7; color: #50575e; border: 1px solid #dcdcde; }

/* ── Tab nav ───────────────────────────────────────────────────────────── */
.mr-tabs {
	display: flex;
	gap: 2px;
	background: #f6f7f7;
	border: 1px solid #e2e4e7;
	border-radius: 10px;
	padding: 4px;
	margin: 12px 0;
}
.mr-tab {
	display: flex;
	align-items: center;
	gap: 7px;
	padding: 8px 16px;
	border-radius: 7px;
	font-size: 13px;
	font-weight: 500;
	color: #50575e;
	text-decoration: none;
	transition: background 0.15s, color 0.15s;
}
.mr-tab:hover { background: #fff; color: #2271b1; text-decoration: none; }
.mr-tab.is-active { background: #fff; color: #2271b1; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.mr-tab .dashicons { font-size: 16px; width: 16px; height: 16px; }
.mr-tab-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: #2271b1;
	color: #fff;
	font-size: 10px;
	font-weight: 600;
	border-radius: 10px;
	padding: 1px 6px;
	min-width: 18px;
}

/* ── Cards ─────────────────────────────────────────────────────────────── */
.mr-card {
	background: #fff;
	border: 1px solid #e2e4e7;
	border-radius: 10px;
	margin-bottom: 16px;
	overflow: hidden;
}
.mr-card-header {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	padding: 20px 24px 16px;
	border-bottom: 1px solid #f0f0f0;
}
.mr-card-icon { font-size: 22px; width: 22px; height: 22px; color: #2271b1; margin-top: 2px; flex-shrink: 0; }
.mr-card-title { margin: 0 0 3px; font-size: 15px; font-weight: 600; color: #1d2327; }
.mr-card-desc { margin: 0; font-size: 13px; color: #646970; }
.mr-card-actions { margin-left: auto; flex-shrink: 0; }

/* ── Role grid ─────────────────────────────────────────────────────────── */
.mr-role-grid {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 200px, 1fr ) );
	gap: 12px;
	padding: 20px 24px;
}
.mr-role-card {
	border: 1px solid #e2e4e7;
	border-radius: 8px;
	padding: 14px 16px;
	transition: border-color 0.15s, box-shadow 0.15s;
	background: #fcfcfc;
}
.mr-role-card.is-restricted {
	border-color: #2271b1;
	background: #f0f6fc;
}
.mr-role-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.mr-role-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mr-role-name { font-size: 13px; font-weight: 600; color: #1d2327; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mr-role-count { font-size: 11px; color: #8c8f94; }
.mr-role-status { display: flex; align-items: center; gap: 6px; }
.mr-status-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.mr-status-dot.is-on { background: #00a32a; }
.mr-status-dot.is-off { background: #c3c4c7; }
.mr-status-label { font-size: 11px; color: #646970; }

/* ── Toggle switch ─────────────────────────────────────────────────────── */
.mr-toggle { position: relative; display: inline-block; cursor: pointer; flex-shrink: 0; }
.mr-toggle-input { position: absolute; opacity: 0; width: 0; height: 0; }
.mr-toggle-track {
	display: block;
	width: 38px;
	height: 22px;
	background: #c3c4c7;
	border-radius: 11px;
	transition: background 0.2s;
	position: relative;
}
.mr-toggle-input:checked ~ .mr-toggle-track { background: #2271b1; }
.mr-toggle-thumb {
	position: absolute;
	top: 3px;
	left: 3px;
	width: 16px;
	height: 16px;
	background: #fff;
	border-radius: 50%;
	transition: left 0.2s;
	box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.mr-toggle-input:checked ~ .mr-toggle-track .mr-toggle-thumb { left: 19px; }
.mr-toggle-input:focus ~ .mr-toggle-track { outline: 2px solid #2271b1; outline-offset: 2px; }

/* ── Excluded users select ─────────────────────────────────────────────── */
.mr-select-wrap { padding: 16px 24px 20px; }

/* ── Actions bar ───────────────────────────────────────────────────────── */
.mr-actions { display: flex; align-items: center; gap: 14px; padding: 4px 0 20px; }
.mr-save-status { font-size: 13px; color: #00a32a; font-weight: 500; opacity: 0; transition: opacity 0.3s; }
.mr-save-status.is-visible { opacity: 1; }

/* ── Buttons ───────────────────────────────────────────────────────────── */
.mr-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 16px;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 500;
	border: 1px solid transparent;
	cursor: pointer;
	text-decoration: none;
	transition: background 0.15s, border-color 0.15s, color 0.15s;
	line-height: 1.4;
}
.mr-btn .dashicons { font-size: 15px; width: 15px; height: 15px; }
.mr-btn--primary { background: #2271b1; color: #fff; border-color: #2271b1; }
.mr-btn--primary:hover { background: #135e96; border-color: #135e96; color: #fff; }
.mr-btn--ghost { background: transparent; color: #646970; border-color: #dcdcde; }
.mr-btn--ghost:hover { background: #f6f7f7; color: #1d2327; }
.mr-btn--danger { background: #fff; color: #d63638; border-color: #d63638; }
.mr-btn--danger:hover { background: #d63638; color: #fff; }

/* ── Folders ───────────────────────────────────────────────────────────── */
.mr-folder-create {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 16px 24px;
	border-bottom: 1px solid #f0f0f0;
}
.mr-folder-create input.regular-text { flex: 1; max-width: 360px; }

.mr-folder-list { padding: 8px 24px 20px; display: flex; flex-direction: column; gap: 10px; }

.mr-folder-item {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	padding: 14px 16px;
	border: 1px solid #e2e4e7;
	border-radius: 8px;
	background: #fcfcfc;
	transition: border-color 0.15s;
}
.mr-folder-item:hover { border-color: #c3d4e4; }
.mr-folder-item-left { display: flex; align-items: flex-start; gap: 12px; }
.mr-folder-icon { font-size: 20px; width: 20px; height: 20px; color: #f0b429; margin-top: 1px; flex-shrink: 0; }
.mr-folder-info { display: flex; flex-direction: column; gap: 2px; }
.mr-folder-name { font-size: 14px; color: #1d2327; }
.mr-folder-count { font-size: 11px; color: #8c8f94; }
.mr-folder-item-right { display: flex; align-items: flex-start; gap: 16px; }
.mr-folder-roles { display: flex; flex-direction: column; gap: 6px; }
.mr-folder-roles-label { font-size: 11px; color: #8c8f94; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.mr-folder-role-checks { display: flex; flex-wrap: wrap; gap: 10px; }
.mr-check-label { display: flex; align-items: center; gap: 5px; font-size: 12px; color: #1d2327; cursor: pointer; }
.mr-check-label input[type="checkbox"] { margin: 0; }
.mr-empty-state { text-align: center; padding: 40px 20px; color: #8c8f94; }
.mr-empty-state p { margin: 10px 0 0; font-size: 13px; }
.mr-info-box {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	background: #f0f6fc;
	border: 1px solid #c3d4e4;
	border-radius: 8px;
	padding: 14px 18px;
	font-size: 13px;
	color: #2271b1;
	margin-bottom: 16px;
}
.mr-info-box .dashicons { flex-shrink: 0; margin-top: 1px; }

/* ── Activity log ──────────────────────────────────────────────────────── */
.mr-log-table-wrap { overflow-x: auto; }
.mr-log-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mr-log-table th {
	text-align: left;
	padding: 10px 16px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: #8c8f94;
	border-bottom: 1px solid #f0f0f0;
	background: #f9f9f9;
	white-space: nowrap;
}
.mr-log-table td {
	padding: 10px 16px;
	border-bottom: 1px solid #f6f7f7;
	color: #1d2327;
	vertical-align: middle;
}
.mr-log-table tr:last-child td { border-bottom: none; }
.mr-log-table tr:hover td { background: #f9f9f9; }

.mr-action-badge {
	display: inline-block;
	padding: 2px 9px;
	border-radius: 20px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .04em;
}
.mr-action-badge--success { background: #edfaef; color: #00a32a; }
.mr-action-badge--danger  { background: #fcf0f1; color: #d63638; }
.mr-action-badge--info    { background: #f0f6fc; color: #2271b1; }

.mr-log-user { display: flex; align-items: center; gap: 7px; }
.mr-log-avatar { border-radius: 50%; vertical-align: middle; }
.mr-log-file a { color: #2271b1; text-decoration: none; }
.mr-log-file a:hover { text-decoration: underline; }
.mr-log-ip { font-family: monospace; font-size: 12px; color: #646970; }
.mr-log-date { white-space: nowrap; color: #646970; font-size: 12px; }

/* ── Toast ─────────────────────────────────────────────────────────────── */
.mr-toast {
	position: fixed;
	bottom: 32px;
	right: 28px;
	padding: 11px 20px;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 500;
	color: #fff;
	box-shadow: 0 4px 16px rgba(0,0,0,.18);
	z-index: 99999;
	opacity: 0;
	transform: translateY(8px);
	pointer-events: none;
	transition: opacity .25s, transform .25s;
	max-width: 340px;
}
.mr-toast.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.mr-toast--success { background: #00a32a; }
.mr-toast--error   { background: #d63638; }
.mr-toast--info    { background: #2271b1; }

/* ── Select2 customisation ─────────────────────────────────────────────── */
.select2-container { width: 100% !important; max-width: 560px; }
.select2-container--default .select2-selection--multiple {
	border: 1px solid #8c8f94;
	border-radius: 4px;
	min-height: 36px;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice {
	background: #f0f6fc;
	border: 1px solid #c3d4e4;
	border-radius: 4px;
	color: #2271b1;
	padding: 2px 8px;
	margin: 4px 4px 0 0;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove { color: #2271b1; margin-right: 4px; }
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover { color: #d63638; }
.select2-dropdown { border: 1px solid #8c8f94; border-radius: 4px; }
.select2-container--default .select2-results__option--highlighted[aria-selected] { background: #2271b1; }
