/* =============================================================================
   Agency Pulse — Admin Menu Organizer
   Builder page styles
   ============================================================================= */

/* -----------------------------------------------------------------------------
   Wrapper
   ----------------------------------------------------------------------------- */

.aamo-wrap {
	max-width: 900px;
}

.aamo-page-title {
	margin-bottom: 16px;
}

/* -----------------------------------------------------------------------------
   Config selector toolbar
   ----------------------------------------------------------------------------- */

.aamo-config-toolbar {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	padding: 12px 16px;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 3px 3px 0 0;
	border-bottom: none;
}

.aamo-config-label {
	font-weight: 600;
	color: #3c434a;
}

.aamo-config-select {
	min-width: 180px;
}

.aamo-btn-danger {
	color: #b32d2e !important;
	border-color: #b32d2e !important;
}

.aamo-btn-danger:hover:not([disabled]) {
	background: #b32d2e !important;
	color: #fff !important;
}

.aamo-btn-danger[disabled] {
	opacity: 0.5;
	cursor: not-allowed;
}

/* -----------------------------------------------------------------------------
   Save / action toolbar
   ----------------------------------------------------------------------------- */

.aamo-page-toolbar {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	padding: 10px 16px;
	background: #f6f7f7;
	border: 1px solid #ddd;
	border-radius: 0;
	border-bottom: 2px solid #c3c4c7;
	margin-bottom: 0;
}

.aamo-status {
	margin-left: 4px;
	font-style: italic;
	color: #646970;
	font-size: 13px;
}

/* -----------------------------------------------------------------------------
   Sortable list
   ----------------------------------------------------------------------------- */

.aamo-sortable,
.aamo-submenu-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.aamo-sortable {
	border: 1px solid #ddd;
	border-top: none;
	border-radius: 0 0 3px 3px;
	background: #f6f7f7;
}

/* -----------------------------------------------------------------------------
   Menu item rows
   ----------------------------------------------------------------------------- */

.aamo-menu-item {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	column-gap: 6px;
	row-gap: 0;
	padding: 7px 10px;
	background: #fff;
	border-bottom: 1px solid #e5e5e5;
	min-height: 40px;
	position: relative;
}

.aamo-menu-item:last-child {
	border-bottom: none;
}

.aamo-menu-item:hover {
	background: #f0f6fc;
}

/* Sub-item rows */
.aamo-submenu-item {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 7px 10px 7px 0;
	background: #fafafa;
	border-bottom: 1px solid #ececec;
	min-height: 40px;
}

.aamo-submenu-item:last-child {
	border-bottom: none;
}

.aamo-submenu-item:hover {
	background: #f0f6fc;
}

/* -----------------------------------------------------------------------------
   Drag handle
   ----------------------------------------------------------------------------- */

.aamo-handle {
	color: #c3c4c7;
	cursor: grab;
	flex-shrink: 0;
	font-size: 18px;
	width: 20px;
	height: 20px;
}

.aamo-handle:active {
	cursor: grabbing;
}

.aamo-menu-item.ui-sortable-helper .aamo-handle,
.aamo-submenu-item.ui-sortable-helper .aamo-handle {
	cursor: grabbing;
}

/* -----------------------------------------------------------------------------
   Expand arrow
   ----------------------------------------------------------------------------- */

.aamo-expand-btn {
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
	width: 22px;
	height: 22px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	border-radius: 3px;
}

.aamo-expand-btn:hover {
	background: #e5e5e5;
}

.aamo-expand-btn .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
	color: #787c82;
	transition: transform 0.2s ease;
}

.aamo-menu-item.aamo-expanded > .aamo-expand-btn .dashicons {
	transform: rotate(90deg);
}

/* Placeholder keeps alignment on items with no sub-items */
.aamo-expand-placeholder {
	display: inline-block;
	width: 22px;
	flex-shrink: 0;
}

/* -----------------------------------------------------------------------------
   Item icon
   ----------------------------------------------------------------------------- */

.aamo-item-icon {
	flex-shrink: 0;
	width: 20px;
	height: 20px;
	font-size: 18px;
	color: #787c82;
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}

/* Original-icon restore indicator — shown to the right of the icon when customised */
.aamo-original-icon {
	flex-shrink: 0;
	width: 14px;
	height: 14px;
	font-size: 12px;
	color: #8c8f94;
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	opacity: 0.65;
	cursor: pointer;
}

.aamo-original-icon:hover {
	color: #2271b1;
	opacity: 1;
}

/* =============================================================================
   Icon picker modal
   ============================================================================= */

.aamo-icon-picker {
	display: none;
	position: fixed;
	z-index: 100000;
	width: 340px;
	background: #fff;
	border: 1px solid #ccd0d4;
	border-radius: 4px;
	box-shadow: 0 4px 20px rgba(0,0,0,.18);
	flex-direction: column;
}

.aamo-icon-picker.is-open {
	display: flex;
}

.aamo-icon-picker-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 12px 8px;
	border-bottom: 1px solid #f0f0f1;
}

.aamo-icon-picker-title {
	font-size: 13px;
	font-weight: 600;
	color: #1d2327;
}

.aamo-icon-picker-close {
	background: none;
	border: none;
	padding: 0;
	line-height: 1;
	font-size: 18px;
	color: #787c82;
	cursor: pointer;
	width: 24px;
	height: 24px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 3px;
}

.aamo-icon-picker-close:hover {
	background: #f0f0f1;
	color: #1d2327;
}

.aamo-icon-picker-search-wrap {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 8px 10px;
	border-bottom: 1px solid #f0f0f1;
}

.aamo-icon-picker-search-icon {
	flex-shrink: 0;
	color: #787c82;
	font-size: 16px;
	width: 16px;
	height: 16px;
}

#aamo-icon-search {
	flex: 1;
	border: 1px solid #ddd;
	border-radius: 3px;
	padding: 4px 6px;
	font-size: 12px;
	min-width: 0;
}

#aamo-icon-search:focus {
	outline: none;
	border-color: #2271b1;
	box-shadow: 0 0 0 1px #2271b1;
}

.aamo-icon-picker-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 2px;
	padding: 8px;
	overflow-y: auto;
	max-height: 260px;
}

.aamo-icon-cell {
	width: 34px;
	height: 34px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 3px;
	cursor: pointer;
	background: none;
	border: 1px solid transparent;
	padding: 0;
	color: #50575e;
	font-size: 18px;
}

.aamo-icon-cell:hover {
	background: #f0f6fc;
	color: #2271b1;
	border-color: #b3d4e8;
}

.aamo-icon-cell.is-selected {
	background: #e8f0fb;
	border-color: #2271b1;
	color: #2271b1;
}

.aamo-icon-cell.is-hidden {
	display: none;
}

/* -----------------------------------------------------------------------------
   Item title and slug badge
   ----------------------------------------------------------------------------- */

.aamo-title-group {
	flex: 1;
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 4px;
	min-width: 0;
}

.aamo-item-title {
	flex: 1;
	min-width: 0;
	font-size: 13px;
	font-weight: 500;
	color: #3c434a;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.aamo-original-title {
	flex-shrink: 0;
	font-size: 11px;
	color: #8c8f94;
	white-space: nowrap;
	cursor: pointer;
}

.aamo-original-title::before {
	content: "(";
}

.aamo-original-title::after {
	content: ")";
}

.aamo-original-title:hover {
	color: #2271b1;
	text-decoration: underline;
}

/* Hide the original-title hint while a label is actively being edited */
.aamo-editing .aamo-original-title {
	display: none;
}

.aamo-label-input {
	padding: 1px 4px;
	font-size: 13px;
	border: 1px solid #2271b1;
	border-radius: 3px;
	box-shadow: 0 0 0 1px #2271b1;
	outline: none;
}

.aamo-label-input-wrap {
	position: relative;
	display: inline-flex;
	align-items: center;
	align-self: flex-start;
}

.aamo-label-confirm {
	position: absolute;
	right: -8px;
	bottom: -8px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #00a32a;
	color: #fff;
	border: 2px solid #fff;
	font-size: 10px;
	font-weight: bold;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	cursor: pointer;
	z-index: 1;
	flex-shrink: 0;
}

.aamo-label-confirm:hover {
	background: #008a20;
}

/* Edit pencil button — shown on row hover, hidden during active edit */
.aamo-label-edit-btn {
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
	width: 20px;
	height: 20px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	border-radius: 3px;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.1s;
}

.aamo-label-edit-btn .dashicons {
	font-size: 14px;
	width: 14px;
	height: 14px;
	color: #787c82;
}

.aamo-menu-item:hover .aamo-label-edit-btn,
.aamo-submenu-item:hover .aamo-label-edit-btn {
	opacity: 1;
	pointer-events: auto;
}

.aamo-label-edit-btn:hover .dashicons {
	color: #2271b1;
}

/* Hide edit button while the row is in active edit mode */
.aamo-editing .aamo-label-edit-btn {
	opacity: 0 !important;
	pointer-events: none !important;
}

.aamo-item-slug {
	font-size: 11px;
	font-family: Consolas, Monaco, monospace;
	color: #b3b3b3;
	white-space: nowrap;
	flex-shrink: 0;
}

/* -----------------------------------------------------------------------------
   Visibility toggle
   ----------------------------------------------------------------------------- */

.aamo-visibility-btn {
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	border-radius: 3px;
	margin-left: auto;
}

.aamo-visibility-btn:hover {
	background: #e5e5e5;
}

.aamo-visibility-btn .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
	color: #b3b9bf;
}

.aamo-visibility-btn:hover .dashicons {
	color: #3c434a;
}

/* -----------------------------------------------------------------------------
   Hidden item state
   ----------------------------------------------------------------------------- */

.aamo-item-hidden .aamo-item-title {
	opacity: 0.45;
	text-decoration: line-through;
}

.aamo-item-hidden .aamo-item-icon {
	opacity: 0.35;
}

.aamo-item-hidden .aamo-visibility-btn .dashicons {
	color: #c3c4c7;
}

/* -----------------------------------------------------------------------------
   Sub-item list
   ----------------------------------------------------------------------------- */

.aamo-submenu-list {
	flex-basis: 100%;
	width: 100%;
	margin-top: 0;
	padding-left: 73px;
	background: #fafafa;
	border-top: 1px solid #ececec;
}

/* Collapsed state — toggled by Phase 6 JS */
.aamo-submenu-list.aamo-collapsed {
	display: none;
}

/* -----------------------------------------------------------------------------
   Separator rows
   ----------------------------------------------------------------------------- */

.aamo-separator {
	background: #f6f7f7 !important;
	min-height: 28px;
	padding: 4px 10px;
}

.aamo-separator-line {
	flex: 1;
	height: 1px;
	background: #c3c4c7;
}

.aamo-separator .aamo-item-slug {
	color: #c3c4c7;
}

/* -----------------------------------------------------------------------------
   Custom container rows
   ----------------------------------------------------------------------------- */

.aamo-custom-container {
	background: #f0f6fc !important;
	border-left: 3px solid #0073aa;
}

.aamo-item-locked,
.aamo-subitem-locked {
	opacity: 0.7;
}
.aamo-item-locked .aamo-label-edit-btn,
.aamo-item-locked .aamo-visibility-btn,
.aamo-subitem-locked .aamo-label-edit-btn,
.aamo-subitem-locked .aamo-visibility-btn,
.aamo-subitem-locked .aamo-handle {
	display: none !important;
}
.aamo-subitem-locked {
	cursor: default;
}

.aamo-container-badge {
	font-size: 10px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #0073aa;
	background: #e5f0f7;
	border: 1px solid #b3d4e8;
	border-radius: 3px;
	padding: 1px 5px;
	flex-shrink: 0;
	line-height: 1.6;
}

.aamo-remove-container-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	padding: 0;
	margin-left: auto;
	border: 1px solid #d63638;
	border-radius: 50%;
	background: #fff;
	color: #d63638;
	cursor: pointer;
	flex-shrink: 0;
	transition: background 0.15s;
}
.aamo-remove-container-btn:hover {
	background: #fdf2f2;
}
.aamo-remove-container-btn .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
	line-height: 1;
}

/* -----------------------------------------------------------------------------
   Sortable drag placeholder
   ----------------------------------------------------------------------------- */

.aamo-sortable-placeholder {
	height: 40px;
	border: 2px dashed #0073aa;
	background: #e8f4fd;
	border-radius: 3px;
	list-style: none;
}

.aamo-submenu-list .aamo-sortable-placeholder {
	height: 34px;
}

/* -----------------------------------------------------------------------------
   Role Assignments page
   ----------------------------------------------------------------------------- */

.aamo-config-card {
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 3px;
	padding: 16px 20px;
	margin-bottom: 16px;
	max-width: 860px;
}

.aamo-config-card h2 {
	margin: 0 0 12px;
	padding-bottom: 10px;
	border-bottom: 1px solid #eee;
	font-size: 15px;
	font-weight: 600;
	color: #1d2327;
}

.aamo-role-checkboxes {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 28px;
}

.aamo-role-label {
	display: flex;
	align-items: center;
	gap: 6px;
	cursor: pointer;
	font-size: 13px;
	min-width: 130px;
}

.aamo-role-label input[type="checkbox"] {
	margin: 0;
	flex-shrink: 0;
}

.aamo-assignments-actions {
	margin-top: 8px;
	display: flex;
	align-items: center;
	gap: 10px;
}

/* =============================================================================
   Settings page
   ============================================================================= */

.aamo-settings-panel {
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 3px;
	padding: 20px 24px;
	max-width: 700px;
	margin-top: 16px;
}

.aamo-panel-locked {
	opacity: 0.45;
	pointer-events: none;
	user-select: none;
}

.aamo-settings-panel-title {
	margin: 0 0 16px;
	padding: 0 0 12px;
	border-bottom: 1px solid #eee;
	font-size: 14px;
	font-weight: 600;
}

.aamo-settings-table {
	width: 100%;
	border-collapse: collapse;
}

.aamo-settings-table th,
.aamo-settings-table td {
	padding: 8px 12px 8px 0;
	vertical-align: top;
	border-bottom: 1px solid #f0f0f0;
	font-size: 13px;
}

.aamo-settings-table tr:last-child th,
.aamo-settings-table tr:last-child td {
	border-bottom: none;
}

.aamo-settings-table th {
	width: 140px;
	color: #646970;
	font-weight: 400;
	white-space: nowrap;
}

.aamo-settings-meta {
	margin-left: 8px;
	color: #646970;
	font-size: 12px;
}

.aamo-settings-note {
	display: block;
	margin-top: 4px;
	color: #646970;
	font-size: 12px;
}

.aamo-settings-note a {
	margin-left: 4px;
}

.aamo-settings-mono {
	font-family: monospace;
	font-size: 12px;
}

.aamo-settings-description {
	margin: 0 0 16px;
	color: #3c434a;
	font-size: 13px;
}

.aamo-settings-warning {
	padding: 8px 12px;
	margin-bottom: 16px;
	background: #fcf0d3;
	border-left: 4px solid #dba617;
	font-size: 13px;
}

.aamo-settings-actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.aamo-settings-action-row {
	display: flex;
	align-items: center;
	gap: 12px;
}

.aamo-settings-file-row {
	display: flex;
	align-items: center;
	gap: 12px;
}

.aamo-file-input {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	opacity: 0;
}

.aamo-file-name {
	font-style: italic;
}

/* Status badges */

.aamo-badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 3px;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.6;
}

.aamo-badge-green {
	background: #d1e7dd;
	color: #0a3622;
}

.aamo-badge-orange {
	background: #fff3cd;
	color: #664d03;
}

.aamo-badge-gray {
	background: #f0f0f1;
	color: #50575e;
}

/* =============================================================================
   Dashboard Message panel
   ============================================================================= */

.aamo-dm-toggle-row {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-bottom: 16px;
}

.aamo-toggle-label {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	font-weight: 600;
	font-size: 13px;
	color: #1d2327;
}

.aamo-toggle-label input[type="checkbox"] {
	margin: 0;
	flex-shrink: 0;
}

.aamo-dm-fields {
	display: flex;
	flex-direction: column;
	gap: 16px;
	margin-bottom: 20px;
}

.aamo-dm-field-row {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.aamo-dm-label {
	font-weight: 600;
	font-size: 13px;
	color: #1d2327;
}

.aamo-dm-editor-row {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.aamo-dm-save-row {
	margin-top: 4px;
}

/* =============================================================================
   Plugin Access Control panel
   ============================================================================= */

.aamo-access-modes {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-bottom: 20px;
}

.aamo-access-mode-option {
	display: grid;
	grid-template-columns: 16px 1fr;
	grid-template-rows: auto auto;
	column-gap: 10px;
	row-gap: 2px;
	cursor: pointer;
}

.aamo-access-mode-option input[type="radio"] {
	grid-row: 1;
	grid-column: 1;
	margin-top: 3px;
	flex-shrink: 0;
}

.aamo-access-mode-label {
	grid-row: 1;
	grid-column: 2;
	font-weight: 600;
	font-size: 13px;
	color: #1d2327;
}

.aamo-access-mode-desc {
	grid-row: 2;
	grid-column: 2;
	font-size: 12px;
	color: #646970;
	line-height: 1.5;
}

.aamo-access-mode-disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

.aamo-access-mode-apply-row {
	margin-top: 4px;
}

.aamo-access-divider {
	border: none;
	border-top: 1px solid #eee;
	margin: 20px 0;
}

.aamo-settings-subheading {
	margin: 0 0 12px;
	font-size: 13px;
	font-weight: 600;
	color: #1d2327;
}

.aamo-settings-subheading-sm {
	margin: 12px 0 8px;
	font-size: 12px;
	font-weight: 600;
	color: #646970;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.aamo-user-select {
	min-width: 220px;
}

.aamo-holders-table {
	border-collapse: collapse;
	width: 100%;
	margin-top: 4px;
}

.aamo-holders-table td {
	padding: 5px 8px 5px 0;
	font-size: 13px;
	vertical-align: middle;
	border-bottom: 1px solid #f0f0f1;
}

.aamo-holders-table tr:last-child td {
	border-bottom: none;
}

.aamo-holders-table td:last-child {
	width: 80px;
	text-align: right;
}

/* ── Template Library ────────────────────────────────────────────────────────────────────────── */

.aamo-tl-list {
	margin-top: 12px;
}

.aamo-tl-row {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 0;
	border-top: 1px solid #f0f0f0;
	font-size: 13px;
}

.aamo-tl-row:first-child {
	border-top: none;
}

.aamo-tl-row-meta {
	flex: 1;
	min-width: 0;
}

.aamo-tl-row-name {
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.aamo-tl-row-desc {
	color: #787c82;
	margin-top: 2px;
}

.aamo-tl-row-date {
	color: #787c82;
	white-space: nowrap;
	flex-shrink: 0;
}

.aamo-tl-row-actions {
	display: flex;
	gap: 6px;
	flex-shrink: 0;
}

.aamo-tl-row-status {
	font-size: 12px;
	color: #787c82;
	min-width: 80px;
}

/* ── Admin Bar Customizer ──────────────────────────────────────────────────── */

.aamo-icon-preview {
	display: block;
	width: 40px;
	height: 40px;
	border: 1px solid #ddd;
	border-radius: 3px;
	object-fit: contain;
	background: #f0f0f1;
	margin-bottom: 6px;
}

.aamo-branding-icon-picker {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

/* ── Color Customizer ──────────────────────────────────────────────────────── */

.aamo-color-group {
	border: 1px solid #ddd;
	border-radius: 3px;
	padding: 12px 16px;
	margin-bottom: 12px;
	max-width: 400px;
}

.aamo-color-group-title {
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #787c82;
	margin: 0 0 10px;
}

.aamo-color-row {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 8px;
	font-size: 13px;
}

.aamo-color-row:last-child {
	margin-bottom: 0;
}

.aamo-color-label {
	min-width: 130px;
	flex-shrink: 0;
}

.aamo-api-error-warning {
	margin: 12px 0;
	padding: 10px 14px;
	background: #fff8e1;
	border-left: 4px solid #f0a500;
	border-radius: 3px;
	color: #5a4000;
	font-size: 13px;
	line-height: 1.5;
}

.aamo-api-error-warning strong {
	display: block;
	margin-bottom: 4px;
}

.aamo-api-error-timer {
	display: block;
	margin-top: 4px;
	font-size: 12px;
	opacity: 0.75;
}

/* ── Admin Layout page ─────────────────────────────────────────────────── */

.aamo-status-success {
	color: #00a32a;
}

.aamo-status-error {
	color: #d63638;
}

/* ── Tab panels ────────────────────────────────────────────────────────────── */

.aamo-tab-panel { display: none; }
.aamo-tab-panel.is-active { display: flow-root; } /* BFC: prevents first-child margin-collapse */

/* ── Tabs card (outer rounded container) ───────────────────────────────────── */

.aamo-tabs-card {
	border: 1px solid #dcdcde;
	border-radius: 6px;
	overflow: hidden;
}

/* Tab strip — gray header row holding the tab buttons */
.aamo-tabs-card .nav-tab-wrapper {
	background: #ededee;
	border-bottom: 1px solid #dcdcde;
	padding: 10px 16px 0;
	margin: 0;
}

/* Tab buttons — white blocks with rounded tops */
.aamo-tabs-card .nav-tab {
	background: #fff;
	border: 1px solid #dcdcde;
	border-bottom: none;
	border-radius: 4px 4px 0 0;
	color: #50575e;
	padding: 7px 18px;
	margin: 0 4px 0 0;
	margin-bottom: -1px; /* overlap strip border so active tab connects to pane */
	font-weight: 500;
}

.aamo-tabs-card .nav-tab:hover,
.aamo-tabs-card .nav-tab:focus {
	background: #fff;
	color: #1d2327;
	border-color: #c3c4c7;
}

/* Active tab — background matches the pane so it opens flush into the content */
.aamo-tabs-card .nav-tab-active,
.aamo-tabs-card .nav-tab-active:hover,
.aamo-tabs-card .nav-tab-active:focus {
	background: #f6f7f8;
	border-color: #dcdcde;
	border-bottom-color: #f6f7f8;
	color: #1d2327;
	font-weight: 600;
}

/* ── Tab content pane ──────────────────────────────────────────────────────── */

.aamo-tab-content {
	background: #f6f7f8;
	padding: 20px;
}

/* Full-width cards inside the pane */
.aamo-tab-content .aamo-settings-panel {
	max-width: none;
	margin-top: 16px;
}
.aamo-tab-content .aamo-settings-panel:first-child {
	margin-top: 0;
}

/* ── Collapsible panel headers ─────────────────────────────────────────────── */

.aamo-settings-panel-title {
	display: flex;
	align-items: center;
	justify-content: space-between;
	cursor: pointer;
	user-select: none;
}

.aamo-settings-panel-title:hover {
	color: #2271b1;
}

.aamo-collapse-chevron {
	font-family: dashicons !important;
	font-size: 20px;
	line-height: 1;
	width: 20px;
	height: 20px;
	color: #8c8f94;
	flex-shrink: 0;
	margin-left: 8px;
	text-align: center;
}

.aamo-settings-panel.aamo-panel-collapsed .aamo-settings-panel-title {
	margin-bottom: 0;
	padding-bottom: 0;
	border-bottom: none;
}

.aamo-settings-panel.aamo-panel-collapsed > *:not(.aamo-settings-panel-title) {
	display: none;
}

/* -----------------------------------------------------------------------------
   Shadow sliders
   ----------------------------------------------------------------------------- */

#aamo-shadow-options {
	padding-left: 4px;
	margin-top: 2px;
}

.aamo-slider-row {
	gap: 8px;
}

.aamo-slider {
	flex: 1;
	min-width: 80px;
	max-width: 160px;
	margin: 0;
	cursor: pointer;
	vertical-align: middle;
}

.aamo-slider-value {
	min-width: 38px;
	font-size: 12px;
	color: #50575e;
	text-align: right;
	flex-shrink: 0;
}

/* =============================================================================
   Role Manager — Plugin Access card
   ============================================================================= */

.aamo-access-card {
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 3px;
	padding: 16px 20px;
	margin: 16px 0 24px;
	max-width: 860px;
}

.aamo-access-card-header h2 {
	margin: 0 0 4px;
	font-size: 15px;
	font-weight: 600;
	color: #1d2327;
}

.aamo-access-card-header .description {
	margin: 0 0 16px;
}

.aamo-access-current h3 {
	margin: 0 0 10px;
	font-size: 13px;
	font-weight: 600;
	color: #50575e;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.aamo-access-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.aamo-access-entry {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 7px 0;
	border-bottom: 1px solid #f0f0f1;
}

.aamo-access-entry:last-child {
	border-bottom: none;
}

.aamo-access-icon {
	color: #787c82;
	flex-shrink: 0;
}

.aamo-access-name {
	font-weight: 500;
	color: #1d2327;
}

.aamo-access-email {
	color: #787c82;
	font-size: 12px;
}

.aamo-access-badge {
	margin-left: auto;
	font-size: 11px;
	color: #50575e;
	background: #f0f0f1;
	border-radius: 3px;
	padding: 2px 7px;
	flex-shrink: 0;
}

.aamo-access-badge-user {
	background: #f0f6fc;
	color: #2271b1;
}

/* =============================================================================
   Role Manager — grant form and revoke buttons
   ============================================================================= */

.aamo-access-grant {
	padding: 14px 0 16px;
	border-bottom: 1px solid #eee;
	margin-bottom: 16px;
}

.aamo-grant-row {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 8px;
}

.aamo-grant-row:last-of-type {
	margin-bottom: 0;
}

.aamo-grant-row label {
	min-width: 110px;
	font-weight: 500;
	color: #1d2327;
}

.aamo-grant-row select {
	min-width: 200px;
}

.aamo-revoke-role,
.aamo-revoke-user {
	margin-left: auto;
	flex-shrink: 0;
}

.aamo-revoke-warn {
	border-color: #d63638 !important;
	color: #d63638 !important;
}

.aamo-revoke-warn:hover,
.aamo-revoke-warn:focus {
	background: #d63638 !important;
	color: #fff !important;
}

.aamo-status-success {
	color: #00a32a;
}

.aamo-status-error {
	color: #d63638;
}

/* =============================================================================
   Role Manager — user search autocomplete
   ============================================================================= */

.aamo-user-search-wrap {
	position: relative;
	display: inline-block;
}

.aamo-user-search-wrap input[type="text"] {
	min-width: 240px;
}

.aamo-user-suggestions {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 100%;
	background: #fff;
	border: 1px solid #ddd;
	border-top: none;
	border-radius: 0 0 3px 3px;
	box-shadow: 0 4px 8px rgba(0,0,0,.08);
	z-index: 9999;
	max-height: 220px;
	overflow-y: auto;
}

.aamo-suggestion-item {
	padding: 7px 12px;
	cursor: pointer;
	display: flex;
	gap: 4px;
	align-items: baseline;
	line-height: 1.4;
}

.aamo-suggestion-item:hover,
.aamo-suggestion-item:focus {
	background: #f0f6fc;
	outline: none;
}

.aamo-sug-name {
	font-weight: 500;
	color: #1d2327;
}

.aamo-sug-email {
	color: #787c82;
	font-size: 12px;
}

.aamo-suggestion-empty {
	padding: 7px 12px;
	color: #787c82;
	font-style: italic;
}

/* =============================================================================
   Role Manager — Role Editor
   ============================================================================= */

.aamo-role-editor-wrap {
	margin-top: 28px;
}

.aamo-role-editor-header {
	margin-bottom: 16px;
}

.aamo-role-editor-header h2 {
	margin: 0 0 4px;
	font-size: 1.1em;
}

.aamo-role-editor-cols {
	display: flex;
	gap: 0;
	align-items: flex-start;
	border: 1px solid #c3c4c7;
	border-radius: 3px;
	background: #fff;
	min-height: 300px;
}

/* ── Left column: role list ─── */

.aamo-role-list-col {
	width: 260px;
	flex-shrink: 0;
	border-right: 1px solid #c3c4c7;
	overflow-y: auto;
	max-height: 520px;
}

#aamo-role-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.aamo-role-item {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 8px;
	padding: 10px 14px;
	cursor: pointer;
	border-bottom: 1px solid #f0f0f1;
	transition: background 0.1s;
}

.aamo-role-item:last-child {
	border-bottom: none;
}

.aamo-role-item:hover {
	background: #f6f7f7;
}

.aamo-role-item:focus {
	outline: 2px solid #2271b1;
	outline-offset: -2px;
}

.aamo-role-item.aamo-role-selected {
	background: #f0f6fc;
	border-left: 3px solid #2271b1;
	padding-left: 11px;
}

.aamo-role-name {
	font-weight: 500;
	color: #1d2327;
	flex: 1 1 100%;
}

.aamo-role-meta {
	font-size: 11px;
	color: #787c82;
	display: flex;
	align-items: center;
	gap: 6px;
	flex: 1;
}

.aamo-role-builtin-badge {
	background: #f0f0f1;
	color: #50575e;
	border-radius: 2px;
	padding: 1px 5px;
	font-size: 10px;
	text-transform: uppercase;
	letter-spacing: .03em;
}

.aamo-role-actions {
	display: flex;
	gap: 4px;
	opacity: 0;
	transition: opacity 0.1s;
}

.aamo-role-item:hover .aamo-role-actions,
.aamo-role-item:focus .aamo-role-actions,
.aamo-role-item.aamo-role-selected .aamo-role-actions {
	opacity: 1;
}

.aamo-clone-role,
.aamo-delete-role {
	font-size: 11px !important;
	padding: 0 6px !important;
	height: 22px !important;
	line-height: 20px !important;
}

/* ── Right column: caps panel ─── */

.aamo-role-caps-col {
	flex: 1;
	min-width: 0;
	padding: 20px 24px;
}

.aamo-role-caps-panel.aamo-caps-empty {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 260px;
}

.aamo-caps-empty .description {
	color: #787c82;
	font-style: italic;
}

/* =============================================================================
   Role Manager — Capability Editor panel
   ============================================================================= */

.aamo-caps-loading {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 260px;
}

.aamo-caps-spinner {
	float: none;
	margin: 0 auto;
}

/* Header */
.aamo-caps-header {
	margin-bottom: 12px;
}

.aamo-caps-header h3 {
	margin: 0 0 6px;
	font-size: 1em;
}

.aamo-caps-admin-warn {
	margin: 0 0 8px !important;
}

/* Search */
.aamo-caps-search-wrap {
	margin-bottom: 14px;
}

.aamo-caps-search {
	width: 100%;
	max-width: 380px;
}

/* Groups */
.aamo-caps-group {
	margin-bottom: 10px;
}

.aamo-caps-group-toggle {
	display: flex;
	align-items: center;
	gap: 5px;
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
	font-weight: 600;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: #50575e;
	margin-bottom: 4px;
}

.aamo-caps-group-toggle:hover {
	color: #2271b1;
}

.aamo-caps-group-toggle .dashicons {
	font-size: 14px;
	width: 14px;
	height: 14px;
	transition: transform .15s;
}

.aamo-group-count {
	font-weight: 400;
}

.aamo-group-collapsed .aamo-caps-group-toggle .dashicons {
	transform: rotate(-90deg);
}

.aamo-group-collapsed .aamo-caps-group-body {
	display: none;
}

/* Cap rows */
.aamo-caps-group-body {
	margin: 0;
	padding: 0;
	list-style: none;
	columns: 2;
	column-gap: 20px;
}

@media ( max-width: 1200px ) {
	.aamo-caps-group-body {
		columns: 1;
	}
}

.aamo-cap-row {
	break-inside: avoid;
	padding: 2px 0;
}

.aamo-cap-row label {
	display: flex;
	align-items: baseline;
	gap: 5px;
	cursor: pointer;
}

.aamo-cap-name {
	font-family: monospace;
	font-size: 12px;
	color: #1d2327;
	word-break: break-all;
}

.aamo-cap-ungrant .aamo-cap-name {
	color: #787c82;
}

.aamo-cap-row label:hover .aamo-cap-name {
	color: #2271b1;
}

/* =============================================================================
   Role Manager — Save Changes bar
   ============================================================================= */

.aamo-caps-save-bar {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 18px;
	padding-top: 14px;
	border-top: 1px solid #f0f0f1;
}

.aamo-caps-save-bar .spinner {
	float: none;
	margin: 0;
}

.aamo-caps-save-status {
	font-size: 13px;
}

.aamo-caps-save-status.aamo-status-success {
	color: #00a32a;
}

.aamo-caps-save-status.aamo-status-error {
	color: #d63638;
}

/* =============================================================================
   Role Manager — Add Custom Capability row
   ============================================================================= */

.aamo-caps-add-wrap {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 16px;
	padding-top: 14px;
	border-top: 1px solid #f0f0f1;
}

.aamo-add-cap-label {
	font-weight: 600;
	font-size: 12px;
	color: #50575e;
	white-space: nowrap;
}

.aamo-add-cap-input {
	min-width: 220px;
	font-family: monospace;
}

.aamo-add-cap-error {
	width: 100%;
	font-size: 12px;
	color: #d63638;
	margin-top: -4px;
}

/* =============================================================================
   Role Manager — Clone / Delete modal overlay
   ============================================================================= */

.aamo-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,.55);
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
}

.aamo-modal-overlay[hidden] {
	display: none;
}

.aamo-modal-dialog {
	background: #fff;
	border-radius: 4px;
	box-shadow: 0 8px 32px rgba(0,0,0,.22);
	width: 480px;
	max-width: 95vw;
	max-height: 90vh;
	overflow-y: auto;
}

.aamo-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
	border-bottom: 1px solid #dcdcde;
}

.aamo-modal-header h2 {
	margin: 0;
	font-size: 1em;
}

.aamo-modal-close {
	background: none;
	border: none;
	cursor: pointer;
	font-size: 22px;
	line-height: 1;
	color: #787c82;
	padding: 0 4px;
}

.aamo-modal-close:hover {
	color: #1d2327;
}

.aamo-modal-body {
	padding: 16px 20px;
}

.aamo-modal-body .form-table th {
	width: 130px;
	padding: 8px 0;
	vertical-align: middle;
}

.aamo-modal-body .form-table td {
	padding: 8px 0;
}

.aamo-modal-footer {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 14px 20px;
	border-top: 1px solid #dcdcde;
}

.aamo-modal-footer .spinner {
	float: none;
	margin: 0;
}

.aamo-field-error {
	color: #d63638;
	font-size: 12px;
	margin: 4px 0 0;
	min-height: 1em;
}

/* =============================================================================
   Role Manager — New Role button footer
   ============================================================================= */

.aamo-role-list-footer {
	padding: 10px 14px;
	border-top: 1px solid #f0f0f1;
}

/* =============================================================================
   Role Manager — Danger button
   ============================================================================= */

.aamo-btn-danger {
	background: #d63638 !important;
	border-color: #d63638 !important;
	color: #fff !important;
}

.aamo-btn-danger:hover:not(:disabled) {
	background: #b32d2e !important;
	border-color: #b32d2e !important;
}

.aamo-btn-danger:disabled {
	opacity: .5;
	cursor: not-allowed;
}

/* =============================================================================
   Role Manager — Administrator role warning indicator
   ============================================================================= */

.aamo-role-item.aamo-role-admin-selected.aamo-role-selected {
	border-left-color: #dba617;
	background: #fcf9e8;
}

/* ── Add Capability type-ahead ─────────────────────────────────────────────── */
.aamo-add-cap-field-wrap {
	position: relative;
	display: inline-flex;
	flex-direction: column;
}

.aamo-add-cap-field-wrap .aamo-add-cap-input {
	width: 220px;
}

.aamo-add-cap-suggestions {
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 9999;
	min-width: 220px;
	max-height: 200px;
	overflow-y: auto;
	margin: 0;
	padding: 0;
	list-style: none;
	background: #fff;
	border: 1px solid #c3c4c7;
	border-top: none;
	border-radius: 0 0 3px 3px;
	box-shadow: 0 4px 10px rgba(0,0,0,.12);
}

.aamo-add-cap-sug-item {
	padding: 6px 10px;
	font-size: 12px;
	font-family: monospace;
	color: #2c3338;
	cursor: pointer;
	border-bottom: 1px solid #f0f0f1;
}

.aamo-add-cap-sug-item:last-child {
	border-bottom: none;
}

.aamo-add-cap-sug-item:hover,
.aamo-add-cap-sug-item.aamo-sug-active {
	background: #f0f6ff;
	color: #135e96;
}
